[MEncoder-users] Cannot encode MP4/MOV/FLV with global headers!?

Dominic Bird dominic at theark.uk.com
Fri Jul 2 16:03:38 CEST 2010



-----Original Message-----
From: mencoder-users-bounces at mplayerhq.hu
[mailto:mencoder-users-bounces at mplayerhq.hu] On Behalf Of James
Hastings-Trew
Sent: 02 July 2010 14:48
To: MEncoder usage discussions
Subject: Re: [MEncoder-users] Cannot encode MP4/MOV/FLV with global
headers!?

  On 10-07-02 6:36 AM, Dominic Bird wrote:
> Sorry I don't know why I wrote iPod in there, I meant to say
Quicktime.
> X264 and AAC should be fine. The problem seems to be with the headers
> not getting passed through from the encoders to the muxing process. I
> can't use ffmpeg as it won't read prores files and can't down mix from
8
> channels (or even just ignore 6 of them).
>
> Surely somebody has created an h264 file suitable for Quicktime with
> mencoder before?
>
> -----Original Message-----
> From: mencoder-users-bounces at mplayerhq.hu
> [mailto:mencoder-users-bounces at mplayerhq.hu] On Behalf Of James
> Hastings-Trew
> Sent: 02 July 2010 13:23
> To: MEncoder usage discussions
> Subject: Re: [MEncoder-users] Cannot encode MP4/MOV/FLV with global
> headers!?
>
>    On 10-07-01 10:34 AM, Dominic Bird wrote:
>> I've been trying this over and over again but whatever I do I cannot
> get
>> mencoder to encode global headers into either video or audio streams.
>> Any ideas? Here is the command im using...
>>
>> mencoder E:\Sequence1.mxf -o E:\Sequence1.flv -vf scale=640:-2 -af
>> channels=2,resample=44100 -mc 0 -ovc lavc -oac lavc -lavcopts
>>
>
aglobal=3:vglobal=3:vcodec=flv:vbitrate=512:acodec=libmp3lame:abitrate=9
>> 6 -of lavf
>>
>> Whatever I do I always receive these warnings:
>>
>> Writing header...
>>
>> [flv @ 01ff9010]Codec for stream 0 does not use global headers but
>> container for
>>
>> mat requires global headers
>>
>> [flv @ 01ff9010]Codec for stream 1 does not use global headers but
>> container for
>>
>> mat requires global headers
>>
>> I've tried all 4 options for aheader/vheader, encoding using faac,
> x264,
>> wrapping using mp4, mov... nothing seems to make a difference! The
> only
>> reason I am using flv in this example is because it actually plays
> back
>> in flash anyway. I can play back the mov or mp4 files created
> (x264/aac)
>> using VLC or MPlayer but not Quicktime. The idea is to end up with
> x264
>> files suitable for Quicktime or an iPod.
>> Any help appreciated!
>>
>> Btw it needs to be a one pass process ie no rewrapping using mp4box
or
>> something.
> Mencoder cannot directly make files suitable for ipod. No matter what
> video and audio codecs you use (and I am pretty sure you are using the
> wrong ones here, but I could be mistaken), mencoder cannot add the
"ipod
>
> atom" to the resulting file. For that, you will need mp4box.
>
> A "one pass process" for ipod would be to use something else - like
> ffmpeg or handbrake.
>
> Also, this question has been asked and answered in here several times
> over the years. Have a look in the archives at
> http://news.gmane.org/gmane.comp.video.mencoder.user , for the term
> "ipod" as a start. Have a look at this result:
>
http://article.gmane.org/gmane.comp.video.mencoder.user/7492/match=ipod
me
> . It might be a titch out of date, as some of the encoding defaults
have
>
> changed since then. For example, it might be necessary to declare
> bframes=0 now, as the default has changed from 0.
1: please don't "top post" - i.e. make sure your replies are at the END 
of quoted material in your post.

2: This produced a quicktime compatible file for me: (i.e. I can double 
click on the file and it opens and plays in Quicktime X):

mencoder tron_trailer.mov -o tron.mp4 -ovc x264 -x264encopts 
qp=20:global_header:level_idc=30:bframes=0 -of lavf -lavfopts format=mp4

-oac faac -faacopts mpeg=4:object=2:br=96:raw -channels 2 -srate 48000

It DID barf up an awful lot of warnings on the command line while doing 
it however. This morning I'm not so inclined to figure out what they've 
managed to break in x264 this time. I'm updating my source tree right 
now and I'll try again later to see if this is a current error or 
something that's since been fixed.

That worked perfectly. Whatever H264 options you've specified its sorted
out h.264 in the mp4s and the flv. Both play perfect! Thanks a lot!

Here are my commands if anyone is interested.


MP4 FOR QUICKTIME

MP4 container, H264 vid, AAC audio
mencoder E:\Sequence1.mxf -o E:\Sequence1.flv -vf scale=320:-2 -af
channels=2,resample=44100 -ovc x264 -x264encopts
qp=20:global_header:level_idc=30:bframes=0:bitrate=384 -oac faac
-faacopts mpeg=4:object=2:br=96:raw -mc 0 -of lavf -lavfopts format=mp4


FLASH

FLV container, h264 vid, MP3 audio (libav)
mencoder E:\Sequence1.mxf -o E:\Sequence1.flv -vf scale=512:-2 -af
channels=2,resample=44100 -mc 0 -ovc x264 -x264encopts
qp=20:global_header:level_idc=30:bframes=0:bitrate=384 -oac lavc
-lavcopts acodec=libmp3lame:abitrate=96 -of lavf

It still gives the errors about headers but playback seems unaffected so
i guess its fine

_______________________________________________
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