This is posted mainly for my future reference, but it probably is helpful to others.
What I am doing is taking single page TIF Files of various sizes and DPI and creating a multi page PDF with proper formatting and aspect ratios. Below is the settings and code to do this using IrfranView. What I'm actually doing is much more complex than this, but this is enough of the code to figure it out without trial and error like I did. Ifranview has a lot more power than is documented.
The source files are single page TIF files of varying sizes at 200DPI. The destination is a PDF of same sized images which view and print nicely.
The INI file i_view32.ini has the following added to it to make these transitions;
[Batch]
AdvCrop=0
AdvCropX=0
AdvCropY=0
AdvCropW=0
AdvCropH=0
AdvCropC=0
AdvResize=0
AdvResizeOpt=0
AdvResizeW=966.00
AdvResizeH=1020.00
AdvResizeL=0.00
AdvResizeS=0.00
AdvResample=1
AdvResizePerc=0
AdvResizePercW=0
AdvResizePercH=0
AdvDPI=120
AdvResizeUnit=0
AdvResizeRatio=0
AdvNoEnlarge=0
AdvCanvas=1
AdvAddText=1
AdvUseBPP=0
AdvBPP=0
AdvUseFSDither=1
AdvAutoRGB=0
AdvHFlip=0
AdvVFlip=0
AdvRLeft=0
AdvRRight=0
AdvGray=0
AdvInvert=0
AdvSharpen=0
AdvGamma=0
AdvContrast=0
AdvBrightness=0
AdvSaturation=0
AdvColR=0
AdvColG=0
AdvColB=0
AdvSharpenVal=1
AdvGammaVal=0.00
AdvContrastVal=0
AdvBrightnessVal=0
AdvSaturationVal=0
AdvColRVal=0
AdvColGVal=0
AdvColBVal=0
AdvDelOrg=0
AdvOverwrite=1
AdvSubdirs=0
AdvSaveOldDate=0
AdvAllPages=1
AdvFineR=0
AdvFineRVal=0.00
AdvBlur=0
AdvBlurVal=1
AdvMedian=0
AdvMedianVal=3
AdvRbg=0
AdvBgr=0
AdvBrg=0
AdvGrb=0
AdvGbr=0
AdvAutoCrop=0
SaveExtension=tif
Work=0
RenamePattern=image###
UseAdvanced=1
OpenIndex=1
UseAdvanced=1
OpenIndex=1
[Effects]
UseResample=0
CanvB=1110
CanvW=1110
CanvColor=16777215
OilPaint=0
RotateDegrees=0
CanvL=0
CanvR=966
CanvT=0
[BatchText]
AddText=www.YourWebsite.com
TextCoord=830;1050;960;1100;
Corner=0
Orientation=2
TranspText=0
FontColor=0
TxtBgkr=16777215
FontParam=-13|0|0|0|400|0|0|0|0|3|2|1|34|
Font=Arial
The code below is VBScript for applications which makes this change.
This is a subsection of code.
for looper = 1 to cnt2
WriteInfo "mailfile:" & PDFFileName, TIFFilename
'Convert all the TIFs in the owerns folder to 120 DPI for printing to look right;
Shellto = "C:\Progra~1\IrfanView\i_view32.exe " + chr(34) + "c:\temp\stm\" & OWNERCLEAN & "\" & Cstr(looper) & ".tif" + chr(34) + " /advancedbatch /silent /dpi=(120,120) /crop=(0,0,966,1110) /append=" + chr(34) + "c:\temp\stm\" & OWNERCLEAN & "aaaa.tif" + chr(34) & " /convert"
WriteInfo "Shellto:" & Shellto
Set oShell = CreateObject("WScript.Shell")
rc = oShell.Run(ShellTo,4,false)
'need to add code to wait until shell is complete
set svc=getobject("winmgmts:root\cimv2")
sQuery="select * from win32_process where name='i_view32.exe'"
set cproc=svc.execquery(sQuery)
iniproc=cproc.count 'it can be more than 1
Do While iniproc <> 0
set svc=getobject("winmgmts:root\cimv2")
sQuery="select * from win32_process where name='i_view32.exe'"
set cproc=svc.execquery(sQuery)
iniproc=cproc.count
Loop
set cproc=nothing
set svc=nothing
next
'Take the TIF
'Shellto = "C:\Progra~1\IrfanView\i_view32.exe " + chr(34) + TIFFileName + chr(34) + " /silent /dpi=(120,120) /convert=" + chr(34) + PDFFileName + chr(34)
Shellto = "C:\Progra~1\IrfanView\i_view32.exe " + chr(34) + "c:\temp\stm\" & OWNERCLEAN & "aaaa.tif" + chr(34) + " /silent /dpi=(120,120) /convert=" + chr(34) + PDFFileName + chr(34) & " /convert"
WriteInfo "Shellto:" & Shellto
'Dim oShell
Set oShell = CreateObject("WScript.Shell")
rc = oShell.Run(ShellTo,4,false)
'need to add code to wait until shell is complete
set svc=getobject("winmgmts:root\cimv2")
sQuery="select * from win32_process where name='i_view32.exe'"
set cproc=svc.execquery(sQuery)
iniproc=cproc.count 'it can be more than 1
Do While iniproc <> 0
set svc=getobject("winmgmts:root\cimv2")
sQuery="select * from win32_process where name='i_view32.exe'"
set cproc=svc.execquery(sQuery)
iniproc=cproc.count
Loop
set cproc=nothing
set svc=nothing
Understanding it. The INI addes a white border to the right at bottom of the image. It is X and Y are the page width and lenght of the largest page. Think of it this way. If you get a TIF image which is 1x1 then this will add a border to make it a full page. If it's already a full page, you have a huge image. But that is ok at this point. I specify white for this border as this is a text image. This is the settings CanvR CanvW CanvH.
The INI also puts a watermark in an X Y position which in this case will be the lower right corner of the page. www.Yourwebsite.com.
i_view32.exe " + chr(34) + "c:\temp\stm\" & OWNERCLEAN & "\" & Cstr(looper) & ".tif" + chr(34) + " /advancedbatch /silent /dpi=(120,120) /crop=(0,0,966,1110) /append=" + chr(34) + "c:\temp\stm\" & OWNERCLEAN & "aaaa.tif" + chr(34) & " /convert"
So this says take a source TIF, run it through the advanced batch conversion settings explained above, do this silently if there is an error (don't stop), modify the print DPI to 120x120, then crop that result down to 966x1110 and append that to a multipage TIF. /convert at the end tells Irfanview to close after all of this is done.
C:\Progra~1\IrfanView\i_view32.exe " + chr(34) + TIFFileName + chr(34) + " /silent /dpi=(120,120) /convert=" + chr(34) + PDFFileName + chr(34)
Shellto = "C:\Progra~1\IrfanView\i_view32.exe " + chr(34) + "c:\temp\stm\" & OWNERCLEAN & "aaaa.tif" + chr(34) + " /silent /dpi=(120,120) /convert=" + chr(34) + PDFFileName + chr(34) & " /convert"
This takes the resulting multipage TIF file and converts it to a multipage PDF using the Alternatif PDF Pluging (You have to have the addon plugins.)
This is the result of several weeks of discovery. Many of these features of Irfanview seem poorly documented. Once you discover the true power of the program, it is an amazing piece of software.
Thursday, June 4, 2009
Monday, April 20, 2009
DL320 G3 drivers for non 2000/2003
The IDE is a Mega Raid IDE 100 from LSI; http://www.lsi.com/obsolete/megaraid_ide_100_2567.html?remote=1&locale=EN
The NICs are Broadcom nc7761 which are BCM5704. Find the BCM57xx series NIC drivers and you are set.
The NICs are Broadcom nc7761 which are BCM5704. Find the BCM57xx series NIC drivers and you are set.
Friday, January 2, 2009
Bypassing P2P restrictions by utilizing SMTP/POP3
I'm on the other end of the blocking side here. I actively try to block and or rate limit P2P traffic on my company LANs. We pay for bandwidth and it is many thousands of dollars extra a month to allow this, as we have over 100Mb/s worth of connectivity to the Internet.
I see the battles being played out. First it's a port range, now it can be any port. Then we were able to detect based on signatures in the unencrypted traffic so p2p was switched to SSL. Then we found out we could rate limit anything on a port other than 443 that was SSL but had an invalid certificate (with some exceptions.) So protocol obfuscation was added so we can't tell what protocol it is. But that has a pattern too. Some use bursting limits to detect this, some use packet counts to remote IP's.
There is a thought that this can be moved to UDP to bypass these restrictions due to the lack of SYN control. Plus with UDP and a remote "server", one can poke holes into any firewall and bypass inbound restrictions. But this counts on UDP being opened up outbound. While serving DNS from a local server, we could easily block UDP with a few exception sites.
My idea is to use SMTP and POP3 as additional protocols, not replacement. Using a dedicated real e-mail address for this. If I detect a very tight network such as what I have (eMule gets 1kb/s, Gnutella about 10kb/s on the open network, completely blocked on the closed network) then send my "p2p" e-mail address out to peers, and ask for theirs.
Do an initial exchange setup verify. A remote peer sends my e-mail address an e-mail to verify it can talk to me, and I send one to it. If the software verifies connectivity then packets are sent out via SMTP and downloaded via POP3. This can been over SSL if needed. This is done to prevent some innocent from getting bombarded with these mails.
The e-mails would have nothing in the headers to do pattern matching against. They would generate a very basic envelope. The subject would be completely random set of words. The body would also include a random set of words or phrases. The math behind this would be ever changing to prevent Bayesian filtering. The e-mail body (not attachment) would contain the “packet” to be transferred in lines that are between 5 and 70 characters in length. These lines would be SMTP RFC character set compliant. Each e-mail would be no more than 1Mbit in size. This would be data that is encrypted using something like AES or TwoFish and then mime encoded.
The peer I am requesting data from would send this to it's SMTP server, which would end up making it to my POP3 server. My P2P client would download the e-mail and decode it. I would send back an ACK to the peers e-mail address and await the next packet via POP3.
This would place a huge load on ISP mail servers. Most ISPs block outbound port 25, mandating the use of their SMTP servers though. If we used any other port, then packet shaping would work again.
The idea is that this would be just one of many ways to transfer data. The P2P client would try and figure out which was was the fastest by trying each method. If it finds one method is much faster than another, then it would prefer that for a period of time. If the ISP has their bandwidth shaping between the Internet and their own networks it is possible that this could bypass those filters. If you are on ISP#1 and 20 other peers are too, and you are using their mail servers, all such transfers are local and would not pass by such a bandwidth filter.
An example of an exchange;
From:
To:
Subject: One was fast not enough more time
Date: Tue, 22 Apr 2008 00:53:11 -0700
Message-ID: <12394@ru.dot>
MIME-Version: 1.0
Importance: normal
Priority: normal
This time once fast was enough blow down sky tonight. Lost ever more not as such. Could be nice review this.
ADSK3K39VK2KJN3LKC0A9DFLKJ23LKNL2K3N4K3909DFALDFK
ASLKFJ2LK3J4L2K3L2K3J490GBLAK1JH2LH509BUASDLKFJASED
9A99DLKD988323JHLKBN2LK3HJLKB09ASDFL23KHL5908GKLAA
I see the battles being played out. First it's a port range, now it can be any port. Then we were able to detect based on signatures in the unencrypted traffic so p2p was switched to SSL. Then we found out we could rate limit anything on a port other than 443 that was SSL but had an invalid certificate (with some exceptions.) So protocol obfuscation was added so we can't tell what protocol it is. But that has a pattern too. Some use bursting limits to detect this, some use packet counts to remote IP's.
There is a thought that this can be moved to UDP to bypass these restrictions due to the lack of SYN control. Plus with UDP and a remote "server", one can poke holes into any firewall and bypass inbound restrictions. But this counts on UDP being opened up outbound. While serving DNS from a local server, we could easily block UDP with a few exception sites.
My idea is to use SMTP and POP3 as additional protocols, not replacement. Using a dedicated real e-mail address for this. If I detect a very tight network such as what I have (eMule gets 1kb/s, Gnutella about 10kb/s on the open network, completely blocked on the closed network) then send my "p2p" e-mail address out to peers, and ask for theirs.
Do an initial exchange setup verify. A remote peer sends my e-mail address an e-mail to verify it can talk to me, and I send one to it. If the software verifies connectivity then packets are sent out via SMTP and downloaded via POP3. This can been over SSL if needed. This is done to prevent some innocent from getting bombarded with these mails.
The e-mails would have nothing in the headers to do pattern matching against. They would generate a very basic envelope. The subject would be completely random set of words. The body would also include a random set of words or phrases. The math behind this would be ever changing to prevent Bayesian filtering. The e-mail body (not attachment) would contain the “packet” to be transferred in lines that are between 5 and 70 characters in length. These lines would be SMTP RFC character set compliant. Each e-mail would be no more than 1Mbit in size. This would be data that is encrypted using something like AES or TwoFish and then mime encoded.
The peer I am requesting data from would send this to it's SMTP server, which would end up making it to my POP3 server. My P2P client would download the e-mail and decode it. I would send back an ACK to the peers e-mail address and await the next packet via POP3.
This would place a huge load on ISP mail servers. Most ISPs block outbound port 25, mandating the use of their SMTP servers though. If we used any other port, then packet shaping would work again.
The idea is that this would be just one of many ways to transfer data. The P2P client would try and figure out which was was the fastest by trying each method. If it finds one method is much faster than another, then it would prefer that for a period of time. If the ISP has their bandwidth shaping between the Internet and their own networks it is possible that this could bypass those filters. If you are on ISP#1 and 20 other peers are too, and you are using their mail servers, all such transfers are local and would not pass by such a bandwidth filter.
An example of an exchange;
From:
To:
Subject: One was fast not enough more time
Date: Tue, 22 Apr 2008 00:53:11 -0700
Message-ID: <12394@ru.dot>
MIME-Version: 1.0
Importance: normal
Priority: normal
This time once fast was enough blow down sky tonight. Lost ever more not as such. Could be nice review this.
ADSK3K39VK2KJN3LKC0A9DFLKJ23LKNL2K3N4K3909DFALDFK
ASLKFJ2LK3J4L2K3L2K3J490GBLAK1JH2LH509BUASDLKFJASED
9A99DLKD988323JHLKBN2LK3HJLKB09ASDFL23KHL5908GKLAA
Monday, November 3, 2008
Why cloning sucks
First and foremost, I am against cloning. I do it because I am told to.e
We ordered a batch of HP DC5750's. We made a clone doing sysprep et al. Life was good. But then after the PC's were installed 1000 miles away we discovered that we built the clone from a dual core system and most of the PC's are single core.
Now every time we lauch notepad, control panel, my computer - the system freezes for up to 2 or 3 minutes. The PC's are also reporting hard drive errors.
The fix is to go in and hardware manager and swap the dual processor APIC driver for a single processor.
We ordered a batch of HP DC5750's. We made a clone doing sysprep et al. Life was good. But then after the PC's were installed 1000 miles away we discovered that we built the clone from a dual core system and most of the PC's are single core.
Now every time we lauch notepad, control panel, my computer - the system freezes for up to 2 or 3 minutes. The PC's are also reporting hard drive errors.
The fix is to go in and hardware manager and swap the dual processor APIC driver for a single processor.
Tuesday, September 23, 2008
Windows Active Directory issues with Binding
These are the errors;
Windows cannot bind to domain. (Local Error). Group Policy processing aborted.
Windows cannot query for the list of Group Policy objects. A message that describes the reason for this was previously logged by the policy engine.
Ends up that one of our network guys installed a new server and it was running Computer Browser, and causing constant elections. So the Computer Browser service was down as much as it was up.
We run 3 Computer Browser servers on our LAN to prevent these elections and the guy forgot to disable the service on the new server. Once he disabled the service, I was able to run gpupdate without errors.
This was causing slow logins / logons as well.
Windows cannot bind to domain. (Local Error). Group Policy processing aborted.
Windows cannot query for the list of Group Policy objects. A message that describes the reason for this was previously logged by the policy engine.
Ends up that one of our network guys installed a new server and it was running Computer Browser, and causing constant elections. So the Computer Browser service was down as much as it was up.
We run 3 Computer Browser servers on our LAN to prevent these elections and the guy forgot to disable the service on the new server. Once he disabled the service, I was able to run gpupdate without errors.
This was causing slow logins / logons as well.
Friday, September 19, 2008
Making a Ghost 8.2 clone of my Dell R300 server.
I have historically used Compaq/HP Proliant servers with Intel NICs and chipsets that I have boot disks for. I typically use an older version of the Ultimate Boot Disk which contains Bart's Network Boot Disk, the Microsoft DOS version. I boot to the network in DOS, map a drive, and run ghost.exe to back up the SCSI drives to the LAN.
This doesn't work on my Dell R300. It has too much memory so I run into that issue. Plus there are nasty problems with B57.sys in this environment.
The solution was to download from NU2.com Bart's PE Builder. I installed that and pointed it to my XP SP3 CD (or the parent of the i386 Directory on a network.) Then I took the B57 drivers from Broadcom's site. The drivers are the small K ones, unsigned. The Zip has win_xp_2k3_32 and in that it has b57win32.inf 03/19/2008,10.78.0.0 for the 5700 series. This Dell has 5722 NIC's.
Then I went to LSI's site and did a search for the XP drivers for the SAS controller. The ZIP file has symmpi_xp_x86 and in that lsipseud.inf driver version 06/03/2008,6.5.0. The link is http://www.lsi.com/storage_home/products_home/standard_product_ics/sas_ics/lsisas1068/index.html and click on downloads. The driver is the XP one which is 1.28.03.00. I did not use the WHQL one. I tried the Windows 2003 one from Dell, but that doesn't work in a WINXP OS.
So those are downloaded and put in the C:\pebuilder3110a\drivers\ directories.
I then went into addons and added the Ghost 8.2 files.
Then I created a bootable DVD using the PE builder interface.
I booted up off the DVD and started up the NIC's. Once started, I mapped a drive and ghosted to the network. I was able to see speeds over 1GB/min writing and over 2GB/min on verify. Much quicker than I ever got in DOS.
Anyway, this is how you can GHOST 8.2 a Dell R300 server for disaster recovery. I'm sure you could use this for DD or any other disk cloaning software. I have yet to try restoring the GHOST yet. Hopefully I never will have to try that.
This doesn't work on my Dell R300. It has too much memory so I run into that issue. Plus there are nasty problems with B57.sys in this environment.
The solution was to download from NU2.com Bart's PE Builder. I installed that and pointed it to my XP SP3 CD (or the parent of the i386 Directory on a network.) Then I took the B57 drivers from Broadcom's site. The drivers are the small K ones, unsigned. The Zip has win_xp_2k3_32 and in that it has b57win32.inf 03/19/2008,10.78.0.0 for the 5700 series. This Dell has 5722 NIC's.
Then I went to LSI's site and did a search for the XP drivers for the SAS controller. The ZIP file has symmpi_xp_x86 and in that lsipseud.inf driver version 06/03/2008,6.5.0. The link is http://www.lsi.com/storage_home/products_home/standard_product_ics/sas_ics/lsisas1068/index.html and click on downloads. The driver is the XP one which is 1.28.03.00. I did not use the WHQL one. I tried the Windows 2003 one from Dell, but that doesn't work in a WINXP OS.
So those are downloaded and put in the C:\pebuilder3110a\drivers\ directories.
I then went into addons and added the Ghost 8.2 files.
Then I created a bootable DVD using the PE builder interface.
I booted up off the DVD and started up the NIC's. Once started, I mapped a drive and ghosted to the network. I was able to see speeds over 1GB/min writing and over 2GB/min on verify. Much quicker than I ever got in DOS.
Anyway, this is how you can GHOST 8.2 a Dell R300 server for disaster recovery. I'm sure you could use this for DD or any other disk cloaning software. I have yet to try restoring the GHOST yet. Hopefully I never will have to try that.
Friday, May 16, 2008
How to grab still images off AXIS cameras and generate time lapse movies from them.
This depends on several free programs. mencoder which comes with mplayer2, sleep from Microsoft resource kit, and Irfanview 4.10 or better.
The first batch file grabs the images and looks like this;
==== That is the end of the first batch file. It will grab an image from two cameras and save them with a date and time stamp in separate directories. Obviously you must change this as is appropriate for your hard drive and LAN.
The next batch file is below;
That's a pretty big batch file. What it does is take all of the JPG's and normalizes them using Irfan view. Irfan view has some bugs, so we can't batch convert except for the resize. AXIS sometimes returns back color images, sometimes black and white. The encoding changes. If we don't specify the size on the wget, then sometimes the size can change. mencoder doesn't like any of this. To make a movie, the images must all be the same. Irfanview fills this role.
The mencoder settings are set for high quality, not much compression. You can adjust as needed. This file plays very well in VideoLan (VLC player) if you have problems with codec's in your default media player.
The first batch file grabs the images and looks like this;
e: cd \ md xvid cd\xvid md 8080 md 8081 :top wget -O8081.jpg --tries=1 --timeout=5 "http://user:pwd@domain.dyndns.org:8081/jpg/1/image.jpg" wget -O8080.jpg --tries=1 --timeout=5 "http://user:pwd@domain.dyndns.org:8080/axis-cgi/jpg/image.cgi?camera=1&resolution=1024x800&compression=50" rem If you want an e-mail of the image, use this; rem E:\Blat250\Blat250\full\blat.exe - -body "8081" -serversmtp gmail-smtp-in.l.google.com -f fromuser@domain.com -subject "8081" -to user@gmail.com -attach 8081.jpg -noh2 -alttext Camera setlocal call :GETDATEPARTS "%date%" call :GETTIMEPARTS ren 8081.jpg "8081-%yy%%mm%%dd%_%h%%m%%RANDOM%.jpg" ren 8080.jpg "8080-%yy%%mm%%dd%_%h%%m%%RANDOM%.jpg" move 8081*.jpg 8081\. move 8080*.jpg 8080\. sleep 10 goto top :GETTIMEPARTS for /f "tokens=1-3 delims=:." %%a in ('echo %time%') do call :SETTIMEPART h %%a&call :SETTIMEPART m %%b&call :SETTIMEPART s %%c goto :EOF :SETTIMEPART set %1=%2 if 1%2 LSS 100 set %1=0%2 goto :EOF REM *************************************************** :GETDATEPARTS set dt=%~1 set tok=1-3 if "%dt:~0,1%" GTR "9" set tok=2-4 set yyyy= for /f "tokens=%tok% delims=.:/-, " %%a in ('echo %~1') do ( for /f "skip=1 tokens=2-4 delims=/-,()." %%x in ('echo.^|date') do set %%x=%%a&set %%y=%%b&set %%z=%%c ) if not "%yyyy%"=="" set yy=%yyyy% if 1%yy% LSS 1000 (if %yy% LSS 70 (set yy=20%yy%) else (set yy=19%yy%)) if 1%mm% LSS 100 set mm=0%mm% if 1%dd% LSS 100 set dd=0%dd% goto :EOF
==== That is the end of the first batch file. It will grab an image from two cameras and save them with a date and time stamp in separate directories. Obviously you must change this as is appropriate for your hard drive and LAN.
The next batch file is below;
md e:\xvid\8080\old2 md e:\xvid\8080\old3 md e:\xvid\8081\old2 md e:\xvid\8081\old3 del e:\xvid\8081\old3\*.jpg /q/s del e:\xvid\8080\old3\*.jpg /q/s e: cd\xvid cd 8080 move *.jpg old2\. cd old2 rem cd "C:\Program Files\IrfanView" rem c: rem fails rem start /wait i_view32.exe "e:\xvid\8080\old2\*.jpg" /resize=(600,480) /resample /bpp=24 /aspectratio /jpgq=99 /convert="e:\xvid\8080\old3\*.jpg" /silent dir /b *.jpg > proc.txt @for /f "delims=| tokens=1,2,3,4,5,6,7,8,9,10" %%i in (proc.txt) do ( @echo %%i @echo %%j @C:\zentemp\unsecure\screenc\i_view32 "e:\xvid\8080\old2\%%i" /resample /bpp=24 /aspectratio /jpgq=99 /convert="e:\xvid\8080\old3\%%i" /silent ) cd "C:\Program Files\IrfanView" c: @start /wait i_view32.exe "e:\xvid\8080\old3\*.jpg" /resize=(600,480) /resample /aspectratio /convert="e:\xvid\8080\old3\*.jpg" /silent @e: @e: @cd e:\xvid\8080\old3 @mencoder mf://*.jpg -mf fps=5:type=jpg -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=1800:vbitrate=500:keyint=15:vstrict=0:acodec=ac3:abitrate=64:aspect=4/3 -ofps 25 -o "c:\temp\8080-%DATE:/=%%TIME::=%.mpg" rem remove ,harddup from the line above to make this remove rem duplicate frames. Resulting file is MUCH smaller, however quality does suffer. :try2 @rem o now cam 8081 e: cd\xvid cd 8081 move *.jpg old2\. cd old2 dir /b *.jpg > proc.txt @for /f "delims=| tokens=1,2,3,4,5,6,7,8,9,10" %%i in (proc.txt) do ( @echo %%i @echo %%j @C:\zentemp\unsecure\screenc\i_view32 "e:\xvid\8081\old2\%%i" /resample /bpp=24 /aspectratio /jpgq=99 /convert="e:\xvid\8081\old3\%%i" /silent ) @cd "C:\Program Files\IrfanView" @c: @start /wait i_view32.exe "e:\xvid\8081\old3\*.jpg" /resize=(600,480) /resample /aspectratio /convert="e:\xvid\8081\old3\*.jpg" /silent @e: @cd e:\xvid\8081\old3 @mencoder mf://*.jpg -mf fps=5:type=jpg -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=1800:vbitrate=500:keyint=15:vstrict=0:acodec=ac3:abitrate=64:aspect=4/3 -ofps 25 -o "c:\temp\8081-%DATE:/=%%TIME::=%.mpg"
That's a pretty big batch file. What it does is take all of the JPG's and normalizes them using Irfan view. Irfan view has some bugs, so we can't batch convert except for the resize. AXIS sometimes returns back color images, sometimes black and white. The encoding changes. If we don't specify the size on the wget, then sometimes the size can change. mencoder doesn't like any of this. To make a movie, the images must all be the same. Irfanview fills this role.
The mencoder settings are set for high quality, not much compression. You can adjust as needed. This file plays very well in VideoLan (VLC player) if you have problems with codec's in your default media player.
Subscribe to:
Posts (Atom)