summaryrefslogtreecommitdiffstats
path: root/contrib/ffmpeg/A20-avc3-hvc1-override.patch
blob: 70d67b4a39b057b2f9cfc502117f62f6a6b51bfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
diff -ur libav-12.2.orig/libavformat/isom.c libav-12.2/libavformat/isom.c
--- libav-12.2.orig/libavformat/isom.c	2017-09-30 11:13:39.000000000 -0700
+++ libav-12.2/libavformat/isom.c	2017-11-01 14:17:30.762856002 -0700
@@ -152,6 +152,7 @@
     { AV_CODEC_ID_HEVC, MKTAG('h', 'v', 'c', '1') }, /* HEVC/H.265 which indicates parameter sets shall not be in ES */
 
     { AV_CODEC_ID_H264, MKTAG('a', 'v', 'c', '1') }, /* AVC-1/H.264 */
+    { AV_CODEC_ID_H264, MKTAG('a', 'v', 'c', '3') }, /* AVC-1/H.264 */
     { AV_CODEC_ID_H264, MKTAG('a', 'i', '5', 'p') }, /* AVC-Intra  50M 720p24/30/60 */
     { AV_CODEC_ID_H264, MKTAG('a', 'i', '5', 'q') }, /* AVC-Intra  50M 720p25/50 */
     { AV_CODEC_ID_H264, MKTAG('a', 'i', '5', '2') }, /* AVC-Intra  50M 1080p25/50 */
diff -ur libav-12.2.orig/libavformat/movenc.c libav-12.2/libavformat/movenc.c
--- libav-12.2.orig/libavformat/movenc.c	2017-09-30 11:13:39.000000000 -0700
+++ libav-12.2/libavformat/movenc.c	2017-11-01 14:20:52.783487291 -0700
@@ -724,7 +724,10 @@
 
     avio_wb32(pb, 0);
     ffio_wfourcc(pb, "hvcC");
-    ff_isom_write_hvcc(pb, track->vos_data, track->vos_len, 0);
+    if (track->tag == MKTAG('h','v','c','1'))
+        ff_isom_write_hvcc(pb, track->vos_data, track->vos_len, 1);
+    else
+        ff_isom_write_hvcc(pb, track->vos_data, track->vos_len, 0);
     return update_size(pb, pos);
 }
 
@@ -783,7 +786,11 @@
     if (!ff_codec_get_tag(ff_mp4_obj_type, track->par->codec_id))
         return 0;
 
-    if      (track->par->codec_id == AV_CODEC_ID_H264)      tag = MKTAG('a','v','c','1');
+    if      (track->par->codec_id == AV_CODEC_ID_H264 &&
+             tag == MKTAG('a','v','c','3'))                 ;
+    else if (track->par->codec_id == AV_CODEC_ID_H264)      tag = MKTAG('a','v','c','1');
+    else if (track->par->codec_id == AV_CODEC_ID_HEVC &&
+             tag == MKTAG('h','v','c','1'))                 ;
     else if (track->par->codec_id == AV_CODEC_ID_HEVC)      tag = MKTAG('h','e','v','1');
     else if (track->par->codec_id == AV_CODEC_ID_AC3)       tag = MKTAG('a','c','-','3');
     else if (track->par->codec_id == AV_CODEC_ID_DIRAC)     tag = MKTAG('d','r','a','c');
@@ -4476,7 +4483,7 @@
     .write_packet      = mov_write_packet,
     .write_trailer     = mov_write_trailer,
     .flags             = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
-    .codec_tag         = (const AVCodecTag* const []){ ff_mp4_obj_type, 0 },
+    .codec_tag         = (const AVCodecTag* const []){ ff_codec_movvideo_tags, ff_codec_movaudio_tags, ff_codec_movsubtitle_tags, 0 },
     .priv_class        = &mp4_muxer_class,
 };
 #endif
Only in libav-12.2/libavformat: movenc.c.orig