[FFmpeg-devel] [PATCH] lavf/utils: reset event_flags if extradata is not extracted correctly

Linjie Fu linjie.justin.fu at gmail.com
Mon Jan 25 05:49:21 EET 2021


On Mon, Jan 25, 2021 at 12:49 AM Anton Khirnov <anton at khirnov.net> wrote:
>
> Quoting Linjie Fu (2021-01-24 16:05:56)
> > Regression since 87f0c8280.
> >
> > If the extradata of a stream could not be extracted correctly,
> > codec_info_nb_frames would remain zero, while st->event_flag would still
> > be marked as AVSTREAM_EVENT_FLAG_NEW_PACKETS.
> >
> > The two expressions could be different in this case, hence reset
> > event_flags and calculate the correct score.
> >
> > Fix #9029.
>
> The ticket mentions ffplay, but ffplay does not access event_flags.
>

You are right, this helps ffmpeg cmdline to copy and dump:
$ ffmpeg -i sample_cut.flv -c copy -y dump.mp4

Before 87f0c8280 and after this patch:

audio streams could be dumped and playable, while video streams still not.

87f0c8280..master:
Error reporting and quits.

[mp4 @ 0x7fb276809a00] dimensions not set
Could not write header for output file #0 (incorrect codec parameters
?): Invalid argument
Error initializing output stream 0:1 --

I'd change the commit message to "#9029 related" for this, since the
ffplay issue remains the same.

- linjie


More information about the ffmpeg-devel mailing list