[FFmpeg-devel] [PATCH 2/2] avformat/movenc: Support merging h264 fields into field pairs

Yusuke Nakamura muken.the.vfrmaniac at gmail.com
Tue Mar 11 04:07:28 CET 2014


2014-03-11 10:59 GMT+09:00 Michael Niedermayer <michaelni at gmx.at>:

> On Tue, Mar 11, 2014 at 05:07:00AM +0900, Yusuke Nakamura wrote:
> > 2014-03-10 20:15 GMT+09:00 Michael Niedermayer <michaelni at gmx.at>:
> >
> > > On Mon, Mar 10, 2014 at 01:18:16PM +0900, Yusuke Nakamura wrote:
> > > > 2014-03-10 12:48 GMT+09:00 Timothy Gu <timothygu99 at gmail.com>:
> > > >
> > > > > On Mar 9, 2014 6:59 PM, "Michael Niedermayer" <michaelni at gmx.at>
> > > wrote:
> > > > > >
> > > > > > Fixes Ticket3393
> > > > > >
> > > > > > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > > > > > ---
> > > > > >  libavformat/movenc.c |   12 ++++++++++++
> > > > > >  libavformat/movenc.h |    3 +++
> > > > > >  2 files changed, 15 insertions(+)
> > > > >
> > > > > Missing documentation:
> > > > >
> > > > > Set to 1 merge field pairs into one packet. This option is only
> valid
> > > for
> > > > > H.264 codec. If the codec is not H.264, then this option would be
> > > silently
> > > > > ignored.
> > > > >
> > > > > Also I wonder if it's a good idea to print a warning if this
> option is
> > > set
> > > > > but codec isn't H.264.
> > > > >
> > > > > Does this work with stream copying? If so, then more documentation
> is
> > > > > needed.
> > > > >
> > > > > How about HEVC?
> > > > >
> > > > > [...]
> > > > >
> > > > > Timothy
> > > > > _______________________________________________
> > > > > ffmpeg-devel mailing list
> > > > > ffmpeg-devel at ffmpeg.org
> > > > > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > > > >
> > > >
> > > > WTF!?
> > > >
> > > > This patch allows to generate files which violate 14496-15.
> > > > According to 14496-15, a sample is an access unit.
> > > > An access unit can contain only one primary coded picture.
> > > >
> > > > What spec allows this?
> > >
> > > The quicktime spec probably does allow it. At least i dont see
> > > anything in it that would disallow it.
> > >
> > > And AFAIK some encoders like mainconcept use it, i dont have that
> > > encoder so my knowledge here is based on people who do ...
> > >
> > > Do you object to this patch or have suggestions on how it can be
> > > improved ?
> > >
> > > [...]
> > > --
> > > Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> > >
> > > No great genius has ever existed without some touch of madness. --
> > > Aristotle
> > >
> > > _______________________________________________
> > > ffmpeg-devel mailing list
> > > ffmpeg-devel at ffmpeg.org
> > > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > >
> > >
> > I object to this patch unless any spec of derived file format based on
> > 14496-12 or quicktime allows it.
>
> quicktime probably allows it, in the sense that qt probably allows
> anything
>
>
A possibility gives no guarantee.

I don't think qt allows anything.
Even so, I think there shall be something to indicate that a pair of two
field coded pictures is in a sample.
This affects physical and temporal structure, and is incompatible with
normal structures.


>
> >
> > Do some encoders like Mainconcept write their own brand(s) in ftyp?
> > If not, it is just a violation of the spec.
>
>
> I have 3 files: (2 used mainconcept, 1 using intels encoder)
> Metadata:
>     major_brand     : mp42
>     minor_version   : 0
>     compatible_brands: mp42isomavc1
>     creation_time   : 2014-02-04 09:29:04
>     encoder         : Sorenson Squeeze
>     comment         : Encoded by
>   Duration: 00:00:02.08, start: 0.000000, bitrate: 1207 kb/s
>     Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo,
> fltp, 65 kb/s (default)
>     Metadata:
>       creation_time   : 2014-02-04 09:29:04
>       handler_name    : soun
>     Stream #0:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p,
> 320x180 [SAR 1:1 DAR 16:9], 1131 kb/s, 25 fps, 25 tbr, 600 tbn, 50 tbc
> (default)
>     Metadata:
>       creation_time   : 2014-02-04 09:29:04
>       handler_name    : vide
>     Stream #0:2(und): Data: none (mp4s / 0x7334706D), 0 kb/s (default)
>     Metadata:
>       creation_time   : 2014-02-04 09:29:14
>       handler_name    : sdsm
>     Stream #0:3(und): Data: none (mp4s / 0x7334706D), 0 kb/s (default)
>     Metadata:
>       creation_time   : 2014-02-04 09:29:14
>       handler_name    : odsm
> --
> Metadata:
>     major_brand     : mp42
>     minor_version   : 0
>     compatible_brands: mp42isomavc1
>     creation_time   : 2014-02-04 14:04:48
>     encoder         : Sorenson Squeeze
>     comment         : Encoded by
>   Duration: 00:00:02.08, start: 0.000000, bitrate: 1061 kb/s
>     Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo,
> fltp, 65 kb/s (default)
>     Metadata:
>       creation_time   : 2014-02-04 14:04:48
>       handler_name    : soun
>     Stream #0:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p,
> 320x180 [SAR 1:1 DAR 16:9], 984 kb/s, 25 fps, 25 tbr, 600 tbn, 50 tbc
> (default)
>     Metadata:
>       creation_time   : 2014-02-04 14:04:48
>       handler_name    : vide
>     Stream #0:2(und): Data: none (mp4s / 0x7334706D), 0 kb/s (default)
>     Metadata:
>       creation_time   : 2014-02-04 14:04:59
>       handler_name    : sdsm
>     Stream #0:3(und): Data: none (mp4s / 0x7334706D), 0 kb/s (default)
>     Metadata:
>       creation_time   : 2014-02-04 14:04:59
>       handler_name    : odsm
> and
>
>   Metadata:
>     major_brand     : mp42
>     minor_version   : 0
>     compatible_brands: isommp42
>     creation_time   : 2014-03-10 14:05:10
>   Duration: 00:00:53.27, start: 0.000000, bitrate: 331 kb/s
>     Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo,
> fltp, 125 kb/s (default)
>     Metadata:
>       creation_time   : 2014-03-10 14:05:11
>       handler_name    : Mainconcept MP4 Sound Media Handler
>     Stream #0:1(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv,
> bt470bg), 720x576 [SAR 64:45 DAR 16:9], 202 kb/s, 25 fps, 25 tbr, 50k tbn,
> 50 tbc (default)
>     Metadata:
>       creation_time   : 2014-03-10 14:05:11
>       handler_name    : Mainconcept MP4 Video Media Handler
>
> Those files have none of their original brands in ftyp. thus it's a
violation of the spec.


>
> > If so, the option should be available only under their brand(s).
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
>
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> The greatest way to live with honor in this world is to be what we pretend
> to be. -- Socrates
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>


More information about the ffmpeg-devel mailing list