View Full Version : ImageSource
juGGaKNot
22nd June 2009, 13:59
After finding out how powerfull avisynth is i was thinking to make my life a little bit easyer and replace vdub for bmp2avi
All general streams that i have are called XXX_00000, all 24 bit bmp
So i have made a bat for it, using only avs2avi :
set /P mymovie2=Drag the first image of the stream into this window !
echo.
set /P myfps=Enter the FPS you used to capture the stream :
echo.
set /P frms=Enter the number of total FRAMES that you want to be made AVI :
echo.
echo ImageSource(file = "%mymovie2%", start = 0, end = %frms%, fps = %myfps%, use_DevIL = false, info = false, pixel_type = "RGB24") >> "%mypath%\@bmp2avi.avs"
"%mypath%\bin\avs2avi.exe" "%mypath%\@bmp2avi.avs" "%mypath%\@%mymovie%MadeAVI.avi" -w -c NULL
The created avs is :
ImageSource(file = "D:\immaavs\x00000.bmp", start = 0, end = 590, fps = 200, use_DevIL = false, info = false, pixel_type = "RGB24")
The problem is that is does not open the stream, only the first file
mediawiki says string file = "c:\%06d.ebmp"
What can i do to keep the "drag first frame to the windows" feature but make it work ( read to entire stream )
thnx, cheers.
http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/avs2avi.png
Gavino
22nd June 2009, 14:58
If you are sure that the filename will always be of the form XXX_00000.bmp, you could replace file = "%mymovie2%" by
file = LeftStr("%mymovie2%", Strlen("%mymovie2%")-9)+"%05d.bmp"
ie replace the last 9 chars by "%05d.bmp".
(Alternatively, you could do the equivalent string processing in the .bat file itself instead of in the script.)
juGGaKNot
22nd June 2009, 15:13
If you are sure that the filename will always be of the form XXX_00000.bmp, you could replace file = "%mymovie2%" by
file = LeftStr("%mymovie2%", Strlen("%mymovie2%")-9)+"%05d.bmp"
ie replace the last 9 chars by "%05d.bmp".
(Alternatively, you could do the equivalent string processing in the .bat file itself instead of in the script.)
it will alwasy be "name_00000" so _00000 will be in the first frame for all streams, before _00000 its user input
i will try your method, thnx.
juGGaKNot
22nd June 2009, 16:14
echo file = LeftStr("%mymovie2%", Strlen("%mymovie2%")-5)+"%05d.bmp" >> "%mypath%\@bmp2avi.avs"
echo ImageSource(file = "%mymovie2%", start = 0, end = %frms%, fps = %myfps%, use_DevIL = false, info = false, pixel_type = "RGB24") >> "%mypath%\@bmp2avi.avs"
will become :
file = LeftStr("D:\immaavs\x00000.bmp", Strlen("D:\immaavs\x00000.bmp")-5)+""D:\immaavs\@VDUB.bat"5d.bmp"
ImageSource(file = "D:\immaavs\x00000.bmp", start = 0, end = 591, fps = 200, use_DevIL = false, info = false, pixel_type = "RGB24")
Seems not to work.
Gavino
22nd June 2009, 18:17
Three problems here.
1. Why did you put -5 where I said -9? You need to strip off "00000.bmp", 9 characters.
2. I meant replace "file=..." inside the ImageSource call. Adding a separate line "file=..." is OK too, but then you need to change the ImageSource call to start "ImageSource(file=file, ..."
3. The string "%0" is being intercepted by the batch file command and changed into the name of the .bat file. You need to 'escape' the % character somehow. I've forgotten how to do that :( but perhaps you know or can find out.
juGGaKNot
22nd June 2009, 19:01
Three problems here.
1. Why did you put -5 where I said -9? You need to strip off "00000.bmp", 9 characters.
2. I meant replace "file=..." inside the ImageSource call. Adding a separate line "file=..." is OK too, but then you need to change the ImageSource call to start "ImageSource(file=file, ..."
3. The string "%0" is being intercepted by the batch file command and changed into the name of the .bat file. You need to 'escape' the % character somehow. I've forgotten how to do that :( but perhaps you know or can find out.
I see, forgot about the extension so i replaced 9 with 5, thnx.
what does %0 do, i will try some stuff.
thnx.
LE :
ImageSource(file = LeftStr("D:\immaavs\x00000.bmp", Strlen("D:\immaavs\x00000.bmp")-9)+""D:\immaavs\@VDUB.bat"5d.bmp", start = 0, end = 591, fps = 200, use_DevIL = false, info = false, pixel_type = "RGB24")
damn %0.
Gavino
22nd June 2009, 20:10
Try replacing %0 by %%^0
No guarantees, but it might just work. :)
Failing that, I'm sure this different approach will work:
echo ImageSource(file = LeftStr("%mymovie2%", Strlen("%mymovie2%")-9)+chr(37)+"05d.bmp", etc
juGGaKNot
22nd June 2009, 20:27
Try replacing %0 by %%^0
No guarantees, but it might just work. :)
Failing that, I'm sure this different approach will work:
echo ImageSource(file = LeftStr("%mymovie2%", Strlen("%mymovie2%")-9)+chr(37)+"05d.bmp", etc
%%0 works fine
thnx, close.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.