[FFmpeg-devel] [PATCH]Set Matroska private data when muxing Prores

Carl Eugen Hoyos cehoyos at ag.or.at
Mon Mar 31 01:43:01 CEST 2014


Hi!

I don't think ticket #3434 is valid but the specification requires Prores in 
mkv to set private data to the "fourcc as found in MP4".
http://matroska.org/technical/specs/codecid/index.html

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 4390b6b..6976da8 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1914,6 +1914,8 @@ static int matroska_read_header(AVFormatContext *s)
                 st->codec->block_align = track->audio.sub_packet_size;
                 extradata_offset       = 78;
             }
+        } else if (codec_id == AV_CODEC_ID_PRORES && track->codec_priv.size == 4) {
+            fourcc = AV_RL32(track->codec_priv.data);
         }
         track->codec_priv.size -= extradata_offset;
 
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 7d83665..9d6962b 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -544,6 +544,9 @@ static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb, AVCodecCo
             } else
                 avio_write(dyn_cp, codec->extradata + 12,
                                    codec->extradata_size - 12);
+        } else if (codec->codec_id == AV_CODEC_ID_PRORES &&
+                   ff_codec_get_id(ff_codec_movvideo_tags, codec->codec_tag) == AV_CODEC_ID_PRORES) {
+            avio_write(dyn_cp, (uint8_t *)&codec->codec_tag, 4);
         }
         else if (codec->extradata_size && codec->codec_id != AV_CODEC_ID_TTA)
             avio_write(dyn_cp, codec->extradata, codec->extradata_size);


More information about the ffmpeg-devel mailing list