Hi everyone, I am using the demux.c example code (libav-9.8) with RTSP / TCP.
This normally works fine over the internet (IP camera) - no errors or warnings, all good - after I have added the TCP option: av_dict_set(&opts, "rtsp_transport", "tcp", 0); However, sometimes the bandwidth is not sufficient and frames are dropped (also the latest ffmpeg on the command line shows yellow and red error messages occasionally (when this happens)), leading to corrupted jpg images. ffmpeg -flags2 -showall -rtsp_transport tcp -i http://admin:[email protected] :xxx/videoSub -vsync 2 -r 2 -an -y '%d.jpg' How can I tell libav to ignore / discard corrupted frames? Tried setting this option in my program: av_dict_set(&opts, "discardcorrupt", "1", 0); and also tried checking the flags in the packet read: while (av_read_frame(av_input_format_context, &pkg) >=0) { if (pkt.flags & AV_PKT_FLAG_CORRUPT) {} } None of it seems to help - I still get a few corrupted images every few minutes (depending on other traffic on my internet connection). Or is there a way to access the errors from within the lib somehow (if error count increases, ignore data until the next keyframe)? Or is there a frame quality indicator somehow, which I can use to apply a threshold? Maybe the discardcorrupt is what I should be using, but I am not doing it right? I am doing motion detection on the resulting jpeg images and an incomplete image does not help with this. Thanks for your help in advance. _______________________________________________ libav-api mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-api
