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

Etienne Buira etienne.buira.lists at free.fr
Sun Oct 25 15:21:54 CET 2009


On Sun, Oct 25, 2009 at 02:35:23PM +0800, Zhang Weiwu wrote:
> 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

As Kasper said, it would be safer to group all -lavcopts together.

> 
> 
> 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.


I am not sure, but it might be the presence of two -lavcopts, or the
presence of B-frames (look at mencoder's output, there should be a
warning). Try vmax_b_frames=0 in -lavcopts if grouping does not solves
your problem.

> 
> 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.
> 
> _______________________________________________
> MEncoder-users mailing list
> MEncoder-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users


More information about the MEncoder-users mailing list