[FFmpeg-user] Setting the "profile compatibility" value

Jim Kang jameskang at g.harvard.edu
Wed Oct 28 17:35:39 CET 2015

Hi, Carl.

On Wed, Oct 28, 2015 at 2:50 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> Jim Kang <jim_kang <at> harvard.edu> writes:
> > The problem is I need my video to be encoded such that
> > it conforms to the MIME codec string
> > 'video/mp4; codecs="avc1.*42E01E*, mp4a.40.2"'.
> Could you explain why?
> If a server requires this, it seems broken to me but
> maybe I am missing something?

It is not the server, but rather the browser's MediaSource.addSourceBuffer
method that requires this MIME type:


Right now, the browsers' implementation of MediaSource is rather picky, and
I can only seem to get a video with that MIME type to play. So, I am trying
to get my video to be transcoded to match that MIME type.

> > But unsurprisingly since I did nothing to set it, the
> > profile compatibility is not what I want:
> > I want that *c0* to be an *e0*. How can I set that?
> This has nothing to do with FFmpeg (it sets the field
> in the mov header to the same value as in the h264
> stream) but x264 does not support setting it:
> http://git.videolan.org/?p=x264.git;a=blob;f=encoder/set.c;;hb=HEAD#l125
> sps->b_constraint_set0  = sps->i_profile_idc == PROFILE_BASELINE;
> /* x264 doesn't support the features that are in Baseline and not in Main,
>  * namely arbitrary_slice_order and slice_groups. */
> sps->b_constraint_set1  = sps->i_profile_idc <= PROFILE_MAIN;
> /* Never set constraint_set2, it is not necessary and not used in real
> world. */
> sps->b_constraint_set2  = 0;

Thanks for pointing me to this code! It does seem that in order to get this
MIME type, it would need to set this very bit in order to end up with an
0xE0 value. I'll try to find out more about what the codec MIME RFC (
http://tools.ietf.org/html/rfc6381) says about that bit.

> > ffmpeg version 2.7.1
> While it makes no difference in your case, the
> idea is of course to test current FFmpeg git
> head before reporting an issue here.

Good to know!

More information about the ffmpeg-user mailing list