<div dir="ltr"><div>1) The decoder call the log callback synchronous when it encounter a error or other messages. You can change the code to log the frame number? Like h.264, slice header has a frame_num<br></div>2) You can use AVClass->class_name to check which context logger using. Use AVCodecContext->opaque to save your information about which decoder you are using.<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-07-13 16:02 GMT+08:00 Anton Shekhovtsov <span dir="ltr"><<a href="mailto:shekh.anton@gmail.com" target="_blank">shekh.anton@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div class="h5"><br><div class="gmail_extra"><br><div class="gmail_quote">2017-07-13 4:31 GMT+03:00 jing zhang <span dir="ltr"><<a href="mailto:zhangjing.lm@gmail.com" target="_blank">zhangjing.lm@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><p>Hi,</p>
<p>Try set your own log callback (use av_log_set_callback), and check errors in your call back function.<br>
</p>
<br></div>zj<br></div><div class="gmail_extra"><br><div class="gmail_quote"><span>2017-07-12 19:13 GMT+08:00 Anton Shekhovtsov <span dir="ltr"><<a href="mailto:shekh.anton@gmail.com" target="_blank">shekh.anton@gmail.com</a>></span>:<br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><div dir="ltr">I expected avcodec_receive_frame to return any kind of error code when something goes wrong with a decoding. However it always returns success, I can only guess there is something wrong by side effects (decoded frame not updated, messages in log).<div>Is this feature supported?</div><div><br></div></div>
<br></span>______________________________<wbr>_________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/list<wbr>info/libav-user</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/list<wbr>info/libav-user</a><br>
<br></blockquote></div><br></div></div></div><div class="gmail_extra">Hi, Thanks for reply, however I don't think log callback can solve this:</div><div class="gmail_extra">1) Decoding is asynchronous, not possible to know which frame is affected from log message. Even If I knew it, the mechanism to deliver the result to a point where it is needed (code calling avcodec_receive_frame) would be ugly and complex.</div><div class="gmail_extra">2) Not sure log message is even associated with specific context. According to docs maybe it has a pointer to pointer to AVClass (how is that useful?) or not. Seems like log callback captures messages of the whole library, so if I do multiple operations on different threads how to tell which one had errors?</div><div class="gmail_extra"><br></div></div>
<br>______________________________<wbr>_________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/<wbr>listinfo/libav-user</a><br>
<br></blockquote></div><br></div>