[FFmpeg-devel] [PATCH] lavf/matroskadec: stop mapping text/plain attachments to AV_CODEC_ID_TEXT
Soft Works
softworkz at hotmail.com
Wed Jun 8 06:45:38 EEST 2022
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of Soft Works
> Sent: Wednesday, June 8, 2022 5:19 AM
> To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH] lavf/matroskadec: stop mapping text/plain
> attachments to AV_CODEC_ID_TEXT
>
>
>
> > -----Original Message-----
> > From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of Anton
> > Khirnov
> > Sent: Tuesday, June 7, 2022 1:59 PM
> > To: ffmpeg-devel at ffmpeg.org
> > Subject: [FFmpeg-devel] [PATCH] lavf/matroskadec: stop mapping text/plain
> > attachments to AV_CODEC_ID_TEXT
> >
> > There is no reason to think that an attachment will contain text
> > subtitles. In addition attachments are exported in extradata, so the
> > AV_CODEC_ID_TEXT decoder would not do anything useful with it anyway.
> > ---
> > libavformat/matroskadec.c | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
> > index de73f97aca..cd30b5f7a4 100644
> > --- a/libavformat/matroskadec.c
> > +++ b/libavformat/matroskadec.c
> > @@ -806,7 +806,6 @@ static const CodecMime mkv_image_mime_tags[] = {
> > };
> >
> > static const CodecMime mkv_mime_tags[] = {
> > - {"text/plain" , AV_CODEC_ID_TEXT},
> > {"application/x-truetype-font", AV_CODEC_ID_TTF},
> > {"application/x-font" , AV_CODEC_ID_TTF},
> > {"application/vnd.ms-opentype", AV_CODEC_ID_OTF},
> > --
>
>
> Thank you for trying to find a solution for the ffprobe error.
>
> With this patch, text attachments are no longer shown as "text"
> but as "none" and ffprobe outputs a warning:
>
> Stream #0:9: Attachment: none
> Metadata:
> filename : .....
> mimetype : text/plain
> Unsupported codec with id 0 for input stream 9
>
>
> Regards,
> sw
>
> _______________________________________________
You might allow me the question whether we can be sure that
this is the only case which is subject to the regression?
Besides from what I reported above (and you might probably come up
with a new codec ID for discriminating text subs vs. text
attachments), this surely fixes the specific case I reported,
but I wonder whether other cases could exist?
(it's meant to be a normal question - I just don't know)
Here's another thought that might be worth consideration:
What turned this from a minor into a major issue (from my pov),
is that it is causing ffprobe to fail and exit with error
and incomplete output.
What I'm wondering about in this context, is whether it
even has to be like that?
I mean, an unknown codec doesn't cause ffprobe to error-exit,
does it need to do so when avcodec_open2() returns error?
I would find that behavior ok and consistent when the same
would happen when running ffmpeg (ffprobe fails <=> ffmpeg fails).
But ffmpeg doesn't fail (unless you use the stream), so does
ffprobe even need to fail in these cases?
Thanks,
sw
More information about the ffmpeg-devel
mailing list