[MEncoder-users] converting and subtitle questions

Erik Slagter erik at slagter.name
Thu Mar 27 17:45:01 CET 2008


zechao wang wrote:
> Thank you very much, "Erik Slagter" !
> 
> Some medias are not supported by ffmpeg in my system, such as rm, rmvb, wmv.  So mencoder was used to convert rmvb to avi firstly. 
> 
> I don't know why it can work in you system !
> 
> Information of my ffmpeg is: 
> 
> zwang at wzc:~/Downloads/tmp$ ffmpeg -version
> ffmpeg version CVS, build 3211266, Copyright (c) 2000-2004 Fabrice Bellard
>   configuration:  --enable-gpl --enable-pp --enable-vorbis --enable-libogg --enable-a52 --enable-dts --enable-dc1394 --enable-libgsm --disable-debug --enable-mp3lame --enable-faad --enable-faac --enable-xvid --enable-shared --prefix=/usr
>   built on Feb 24 2008 14:35:12, gcc: 4.0.3 (Ubuntu 4.0.3-1ubuntu5)
> ffmpeg      CVS
> libavcodec  3211266
> libavformat 3211520
> 
> Any ideas ? Thanks.

Then probably mencoder uses a windows binary dll for decoding, ffmpeg
doesn't work that way.

In that case I'd recommend using mencoder (or mplayer) to decode your
rmvb file to either yuv4mpeg (lossless) or mjpeg (almost lossless, use
quantiser=2) in an avi container and hand that to ffmpeg. This will
minimize/eliminate double encoding loss.

I don't think you can't get it any more simple than this;
mplayer/mencoder's strength is the ability to decode almost anything but
it doesn't handle containers other than avi very well. FFmpeg can
produce good quality containers but doesn't handle "binary-only" dll's.

You might complain at the mplayer-devel mailing, but don't forget to
wear your flame-proof coat.

BTW maybe this little script is helpful, it uses mplayer, x264, faac and
gpac, ffmpeg is not needed. See "man x264" for x264 parameters. You may
need to use lame instead of faac if your phone doesn't understand aac.
Also you may need to add a filter to mplayer to resize for your phone.

#!/bin/sh

vpipe1="dvd2avc1.y4m"
apipe1="dvd2avc1.apipe"

avc="$1.264"
aac="$1.aac"
mp4="$1.mp4"

rm "$vpipe1"  "$apipe1" 2> /dev/null

mknod "$vpipe1" p
mknod "$apipe1" p

mplayer -noconsolecontrols -vf-clr \
	-vf-add kerndeint=10:0:0:1:1 -benchmark \
     	-vo "yuv4mpeg:file=$vpipe1" \
	-ao "pcm:waveheader:file=$apipe1:fast" \
        "$1" 1>&2 /dev/null | \
        x264 --bframes 8 --b-pyramid --ref 2 --crf 22 \
                --trellis 1 --nr 2000 --level 41 \
                --threads 2 --subme 5 -o "$avc" "$vpipe1" | \
        (faac --mpeg-vers 4 -b 192 -o "$aac" "$apipe1" 2> /dev/null)

rm "$vpipe1" "$apipe1" 2> /dev/null
MP4Box -lang en -new "$mp4" -add "$avc" -add "$aac" -isma



More information about the MEncoder-users mailing list