[MEncoder-users] [solved] Re: mencoder to generate mp4 files for Motorola A1200

Zhang Weiwu zhangweiwu at realss.com
Sun Oct 25 07:35:23 CET 2009


Etienne Buira wrote:
> On Fri, Oct 23, 2009 at 07:58:29AM +0800, Zhang Weiwu wrote:
>   
>> I tried the following can create video playable on the device.
>> $ mencoder dvd://01 -endpos 1800 -nosound -ovc lavc -lavcopts vcodec=mpeg4 -vf scale=320:240 -o movie.avi -ofps 25
>> $ mplayer -vo null -endpos 1800 -ao pcm -af resample=8000 dvd://01
>> $ ffmpeg -i movie.avi -i audiodump.wav -b 48 -ac 1 -ab 12200 -map 0.0 -map 1.0 movie.mp4
>>
>> However I am afraid I compressed the video twice, once with mencoder, 
>>     
>
> Indeed, you are encoding twice.
>
> A way to avoid that is to specify the appropriate bitrate at the
> mencoder step, "-lavcopts vcodec=mpeg4:vbitrate=48".
>
>   
Thank you for your example, that helps a lot. I played with various
vbitrate options, make it as big as possible until  Motorola A1200's
realplayer fail to play, and ends up having vbitrate=250. Then I could
use "ffmpeg -vcodec copy" to avoid second round of compression.

So my procedure is now changed to this:

$ mencoder dvd://01 -endpos 2000 -nosound -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=250 -vf scale=320:240 -o movie.avi
$ mplayer -vo null -endpos 2000 -ao pcm -af resample=8000 dvd://01
$ ffmpeg -i movie.avi -i audiodump.wav -vcodec copy -ac 1 -ab 12200 -map 0.0 -map 1.0 movie.mp4


I now get satisfying video playback! The mobile phone can play some
documentary movies to help me kill time on morning buses.

Think I am very close to "the perfect solution" where I could use a
single mencoder command line, this is what I tried:

$ mencoder dvd://01 -endpos 2000 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=250 -vf scale=320:240 -oac lavc -lavcopts acodec=libfaac:abitrate=12 -af channels=1 -af lavcresample=8000 -of lavf -o movie.mp4


You can see I am trying to let mencoder does the 'ffmpeg -ac 1 -ab 12200
movie.mp4" part. I don't know why the resulting file always fail to
play, and real play doesn't give more detailed information except that
it cannot play.

More or less this problem is now "solved" thanks for your tip of not
doing compression twice. Hence I change the subject. Still trying to get
the 'perfect procedure' some time.

> Also, please check ffmpeg's output, as -b option takes a number in
> bits/s, not kbits/s.
Thank you for the information. The misuse was mislead by this article:

http://www.niemueller.de/wiki/index.php?ConvertVideoTo3GP (search for
'-b 48')

By the way the above article also compressed video twice.



More information about the MEncoder-users mailing list