[FFmpeg-devel] [PATCH] Display decoded frame number on error

Gyan ffmpeg at gyani.pro
Fri Jul 12 12:36:34 EEST 2019



On 12-07-2019 02:54 PM, Remi Achard wrote:
> Thanks for the review, I updated the patch to show the correct frame number
> as suggested (sorry for the double post I managed to screw up my git
> send-email).
This is not what I meant.

Let's call good frames G and bad frames B. If your input is    G G G B B 
B G G B   then for all 3 initial B frames, ist->frames_decoded will be 
3, and 5 for the last B frame. So, what your patched log tells you is 
the total number of previous _successful_ decodes. Presumably, you wish 
to see 4, 5, 6 and 9 respectively for these B frames.

Gyan

>
> Le ven. 12 juil. 2019 à 11:18, Rémi Achard <remiachard at gmail.com> a écrit :
>
>> ---
>>   fftools/ffmpeg.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
>> index 01f04103cf..aaeabe512b 100644
>> --- a/fftools/ffmpeg.c
>> +++ b/fftools/ffmpeg.c
>> @@ -2107,7 +2107,7 @@ static void check_decode_result(InputStream *ist,
>> int *got_output, int ret)
>>       if (*got_output && ist) {
>>           if (ist->decoded_frame->decode_error_flags ||
>> (ist->decoded_frame->flags & AV_FRAME_FLAG_CORRUPT)) {
>>               av_log(NULL, exit_on_error ? AV_LOG_FATAL : AV_LOG_WARNING,
>> -                   "%s: corrupt decoded frame in stream %d\n",
>> input_files[ist->file_index]->ctx->url, ist->st->index);
>> +                   "%s: corrupt decoded frame %llu in stream %d\n",
>> input_files[ist->file_index]->ctx->url, ist->frames_decoded + 1,
>> ist->st->index);
>>               if (exit_on_error)
>>                   exit_program(1);
>>           }
>> --
>> 2.16.2
>>
>>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-devel mailing list