VideoHelp Forum




+ Reply to Thread
Results 1 to 4 of 4
  1. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Location
    Australia
    Search Comp PM
    Help I'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 ?
    Last edited by hydra3333; 12th Sep 2010 at 02:36.
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    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.
    Quote Quote  
  3. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Location
    Australia
    Search Comp PM
    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.
    Quote Quote  
  4. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Location
    Australia
    Search Comp PM
    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.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!