View Single Post
Old 20th May 2008, 06:25   #3  |  Link
refulgentis
Registered User
 
Join Date: Apr 2008
Posts: 56
here's one I use in os x, using mencoder
Quote:
#!/bin/sh

(( number= $# ))


for (( i = 0; i < $number; i++ ))
do
mencoder "$1" -of rawvideo -vf harddup -mc 0 -noskip -oac faac -ovc x264 -x264encopts crf=23:bframes=3:subq=5:me=umh:threads=4:cabac=0:level=31:ref=1:vbv-maxrate=4500:vbv-bufsize=2000 -o "$1".264 && mencoder "$1" -of rawaudio -vf harddup -mc 0 -noskip -ovc copy -oac faac -faacopts mpeg=4:br=128bject=2 -channels 2 -srate 48000 -o "$1".aac && mp4box -add "$1".aac#audio -add "$1".264#video -inter 0 -fps 23.976 "/Volumes/500/Source media/Conversions/mp4box.mp4" && ffmpeg -i "/Volumes/500/Source media/Conversions/mp4box.mp4" -y -vcodec copy -acodec copy "$1".mp4 && rm "/Volumes/500/Source media/Conversions/mp4box.mp4" && rm "$1".264 && rm "$1".aac
shift
done
this dumps video without any attempt to sync to x264, then dumps audio without any attempt to sync to faac. both files are placed in the directory of the original file, and have the same filename except .264 or .aac placed at the end.

then, mp4box muxes them, and then I pass the resulting mp4 back through ffmpeg. mp4box doesn't seem to write proper information for quicktime to understand the video files, and I can't get ffmpeg to mux my raw .264s properly.

this is perfect if you need itunes/quicktime compatible MP4s, and nearly every other situation doesn't work in special cases (ffmpeg can't decode mkvs with attachments properly and has segmentation faults often, mp4creator does something else odd that I can't remember). this situation works with everything i've thrown at it so far, but I haven't gotten too exotic yet, just .264 in avis or mkvs.

Last edited by refulgentis; 20th May 2008 at 06:31.
refulgentis is offline   Reply With Quote