[MEncoder-users] avi h264 to mp4 (without transcoding)

Andrew Berg bahamutzero8825 at gmail.com
Sun Jul 24 21:05:18 CEST 2011


On 2011.07.24 05:05 AM, Phil Sturges wrote:
> From what you are saying here, it seems mencoder is a dead end.
It's not really much different from FFmpeg since you're just copying video.

> You seem to a bit of a fan of mp4box.
I go with what works. The lavf MP4 muxer is broken; MP4Box is very reliable.

> The process I used goes something like 
> this:
> 1)demux my avi with mp4box
>    MP4Box -aviraw video video.avi
>    MP4Box -aviraw audio video.avi
> 2) encode ac3 to aac with ffmpeg
>    ffmpeg -i video_audio.ac3 -acodec libfaac -ac 2 -ab 160k -threads 4 
> video.aac
I doubt you need to demux the audio before converting it. You can put
the audio in a container during the conversion too.

> 3) mux all 3 streams into mp4 with mp4box
>    MP4Box -add video_video.h264 -add video.aac -add video_audio.ac3 -fps 25 -
> nodrop video.mp4
-nodrop is probably not a good idea unless MP4Box is giving you better
results than without it. BTW, MP4Box's default framerate is 25, so can
you omit the option if you want.

Also, MP4 doesn't support AC3. MP4Box may accept it, but it will be put
in a private stream (you can put pretty much anything in a private
stream). I have no idea how many players will even attempt to play AC3
this way. If you want to use that AC3 stream, your best bet is likely a
Matroska container. You could also use MPEG-TS.


More information about the MEncoder-users mailing list