[FFmpeg-devel] [PATCH] matroskaenc: add codec_tag lists back.
Carl Eugen Hoyos
cehoyos at ag.or.at
Wed Jan 23 12:23:02 CET 2013
On Wednesday 23 January 2013 01:52:26 am Michael Niedermayer wrote:
> From: Carl Eugen Hoyos <cehoyos at ag.or.at>
>
> This reverts "Do not set codec_tag property for matroska muxers."
> 312645e0304cb9bc7c1bdf1bd5bdc736601a00de.
>
> And also adds dummy codec tags for supported but otherwise
> missing codec tags.
>
> Fixes Ticket2169
Updated patch attached.
Thank you, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/matroska.c b/libavformat/matroska.c
index db9c2bb..394a62f 100644
--- a/libavformat/matroska.c
+++ b/libavformat/matroska.c
@@ -21,6 +21,9 @@
#include "matroska.h"
+/* If you add a tag here that is not in ff_codec_bmp_tags[]
+ or ff_codec_wav_tags[], add it also to additional_audio_tags[]
+ or additional_video_tags[] in matroskaenc.c */
const CodecTags ff_mkv_codec_tags[]={
{"A_AAC" , AV_CODEC_ID_AAC},
{"A_AC3" , AV_CODEC_ID_AC3},
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 1840f90..0e522fe 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1353,6 +1353,34 @@ static int mkv_query_codec(enum AVCodecID codec_id, int std_compliance)
return 0;
}
+const AVCodecTag additional_audio_tags[] = {
+ { AV_CODEC_ID_ALAC, 0XFFFFFFFF },
+ { AV_CODEC_ID_EAC3, 0XFFFFFFFF },
+ { AV_CODEC_ID_MLP, 0xFFFFFFFF },
+ { AV_CODEC_ID_OPUS, 0xFFFFFFFF },
+ { AV_CODEC_ID_PCM_S16BE, 0xFFFFFFFF },
+ { AV_CODEC_ID_PCM_S24BE, 0xFFFFFFFF },
+ { AV_CODEC_ID_PCM_S32BE, 0xFFFFFFFF },
+ { AV_CODEC_ID_QDM2, 0xFFFFFFFF },
+ { AV_CODEC_ID_RA_144, 0xFFFFFFFF },
+ { AV_CODEC_ID_RA_288, 0xFFFFFFFF },
+ { AV_CODEC_ID_COOK, 0xFFFFFFFF },
+ { AV_CODEC_ID_TRUEHD, 0xFFFFFFFF },
+ { AV_CODEC_ID_TTA, 0xFFFFFFFF },
+ { AV_CODEC_ID_WAVPACK, 0xFFFFFFFF },
+ { AV_CODEC_ID_NONE, 0xFFFFFFFF }
+};
+
+const AVCodecTag additional_video_tags[] = {
+ { AV_CODEC_ID_PRORES, 0xFFFFFFFF },
+ { AV_CODEC_ID_RV10, 0xFFFFFFFF },
+ { AV_CODEC_ID_RV20, 0xFFFFFFFF },
+ { AV_CODEC_ID_RV30, 0xFFFFFFFF },
+ { AV_CODEC_ID_RV40, 0xFFFFFFFF },
+ { AV_CODEC_ID_VP9, 0xFFFFFFFF },
+ { AV_CODEC_ID_NONE, 0xFFFFFFFF }
+};
+
#if CONFIG_MATROSKA_MUXER
AVOutputFormat ff_matroska_muxer = {
.name = "matroska",
@@ -1369,6 +1397,10 @@ AVOutputFormat ff_matroska_muxer = {
.write_trailer = mkv_write_trailer,
.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
AVFMT_TS_NONSTRICT,
+ .codec_tag = (const AVCodecTag* const []){
+ ff_codec_bmp_tags, ff_codec_wav_tags,
+ additional_audio_tags, additional_video_tags, 0
+ },
.subtitle_codec = AV_CODEC_ID_SSA,
.query_codec = mkv_query_codec,
};
@@ -1405,5 +1437,8 @@ AVOutputFormat ff_matroska_audio_muxer = {
.write_packet = mkv_write_packet,
.write_trailer = mkv_write_trailer,
.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT,
+ .codec_tag = (const AVCodecTag* const []){
+ ff_codec_wav_tags, additional_audio_tags, 0
+ },
};
#endif
More information about the ffmpeg-devel
mailing list