[FFmpeg-devel] [PATCH] Populate MPEG2TS codec_tag using ff_codec_movvideo_tags/ff_codec_movaudio_tags (av4cc) rather than the PES stream_type. For MPEG2TS files containing h264, ffprobe currently returns codec_tag_string=[27][0][0][0], this change will now produce codec_tag_string=avc1

Hendrik Leppkes h.leppkes at gmail.com
Thu May 16 20:10:12 EEST 2019


On Thu, May 16, 2019 at 6:12 PM Damien LĂ©vin
<dlevin-at-google.com at ffmpeg.org> wrote:
>
> Thanks Hendrik,
>
> The documentation from the AVCodecParameters codec_tag changed here (and
> not AVCodecContext which you are referring to) seems pretty explicit about
> being an AVI fourcc. So I'm not sure I understand why setting the PES
> stream_type (ISO/IEC 13818-1, table 2-34) would be more correct.
> "Additional information about the codec (corresponds to the AVI FOURCC)."
>
> If you look at the code from ffprobe.c (which also uses  AVCodecParameters)
> the assumption is to also have an AVI fourcc.
>
> /* print AVI/FourCC tag */
> print_str("codec_tag_string", av_fourcc2str(par->codec_tag));
> print_fmt("codec_tag", "0x%04"PRIx32, par->codec_tag);
>
> I understand that dumping the stream_type can be convenient but that
> doesn't seems like the correct behavior.
> Let me know what you think.
>

Dumping information in there thats not based on the container is
always going to be wrong. Why mov tags? Why not riff tags? Or some
other random format?
It should be container based or empty. And since the container just
has the pes stream type, thats what make sense. Always better to
convey something then nothing.

What are you even trying to fix?

- Hendrik


More information about the ffmpeg-devel mailing list