[MEncoder-users] Transcoding and cutting h264 TS stream

Peter Martens petermartens.list at gmail.com
Sun Apr 15 22:27:17 CEST 2007


I am using MythTV to capture HDTV (AVC (H.264), 720p, +/- 13000kbit/s,
50fps, 192 kbit/s MP3 audio stream). I would like to use mencoder to
transcode those files to a lower bitrate and cut the beginning few
minutes and last few minutes to tide it all up. Transcoding works well
for the video part and I am getting nice looking video and a smaller
file. However audio is slightly out of sync (about 100 msec).
To cut beginning and end I use -ss and -endpos (which can explain the
audio out of sync I guess). I would rather use an edl-file, but trying
so will always fail with lots of error messages ("no frame", "cannot
decode frame", ...). I guess a bug is preventing me from doing this.

My (working) command line:
nice -n 18 mencoder "${1}" -ss 149.44 -endpos 7161.68 -vc ffh264 -o
/dev/null -demuxer lavf -ovc x264 -of avi -x264encopts
pass=1:turbo=2:bitrate=5000:bframes=1:threads=auto:me=umh:partitions=all:trellis=1:qp_step=4:qcomp=0.7:direct_pred=auto:keyint=300
-vf harddup -oac faac -faacopts br=192:mpeg=4:object=1 -channels 2
-srate 48000  && \
nice -n 18 mencoder "${1}" -ss 149.44 -endpos 7161.68 -vc ffh264 -o
"${2}".avi -demuxer lavf -ovc x264 -of avi -x264encopts
pass=2:bitrate=5000:bframes=1:threads=auto:me=umh:partitions=all:trellis=1:qp_step=4:qcomp=0.7:direct_pred=auto:keyint=300
-vf harddup -oac faac -faacopts br=192:mpeg=4:object=1 -channels 2
-srate 48000

I would like to know if it is possible to transcode and cut H.264
files and some tips on doing so...



More information about the MEncoder-users mailing list