Posting this here, as it's more about scripting than encoding.
I'm currently converting 4 seasons of a series for my omnia2 winmo phone. I have my standard settings/script, but want to make it universal, by allowing input datas (names/directories) to be inserted "once" in the beginning, then have the script insert the data as needed.
Here's where I am so far...
I've even tried %1, %2, %3, but both ways fail to load the files into x264.exe.Code:@echo off cd /d "C:\x264 tools\" %input% == F:\weeds\1-05\1.05.avs %output% == E:\weeds\season_1\1-1-05\1.05 %chapters% == F:\weeds\1-05\chapters.txt %stats% == C:\x264 tools\stats\stats.stat @x264.exe --profile baseline --level 3 --slow-firstpass --pass 1 --bitrate 1200 --vbv-bufsize 10000 --vbv-maxrate 10000 --ratetol 50 --stats "%stats%" --ref 2 --keyint 240 --min-keyint 24 --scenecut 40 --rc-lookahead 40 --no-fast-pskip --bframes 0 --no-cabac --deblock -3:-3 --subme 6 --trellis 0 --partitions p8x8,b8x8,i4x4 --no-8x8dct --me esa --merange 64 --sar 1:1 --fps 23.976 --threads 2 --thread-input --output NUL "%input%" echo+ @x264.exe --profile baseline --level 3 --pass 2 --bitrate 1200 --vbv-bufsize 10000 --vbv-maxrate 10000 --ratetol 1 --stats "%stats%" --ref 2 --keyint 240 --min-keyint 24 --scenecut 40 --rc-lookahead 40 --no-fast-pskip --bframes 0 --no-cabac --deblock -3:-3 --subme 6 --trellis 0 --partitions p8x8,b8x8,i4x4 --no-8x8dct --me esa --merange 64 --sar 1:1 --fps 23.976 --threads 2 --thread-input --output "%output%.mp4" "%input%" echo+ @bepipe.exe --script "import(^%input%^)" | faac.exe -b 128 - -o "%output%.audio.mp4" echo+ @mp4box.exe -add "%output%.audio.mp4" "%output%.mp4" -chap "%chapters%" -itags "name=1.05: Lude Awakening:artist=Weeds:album=Season 1:album_artist=Weeds:created=2006:track=5" @if not errorlevel 1 del "%output%.audio.mp4" pause
Any advice greatly appreciated
cheers
+ Reply to Thread
Results 1 to 7 of 7
-
-
This link may be of help http://forum.doom9.org/archive/index.php/t-129415.html for some batch file examples.
This quote from the link may help with setting up the x264 parameters.
REM Video Conversion 2-Pass
C:\Programme\megui\tools\x264\x264.exe --pass 1 --bitrate %3 --stats "%~dp1%~n1.stats" --ref 2 --mixed-refs --no-fast-pskip --bframes 3 --b-pyramid --bime --weightb --trellis 1 --analyse all --8x8dct --threads auto --thread-input --progress --no-dct-decimate --no-psnr --no-ssim --output NUL "%~f1"
C:\Programme\megui\tools\x264\x264.exe --pass 2 --bitrate %3 --stats "%~dp1%~n1.stats" --ref 2 --mixed-refs --no-fast-pskip --bframes 3 --b-pyramid --bime --weightb --trellis 1 --analyse all --8x8dct --threads auto --thread-input --progress --no-dct-decimate --no-psnr --no-ssim --output "%~dp1%~n1_video.264" "%~f1"Just another sheep boy, duck call, swan
song, idiot son of donkey kong - Julian Cope" -
thanks Safesurfer
I saved that page, and will try tonight.
Greatly appreciated.. thanks again
cheers... -
%input% == F:\weeds\1-05\1.05.avs
%output% == E:\weeds\season_1\1-1-05\1.05
%chapters% == F:\weeds\1-05\chapters.txt
%stats% == C:\x264 tools\stats\stats.stat
change to
set input = F:\weeds\1-05\1.05.avs
set output = E:\weeds\season_1\1-1-05\1.05
set chapters = F:\weeds\1-05\chapters.txt
set stats = C:\x264 tools\stats\stats.stat
Your work will be easier if you don't use file or directory names with spaces in them, so consider renaming c:\x264 tools to c:\x264_tools"Quality is cool, but don't forget... Content is King!" -
thanks Soopafresh.. this is what I came up with from the link Safesurfer suggested.
Code:@echo off rem *** set Variables without extensions *** set input_file=F:\weeds\1-06\1.06 set output_file=E:\weeds\season_1\1-1-06\1.06 set stats_file=C:\x264 tools\stats\1.06 set video_bitrate=1200 set audio_bitrate=128 set chapters_file=F:\weeds\1-06\chapters @cd /d "C:\x264 tools\" @x264.exe --profile baseline --level 3 --slow-firstpass --pass 1 --bitrate %video_bitrate% --vbv-bufsize 10000 --vbv-maxrate 10000 --ratetol 50 --stats "%stats_file%.stat" --ref 2 --keyint 240 --min-keyint 24 --scenecut 40 --rc-lookahead 40 --no-fast-pskip --bframes 0 --no-cabac --deblock -3:-3 --subme 6 --trellis 0 --partitions p8x8,b8x8,i4x4 --no-8x8dct --me esa --merange 64 --sar 1:1 --fps 23.976 --threads 2 --thread-input --output NUL "%input_file%.avs" @echo+ @x264.exe --profile baseline --level 3 --pass 2 --bitrate %video_bitrate% --vbv-bufsize 10000 --vbv-maxrate 10000 --ratetol 1 --stats "%stats_file%.stat" --ref 2 --keyint 240 --min-keyint 24 --scenecut 40 --rc-lookahead 40 --no-fast-pskip --bframes 0 --no-cabac --deblock -3:-3 --subme 6 --trellis 0 --partitions p8x8,b8x8,i4x4 --no-8x8dct --me esa --merange 64 --sar 1:1 --fps 23.976 --threads 2 --thread-input --output "%output_file%.mp4" "%input_file%.avs" @echo+ @bepipe.exe --script "import(^%input_file%.avs^)" | faac.exe -b %audio_bitrate% - -o "%output_file%.audio.mp4" @echo+ @mp4box.exe -add "%output_file%.audio.mp4" "%output_file%.mp4" -chap "%chapters_file%.txt" -itags "name=1.06: Dead in the Nethers:artist=Weeds:album=Season 1:album_artist=Weeds:created=2006:track=6" @if not errorlevel 1 del "%output_file%.audio.mp4" "%stats_file%.*" @echo+ pause
or setting up and calling a script as needed:
1.06.bat=
Code:@echo off rem *** set Variables without extensions *** set input_file=F:\weeds\1-06\1.06 set output_file=E:\weeds\season_1\1-1-06\1.06 set stats_file=C:\x264 tools\stats\1.06 set video_bitrate=1200 set audio_bitrate=128 set chapters_file=F:\weeds\1-06\chapters call "C:\x264 tools\scripts\iPhone\480x320.bat" pause
Code:@echo off @cd /d "C:\x264 tools\" @x264.exe --profile baseline --level 3 --slow-firstpass --pass 1 --bitrate %video_bitrate% --vbv-bufsize 10000 --vbv-maxrate 10000 --ratetol 50 --stats "%stats_file%.stat" --ref 2 --keyint 240 --min-keyint 24 --scenecut 40 --rc-lookahead 40 --no-fast-pskip --bframes 0 --no-cabac --deblock -3:-3 --subme 6 --trellis 0 --partitions p8x8,b8x8,i4x4 --no-8x8dct --me esa --merange 64 --sar 1:1 --fps 23.976 --threads 2 --thread-input --output NUL "%input_file%.avs" @echo+ @x264.exe --profile baseline --level 3 --pass 2 --bitrate %video_bitrate% --vbv-bufsize 10000 --vbv-maxrate 10000 --ratetol 1 --stats "%stats_file%.stat" --ref 2 --keyint 240 --min-keyint 24 --scenecut 40 --rc-lookahead 40 --no-fast-pskip --bframes 0 --no-cabac --deblock -3:-3 --subme 6 --trellis 0 --partitions p8x8,b8x8,i4x4 --no-8x8dct --me esa --merange 64 --sar 1:1 --fps 23.976 --threads 2 --thread-input --output "%output_file%.mp4" "%input_file%.avs" @echo+ @bepipe.exe --script "import(^%input_file%.avs^)" | faac.exe -b %audio_bitrate% - -o "%output_file%.audio.mp4" @echo+ @mp4box.exe -add "%output_file%.audio.mp4" "%output_file%.mp4" -chap "%chapters_file%.txt" -itags "name=1.06: Dead in the Nethers:artist=Weeds:album=Season 1:album_artist=Weeds:created=2006:track=6" @if not errorlevel 1 del "%output_file%.audio.mp4" "%stats_file%.*" @echo+
Then I can set up 3 or 4 batches a night, then call with another batch - just need to remove "pause" from each individual script, or it will pause after each
run.bat=
Code:@echo off call "F:\weeds\1-06\1.06.bat" @echo+ call "F:\weeds\1-07\1.07.bat" @echo+ call "F:\weeds\1-08\1.08.bat" @echo+ #call "F:\weeds\1-09\1.09.bat" @echo+ pause
But "x264 stuffs" seems to be fine... after putting in quotes
cheers, and again, a huge thanks.. I'd still be fighting a week down the road otherwise -
Good job, you figured this stuff out quickly
"Quality is cool, but don't forget... Content is King!" -
Thanks
I goofed, but caught it before my next video... everything would've been tagged the same otherwise:doh!:
1.07.bat=
Code:@echo off rem *** set variables without extensions *** set input=F:\weeds\2-01\1.07 set output=E:\weeds\season_1\1-2-01\1.07 set fps=23.976 set stats=C:\x264 tools\stats\1.07 set chapters=F:\weeds\2-01\chapters set title=1.07: Higher Education set artist=Weeds set album=Season 1 set created=2006 set track=7 set comment= call "C:\x264 tools\scripts\iPhone\480x320.bat" pause
480x320.bat=
Code:@echo off @cd /d "C:\x264 tools\" @x264.exe --profile baseline --level 3 --slow-firstpass --pass 1 --bitrate 1200 --vbv-bufsize 10000 --vbv-maxrate 10000 --ratetol 50 --stats "%stats%.stat" --ref 2 --keyint 240 --min-keyint 24 --scenecut 40 --rc-lookahead 40 --no-fast-pskip --bframes 0 --no-cabac --deblock -3:-3 --subme 6 --trellis 0 --partitions p8x8,b8x8,i4x4 --no-8x8dct --me esa --merange 64 --sar 1:1 --fps %fps% --threads 2 --thread-input --output NUL "%input%.avs" @echo+ @x264.exe --profile baseline --level 3 --pass 2 --bitrate 1200 --vbv-bufsize 10000 --vbv-maxrate 10000 --ratetol 1 --stats "%stats%.stat" --ref 2 --keyint 240 --min-keyint 24 --scenecut 40 --rc-lookahead 40 --no-fast-pskip --bframes 0 --no-cabac --deblock -3:-3 --subme 6 --trellis 0 --partitions p8x8,b8x8,i4x4 --no-8x8dct --me esa --merange 64 --sar 1:1 --fps %fps% --threads 2 --thread-input --output "%output%.mp4" "%input%.avs" @echo+ @bepipe.exe --script "import(^%input%.avs^)" | faac.exe -b 128 - -o "%output%.audio.mp4" @echo+ @mp4box.exe -add "%output%.audio.mp4" "%output%.mp4" -chap "%chapters%.txt" -itags "name=%title%:artist=%artist%:album=%album%:created=%created%:track=%track%:comment=%comment%" @if not errorlevel 1 del "%output%.audio.mp4" "%stats%.*" @echo+
Much better now...
cheers v
Similar Threads
-
Batch "file creation from a text file, Placed into a created directory
By Muther in forum ProgrammingReplies: 5Last Post: 24th Sep 2015, 18:29 -
Need help with ffmpeg batch file
By DarrellS in forum Video ConversionReplies: 3Last Post: 25th Jun 2012, 15:43 -
Batch File. Need help
By Seritin in forum ProgrammingReplies: 1Last Post: 6th Apr 2010, 11:16 -
Batch file
By Anurag in forum ComputerReplies: 16Last Post: 19th May 2009, 11:27 -
Batch file that can delete a specific file
By Dark_Raven in forum ProgrammingReplies: 1Last Post: 10th Jun 2008, 08:16