On 11/14/2017 09:07 AM, Carl Eugen Hoyos wrote:
> 2017-11-14 16:07 GMT+01:00 John Stebbins <[email protected]>:
>
>> There are 2 ways defined by the MP4 spec to include SPS and PPS.
>> The first, most common, and supported by ffmpeg, is to put the
>> parameter sets in the MP4 header *only*.  In this type of MP4, the
>> sample entry type must be set to avc1.
>> The second way allows the SPS and PPS to be in the MP4 header and
>> inline in the stream.  In this case SPS and PPS may be repeated in
>> the stream before each IDR.  This is useful for adaptive streaming
>> scenarios where the characteristics of the video stream may change.
>> In this type of MP4, the sample entry type must be avc3.
> I believe this variant is not supported by FFmpeg's mov muxer and I
> suspect that some / most players do not support it.
>
>

I don't know about most, but many do support avc3.  The only players I've found 
so far that do not are those produced by
Apple.

A little off topic but related.  The default h.265 sample entry type that 
ffmpeg writes (hev1) *allows* inline parameter
sets and doesn't work with Apple players.  I submitted a patch a while back to 
libav which is also in ffmpeg now that
adds the ability to write the hvc1 sample entry type which is supported by 
Apple and means parameter sets are only in
the header.

The attached patch adds the ability to write avc3 sample entry type.  I was 
planning on submitting this patch to
ffmpeg.  Just hadn't gotten around to it yet.

The ffmpeg command line to transcode a file to avc3 format with this patch 
would be:
ffmpeg -i input -flags:v +global_header -c:v libx264 -tag:v avc3 output.mp4

-- 
John      GnuPG fingerprint: D0EC B3DB C372 D1F1 0B01  83F0 49F1 D7B2 60D4 D0F7

From db5358859fbf2da77ab737b8676ece8b74679299 Mon Sep 17 00:00:00 2001
From: John Stebbins <[email protected]>
Date: Wed, 15 Nov 2017 07:37:12 -0800
Subject: [PATCH] lavf/movenc: allow writing avc3 sample entry type

The avc3 sample entry type is useful for adaptive streaming.  It permits
parameter sets to be written inline in the video stream.
---
 libavformat/movenc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index cc3fc19d9b..01ae467fa1 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -6513,6 +6513,7 @@ static const AVCodecTag codec_3gp_tags[] = {
 const AVCodecTag codec_mp4_tags[] = {
     { AV_CODEC_ID_MPEG4       , MKTAG('m', 'p', '4', 'v') },
     { AV_CODEC_ID_H264        , MKTAG('a', 'v', 'c', '1') },
+    { AV_CODEC_ID_H264        , MKTAG('a', 'v', 'c', '3') },
     { AV_CODEC_ID_HEVC        , MKTAG('h', 'e', 'v', '1') },
     { AV_CODEC_ID_HEVC        , MKTAG('h', 'v', 'c', '1') },
     { AV_CODEC_ID_MPEG2VIDEO  , MKTAG('m', 'p', '4', 'v') },
-- 
2.13.5

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to