diff mbox series

[FFmpeg-devel,v6] avcodec/h264_slice: add warning log when droping picture at 'h264_select_output_frame'

Message ID 20211230072428.21067-1-zozobreak@163.com
State New
Headers show
Series [FFmpeg-devel,v6] avcodec/h264_slice: add warning log when droping picture at 'h264_select_output_frame' | expand

Checks

Context Check Description
andriy/commit_msg_x86 warning Please wrap lines in the body of the commit message between 60 and 72 characters.
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/commit_msg_ppc warning Please wrap lines in the body of the commit message between 60 and 72 characters.
andriy/make_ppc success Make finished
andriy/make_fate_ppc fail Make fate failed

Commit Message

zozobreak@163.com Dec. 30, 2021, 7:24 a.m. UTC
since there is only debug log 'no picture ooo' when droping a picture,
I spent much time to troubleshooting a wrong sps 'num_reorder_frames' param changed by webrtc's 'ParseAndRewriteSps',
FFmpeg keeped silence about this error, so a warning log is much helpfull about this.

Signed-off-by: zourenyi <zozobreak@163.com>
---
 libavcodec/h264_slice.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Steven Liu Dec. 30, 2021, 7:35 a.m. UTC | #1
> 2021年12月30日 下午3:24,zourenyi <zozobreak@163.com> 写道:
> 
> since there is only debug log 'no picture ooo' when droping a picture,
> I spent much time to troubleshooting a wrong sps 'num_reorder_frames' param changed by webrtc's 'ParseAndRewriteSps',
> FFmpeg keeped silence about this error, so a warning log is much helpfull about this.
> 
> Signed-off-by: zourenyi <zozobreak@163.com>
> ---
> libavcodec/h264_slice.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
> index c21004df97..f347d8ee1a 100644
> --- a/libavcodec/h264_slice.c
> +++ b/libavcodec/h264_slice.c
> @@ -1533,7 +1533,13 @@ static int h264_select_output_frame(H264Context *h)
>             }
>         }
>     } else {
> -        av_log(h->avctx, AV_LOG_DEBUG, "no picture %s\n", out_of_order ? "ooo" : "");
> +        if (out_of_order) {
> +            av_log(h->avctx, AV_LOG_WARNING,
> +                   "drop picture(%c, %d/%" PRId64 ") because out of order\n",
> +                   av_get_picture_type_char(out->f->pict_type), out->poc, out->f->pts);
> +        } else {
> +            av_log(h->avctx, AV_LOG_DEBUG, "no picture\n");
> +        }
>     }
> 
>     return 0;
> -- 
> 2.34.1
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> 

lgtm


Thanks

Steven Liu
Limin Wang Dec. 30, 2021, 9 a.m. UTC | #2
On Thu, Dec 30, 2021 at 03:24:28PM +0800, zourenyi wrote:
> since there is only debug log 'no picture ooo' when droping a picture,
> I spent much time to troubleshooting a wrong sps 'num_reorder_frames' param changed by webrtc's 'ParseAndRewriteSps',
> FFmpeg keeped silence about this error, so a warning log is much helpfull about this.
> 
> Signed-off-by: zourenyi <zozobreak@163.com>
> ---
>  libavcodec/h264_slice.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
> index c21004df97..f347d8ee1a 100644
> --- a/libavcodec/h264_slice.c
> +++ b/libavcodec/h264_slice.c
> @@ -1533,7 +1533,13 @@ static int h264_select_output_frame(H264Context *h)
>              }
>          }
>      } else {
> -        av_log(h->avctx, AV_LOG_DEBUG, "no picture %s\n", out_of_order ? "ooo" : "");
> +        if (out_of_order) {
> +            av_log(h->avctx, AV_LOG_WARNING,
> +                   "drop picture(%c, %d/%" PRId64 ") because out of order\n",
> +                   av_get_picture_type_char(out->f->pict_type), out->poc, out->f->pts);
> +        } else {
> +            av_log(h->avctx, AV_LOG_DEBUG, "no picture\n");
> +        }
>      }

I prefer to not change the old message, just use warning level for ooo, like below:

int loglevel = out_of_order ? AV_LOG_WARNING : AV_LOG_DEBUG;
av_log(h->avctx, loglevel,  "no picture %s\n", out_of_order ? "ooo" : "");

>  
>      return 0;
> -- 
> 2.34.1
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
zozobreak@163.com Dec. 30, 2021, 9:19 a.m. UTC | #3
This will lost the droped picture's infomation, lead to hard to debug when this error happens.




zozobreak@163.com



 



From: lance.lmwang



Date: 2021-12-30 17:00



To: ffmpeg-devel



Subject: Re: [FFmpeg-devel] [PATCH v6] avcodec/h264_slice: add warning log when droping picture at 'h264_select_output_frame'



On Thu, Dec 30, 2021 at 03:24:28PM +0800, zourenyi wrote:



> since there is only debug log 'no picture ooo' when droping a picture,



> I spent much time to troubleshooting a wrong sps 'num_reorder_frames' param changed by webrtc's 'ParseAndRewriteSps',



> FFmpeg keeped silence about this error, so a warning log is much helpfull about this.



>



> Signed-off-by: zourenyi <zozobreak@163.com>



> ---



>  libavcodec/h264_slice.c | 8 +++++++-



>  1 file changed, 7 insertions(+), 1 deletion(-)



>



> diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c



> index c21004df97..f347d8ee1a 100644



> --- a/libavcodec/h264_slice.c



> +++ b/libavcodec/h264_slice.c



> @@ -1533,7 +1533,13 @@ static int h264_select_output_frame(H264Context *h)



>              }



>          }



>      } else {



> -        av_log(h->avctx, AV_LOG_DEBUG, "no picture %s\n", out_of_order ? "ooo" : "");



> +        if (out_of_order) {



> +            av_log(h->avctx, AV_LOG_WARNING,



> +                   "drop picture(%c, %d/%" PRId64 ") because out of order\n",



> +                   av_get_picture_type_char(out->f->pict_type), out->poc, out->f->pts);



> +        } else {



> +            av_log(h->avctx, AV_LOG_DEBUG, "no picture\n");



> +        }



>      }



 



I prefer to not change the old message, just use warning level for ooo, like below:



 



int loglevel = out_of_order ? AV_LOG_WARNING : AV_LOG_DEBUG;



av_log(h->avctx, loglevel,  "no picture %s\n", out_of_order ? "ooo" : "");



 



> 



>      return 0;



> --



> 2.34.1



>



> _______________________________________________



> ffmpeg-devel mailing list



> ffmpeg-devel@ffmpeg.org



> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel



>



> To unsubscribe, visit link above, or email



> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".



 



--



Thanks,



Limin Wang
Limin Wang Dec. 30, 2021, 10:45 a.m. UTC | #4
On Thu, Dec 30, 2021 at 05:19:09PM +0800, zozobreak@163.com wrote:
> This will lost the droped picture's infomation, lead to hard to debug when this error happens.

Please stop top posting.
As warning message, I think it's enough to print out "no picture ooo", if you want
to debug, please use gdb or add more debug message for yourself in you local branch. 

> 
> 
> 
> 
> zozobreak@163.com
> 
> 
> 
>  
> 
> 
> 
> From: lance.lmwang
> 
> 
> 
> Date: 2021-12-30 17:00
> 
> 
> 
> To: ffmpeg-devel
> 
> 
> 
> Subject: Re: [FFmpeg-devel] [PATCH v6] avcodec/h264_slice: add warning log when droping picture at 'h264_select_output_frame'
> 
> 
> 
> On Thu, Dec 30, 2021 at 03:24:28PM +0800, zourenyi wrote:
> 
> 
> 
> > since there is only debug log 'no picture ooo' when droping a picture,
> 
> 
> 
> > I spent much time to troubleshooting a wrong sps 'num_reorder_frames' param changed by webrtc's 'ParseAndRewriteSps',
> 
> 
> 
> > FFmpeg keeped silence about this error, so a warning log is much helpfull about this.
> 
> 
> 
> >
> 
> 
> 
> > Signed-off-by: zourenyi <zozobreak@163.com>
> 
> 
> 
> > ---
> 
> 
> 
> >  libavcodec/h264_slice.c | 8 +++++++-
> 
> 
> 
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> 
> 
> >
> 
> 
> 
> > diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
> 
> 
> 
> > index c21004df97..f347d8ee1a 100644
> 
> 
> 
> > --- a/libavcodec/h264_slice.c
> 
> 
> 
> > +++ b/libavcodec/h264_slice.c
> 
> 
> 
> > @@ -1533,7 +1533,13 @@ static int h264_select_output_frame(H264Context *h)
> 
> 
> 
> >              }
> 
> 
> 
> >          }
> 
> 
> 
> >      } else {
> 
> 
> 
> > -        av_log(h->avctx, AV_LOG_DEBUG, "no picture %s\n", out_of_order ? "ooo" : "");
> 
> 
> 
> > +        if (out_of_order) {
> 
> 
> 
> > +            av_log(h->avctx, AV_LOG_WARNING,
> 
> 
> 
> > +                   "drop picture(%c, %d/%" PRId64 ") because out of order\n",
> 
> 
> 
> > +                   av_get_picture_type_char(out->f->pict_type), out->poc, out->f->pts);
> 
> 
> 
> > +        } else {
> 
> 
> 
> > +            av_log(h->avctx, AV_LOG_DEBUG, "no picture\n");
> 
> 
> 
> > +        }
> 
> 
> 
> >      }
> 
> 
> 
>  
> 
> 
> 
> I prefer to not change the old message, just use warning level for ooo, like below:
> 
> 
> 
>  
> 
> 
> 
> int loglevel = out_of_order ? AV_LOG_WARNING : AV_LOG_DEBUG;
> 
> 
> 
> av_log(h->avctx, loglevel,  "no picture %s\n", out_of_order ? "ooo" : "");
> 
> 
> 
>  
> 
> 
> 
> > 
> 
> 
> 
> >      return 0;
> 
> 
> 
> > --
> 
> 
> 
> > 2.34.1
> 
> 
> 
> >
> 
> 
> 
> > _______________________________________________
> 
> 
> 
> > ffmpeg-devel mailing list
> 
> 
> 
> > ffmpeg-devel@ffmpeg.org
> 
> 
> 
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> 
> 
> >
> 
> 
> 
> > To unsubscribe, visit link above, or email
> 
> 
> 
> > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> 
> 
> 
>  
> 
> 
> 
> --
> 
> 
> 
> Thanks,
> 
> 
> 
> Limin Wang
> 
> 
> 
> _______________________________________________
> 
> 
> 
> ffmpeg-devel mailing list
> 
> 
> 
> ffmpeg-devel@ffmpeg.org
> 
> 
> 
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> 
> 
>  
> 
> 
> 
> To unsubscribe, visit link above, or email
> 
> 
> 
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> 
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index c21004df97..f347d8ee1a 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1533,7 +1533,13 @@  static int h264_select_output_frame(H264Context *h)
             }
         }
     } else {
-        av_log(h->avctx, AV_LOG_DEBUG, "no picture %s\n", out_of_order ? "ooo" : "");
+        if (out_of_order) {
+            av_log(h->avctx, AV_LOG_WARNING,
+                   "drop picture(%c, %d/%" PRId64 ") because out of order\n",
+                   av_get_picture_type_char(out->f->pict_type), out->poc, out->f->pts);
+        } else {
+            av_log(h->avctx, AV_LOG_DEBUG, "no picture\n");
+        }
     }
 
     return 0;