HelpI'd thought I'd re-engineer an old XP .bat file to convert a bunch of .asf files captured from various crummy old still cameras into .mp4's which will play on my WDTVlive box.
A couple of things go awry -
1. mediainfo can't seem to find/display the framerate from the .asf's so that I can specify it in subsequent commandlines
2. even if I take out any framerate specifying commandline switches, the video's framerate is a lot faster than the audio in the resulting .mp4 - the video plays fast and then stops whilst the rest of the audio keeps playing.
Here's the test .bat
Code:@echo on call :makeMP4 "T:\CONVERT\homepics\learningtoride.wmv" pause exit :makeMP4 @ECHO ON SET inpFile=%~1 set outfile=%~1.mp4 set tempmp2=%~1.temp.mp2 set tempmp4=%~1.temp.mp4 set tempavi=%~1.temp.avi set audiohertz=44100 set audiobitrate=128k set xvideobitrate=700 REM http://webcache.googleusercontent.com/search?q=cache:GjDb5a9HDWoJ:umibe.googlecode.com/svn-history/r8/trunk/umibe/resources/MediaInfo/Contrib/CLI_Help.doc+%2BMEDIAINFO+batch+file+tokens&cd=1&hl=en&ct=clnk&gl=au&client=firefox-a "c:\software\mediainfo\mediainfo.exe" --full "%inpFile%" "c:\software\mediainfo\mediainfo.exe" --Inform=Video;%%FrameRate%% "%inpFile%" > .\V.TXT for /f "tokens=*" %%A in ('type ".\V.TXT"') do set FrameRate=%%A "c:\software\mediainfo\mediainfo.exe" --Inform=Video;%%DisplayAspectRatio%% "%inpFile%" > .\V.TXT for /f "tokens=*" %%A in ('type ".\V.TXT"') do set DisplayAspectRatio=%%A "c:\software\mediainfo\mediainfo.exe" --Inform=Video;%%DisplayAspectRatio/String%% "%inpFile%" > .\V.TXT for /f "tokens=*" %%A in ('type ".\V.TXT"') do set DisplayAspectRatio_STRING=%%A del .\v.txt REM start ---- %~1 ---- "C:\software\ffmpeg\0-LATEST-BETA\bin\ffmpeg.exe" -i "%inpfile%" -y -vcodec huffyuv -r %FrameRate% -an "%tempavi%" "C:\software\X264\x264.exe" --thread-input --threads 3 --profile high --level 4.1 --preset fast --no-cabac --fps %FrameRate% --bitrate %xvideobitrate% --sar 1:1 -o "%tempmp4%" "%tempavi%" "C:\software\ffmpeg\0-LATEST-BETA\bin\ffmpeg.exe" -i "%inpfile%" -y -r %FrameRate% -acodec mp2 -vol 768 -ac 2 -ar %audiohertz% -ab %audiobitrate% -vol 1024 "%tempmp2%" "C:\SOFTWARE\MP4box\MP4Box.exe" -fps %FrameRate% -add "%tempmp4%":fps=%FrameRate% -add "%tempmp2%":lang=eng -new "%outfile%" del %tempmp2% del %tempmp4% del %tempavi% pause REM end ---- %~1 ---- @ECHO OFF goto :eof
I'd try a single direct ffmpeg commandline to do it all-in-one but couldn't figure out how to get the same settings as in the x264 commandline.
Any suggestions, or alternative methods to achieve the same end ?
+ Reply to Thread
Results 1 to 4 of 4
-
Last edited by hydra3333; 12th Sep 2010 at 02:36.
-
Have you tried any other batch converters? Like xmedia recode, load all asf, choose mp4 and h264 video. It should be able to keep framerate, aspect ratio, etc.
-
Thank, no I hasn't considered them as yet. I was looking at commandline stuff because these are scattered throughout "organised" folders on a drive, and I could script it easily. If that's the only way then I guess that's it.
Looking at xmedia recode ... can't find the English setting though. Will d/l anyway.Last edited by hydra3333; 12th Sep 2010 at 07:40.
-
Well, xmedia recode seems to work ! Except it resizes the video and I can see its underlying commandline.
gui4ffmpeg doesn't seem to open .asf.Last edited by hydra3333; 12th Sep 2010 at 08:09.
Similar Threads
-
Hardcoding subs into H264 video and converting to MP4
By muhali5 in forum Video ConversionReplies: 4Last Post: 28th Aug 2009, 10:57 -
H264/AC3 (MKV) to H264/AAC (MP4) ?
By jccca in forum Video ConversionReplies: 10Last Post: 13th Dec 2008, 19:06 -
Converting to H264 [.MP4] (mencoder) results in video playing too fast
By ChrisMtl in forum ffmpegX general discussionReplies: 4Last Post: 12th Nov 2008, 16:02 -
converting video to h264(mp4) for flash player streaming
By ricardouk in forum Video ConversionReplies: 0Last Post: 1st Nov 2007, 13:58 -
Problem converting ASF to AVI/MP4
By yohu123 in forum Video ConversionReplies: 11Last Post: 16th Sep 2007, 12:24