[FFmpeg-devel] [PATCH] ffmpeg: add -drop_deviant_frames option

Gyan ffmpeg at gyani.pro
Thu Apr 4 15:24:35 EEST 2019



On 04-04-2019 02:37 AM, Michael Niedermayer wrote:
>>   doc/ffmpeg.texi      |    5 +++++
>>   fftools/ffmpeg.c     |   47 +++++++++++++++++++++++++++++++++++++++++++++--
>>   fftools/ffmpeg.h     |    3 +++
>>   fftools/ffmpeg_opt.c |    5 +++++
>>   4 files changed, 58 insertions(+), 2 deletions(-)
>> 71a87fe4d8f2efa73a3d2d9845e7aabfb75edce5  0001-ffmpeg-add-drop_deviant_frames-option.patch
>>  From f39e3d44e1cb8108592d2241e2251d8e1506e031 Mon Sep 17 00:00:00 2001
>> From: Gyan Doshi <ffmpeg at gyani.pro>
>> Date: Mon, 25 Mar 2019 22:01:07 +0530
>> Subject: [PATCH] ffmpeg: add -drop_deviant_frames option
>>
>> Decoded frames with changed parameters in inputs expected to be uniform
>> may indicate malformed/corrupted packets. Demuxer with flag discardcorrupt
>> set may not catch all such packets and neither may decoders with err_detect
>> flags set.
>>
>> Upon parameter change, AVFilterLink of any filters receiving such frames has
>> to be reconfigured, destroying existing filter context. In case of a
>> change in audio sample rate, timestamps can go haywire, potentially
>> leaving the output stream to be "truncated".
>>
>> Added option allows users to avoid sending such deviant frames onwards.
>> Default behaviour remains unchanged.
>> ---
>>   doc/ffmpeg.texi      |  5 +++++
>>   fftools/ffmpeg.c     | 47 ++++++++++++++++++++++++++++++++++++++++++--
>>   fftools/ffmpeg.h     |  3 +++
>>   fftools/ffmpeg_opt.c |  5 +++++
>>   4 files changed, 58 insertions(+), 2 deletions(-)
> Would it make sense to make this feature available to other applications ?
> The awnser here has an effect of the design because
> For example if this is implemented in
> libavcodec or libavfilter then other applications could
> use such a feature. While if its in ffmpeg then other applications could
> not.
Could be a useful addition to libavcodec, since not all users may onward 
process using libavfilter.

Looks like avcodec_receive_frame is the place to add this gate.

Gyan


More information about the ffmpeg-devel mailing list