LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   FFMPEG vs MPLAYER vs MENCODER and batch conversions to MP4 ? (http://www.linuxquestions.org/questions/linux-software-2/ffmpeg-vs-mplayer-vs-mencoder-and-batch-conversions-to-mp4-499625/)

AngusM 11-08-2006 12:18 AM

FFMPEG vs MPLAYER vs MENCODER and batch conversions to MP4 ?
 
Probably a dumb question but I cant work out what the differences are with FFMPEG, MPLAYER, and MENCODER or which one I should use.

They all seem to be from the same company, but Im not quite sure why the different software. Some sites say use FFMPEG for conversions and other say use MPLAYER, but then there is also MENCODER :)

What I would like to do is I have a directory on my server with around 100 videos of all different formats. I would like something where I can batch convert all these videos for use on my video ipod. I can of course download them and do it that way locally, but would prefer to do it server side so other people can access them as well.

I have played around with ffmpeg having read various posts and this is what I have come up with.

I am a linux dummie - so this could possibly be much better - let me know if it could be please :)

find . -exec ffmpeg -i {} -f mp4 -vcodec mpeg4 -maxrate 2000 -b 1500 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ar 44100 -ab 128 -s 320240 -aspect 4:3 converted/{}.mp4 \;

The problem with the above is that it only say converts about 1/3 of the videos successfully, and wont change the file extension - eg angus.mov becomes angus.mov.mp4

Any constructive feedback would be GREATLY appreciated. Its doing my head in :)

rylan76 11-08-2006 03:53 AM

Quote:

Originally Posted by AngusM
Probably a dumb question but I cant work out what the differences are with FFMPEG, MPLAYER, and MENCODER or which one I should use.

As far as I know, FFMPEG is used as a library that is called by both MPlayer and Mencoder (which are programs) to play or encode audio and video. It seems to me that Mplayer and Mencoder mainly act as "wrapping" around FFMPEG functionality. So you might be better off using mencoder for video / audio encoding, as this has much more simpler options (though still a LOT of them!) to choose from when doing encoding. Mencoder then uses FFMPEG (and other stuff of course) to do the encode. You can of course use FFMPEG directly, but I think that might be why you are having problems - I'm guessing that mencoder will work better since it can also use other codecs and libraries not supported by FFMPEG.

Quote:

They all seem to be from the same company, but Im not quite sure why the different software. Some sites say use FFMPEG for conversions and other say use MPLAYER, but then there is also MENCODER :)
Well, mplayer is just that - a player. It cannot encode. It plays. Mencoder is an encoder - it cannot play. It encodes. FFMPEG is a standalone application and library used by both mplayer and mencoder, but can also be used by itself.

Quote:

What I would like to do is I have a directory on my server with around 100 videos of all different formats. I would like something where I can batch convert all these videos for use on my video ipod. I can of course download them and do it that way locally, but would prefer to do it server side so other people can access them as well.

I have played around with ffmpeg having read various posts and this is what I have come up with.

I am a linux dummie - so this could possibly be much better - let me know if it could be please :)

find . -exec ffmpeg -i {} -f mp4 -vcodec mpeg4 -maxrate 2000 -b 1500 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ar 44100 -ab 128 -s 320240 -aspect 4:3 converted/{}.mp4 \;
Can't help you there (never used FFMPEG directly) but here is what I use (for example) to convert a directory full of .JPG's to a DivX5 AVI:

Code:

mencoder "mf://*.jpg" -mf fps=25:type=jpg -o out.mpg -ovc lavc -ffourcc DX50 -lavcopts vcodec=mpeg4:vbitrate=900:vrc_eq=tex:naq:ilme:trell:cbp:preme=1:keyint=132:mbd=0:qns=1:vme=4:dia=2 -noskip
I'm not sure if this uses FFMPEG at all (erm... think it uses lavc - is that FFMPEG?) but the beauty is it doesn't matter. I think you might be able to use "mf://*" and then do fps=25 (i. e. leave out the type option) and mencoder should then auto-detect the source type of video, converting into your target format. Not sure how your target format will be specified under mencoder though, since you seem to want MP4, and I wanted DivX5 .AVI

Quote:

The problem with the above is that it only say converts about 1/3 of the videos successfully, and wont change the file extension - eg angus.mov becomes angus.mov.mp4
That's probably because FFMPEG runs into codecs or files it can't open. That might be better with mencoder since it seems to be able to auto-detect most source filetypes I've encountered. I've even used it to "fix" video files that a Windows machine here wouldn't play, converting them into DivX5 compatibile videos that the Windows machine WOULD play - and I had no idea what codec the source file was using. Mencoder figured it out by itself...

AngusM 11-08-2006 08:20 AM

Thanks heaps for such a detailed reply.

Basically kind of what I thought as well - re ffmpeg being the underlying codec base / app used by the mplayer products. Will keep investigating.


All times are GMT -5. The time now is 11:30 PM.