Opened 5 months ago

Closed 4 months ago

Last modified 4 months ago

#11109 closed defect (invalid)

Matroska output format missing supported video codec tags (additional_video_tags)

Reported by: SuRGeoNix Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mkv
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by SuRGeoNix)

AVOutputFormat.codec_tag does not include ff_mkv_codec_tags

In matroska.c there is a comment

"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"

but additional_video_tags are not specified.

Similarly, avi supports hevc but it is not included in codec_tag list but it will work if you set the codec_tag in the output stream's codec params.

Wondering if generally we could trust codec_tags for output formats to check whether is supported or not by the specified format.

Change History (3)

comment:1 by SuRGeoNix, 5 months ago

Description: modified (diff)

comment:2 by mkver, 4 months ago

Keywords: mkv added; matroska removed
Resolution: invalid
Status: newclosed

ff_mkv_codec_tags is of type 'CodecTags', not of type AVCodecTag and can therefore not directly used for the AVCodecTags list. The codecs included in ff_mkv_codec_tags are already included (via if supported by the muxer; additional_video_tags has been removed in 1df13b3891aa5fd482bfe9ff9e455b39e0a3cd38 because it would have been empty after this commit. The comment in matroska.c has not been changed; it now means that an additional_video_tags would have to be readded in the future if needed by a new video codec in ff_mkv_codec_tags.

comment:3 by SuRGeoNix, 4 months ago

Thanks mkver...

Just trying to see if there is a proper way to check if a codec (and/or codec_tag) is supported by the output format. I was missing avformat_query_codec which seems to be the closest on what I'm looking for (fftools using it as well - only for video).

It is not clear when we have the codec_tags (+audio/video/subs/data codec) in the AVOutputFormat and at the same time you have the query_codec (which is mainly for matroska as I can see +img2/mp3) which checks different codecs from ff_mkv_codec_tags and the mkv_init blacklists some other codecs (query_codec will return them as supported when std_compliance < FF_COMPLIANCE_NORMAL).

So, I'm afraid that the answer to my (last) question is we can't trust what is supported or not from the output format. That would be possible only if every muxer had a related query_codec func that return only true/false and not unknown (or even falsely true/false).

Finally, I've noticed that matroska audio and video muxers have the same name (seems the only case that two muxers sharing the same name) and probably it should be unique?

Note: See TracTickets for help on using tickets.