How to discard corrupted frames in FFMPEG

Asked

Viewed 78 times

1

I’m running a command on FFMPEG that uses as input a video stream (A boroscope IP stream) and transforming it into a video file format. avi.

To do this I circled the following command:

ffmpeg -i tcp://192.168.10.123:7060 -c:v copy out.mov 

However, when running this command, some frames presented the following errors:

Error while trying to encode the video

Even with these errors, the video was encoded.

The problem is that some frames are with a strange quality problem, probably because of these errors:

Image problem

I’m not aiming to solve this problem, actually what I really want is to simply discard these frames through some parameter of FFMPEG itself, since the frames with good quality are already enough for what I need.

Continuing, I tried too, rather than transferring the input stream file to a video one. avi, turn it into a set of frames, through the command:

ffmpeg -i tcp://192.168.10.123:7060 "select='eq(pict_type,PICT_TYPE_I)'" -vsync vfr teste%04d.png

And, through this command, I was able to verify that the errors were directly connected to the frames with quality problems.

Also, I also ran a command that theoretically would discard the corrupted frames from the input (at least that’s what I thought this command would do):

ffmpeg -err_detect bitstream -err_detect buffer -err_detect explode -err_detect aggressive -fflags discardcorrupt -i tcp://192.168.10.123:7060 -r 1 -an -f image2  snapshot-%03d.jpg

But this command also did not work.

This is the first time I use FFMPEG, so I do not know very well the framework and its commands, my knowledge is really very shallow.

So finally, I wanted to know if there is any FFMPEG parameter that will REALLY discard all the frames that have ANY type of error at the time of encoding or removing the frames, so that there are no such quality problems.

Thank you very much!

  • 1

    Hello, welcome to the site. If I had seen your question while I was in English I might have migrated to another web site. It’s not exactly about programming, although it’s interesting (for me at least). Part of the community seems to want to reopen, at the moment there’s only one vote left. Whereas it has been rare for well-formulated questions like this to appear on the site, if the community reopens, I will not object, even if I find it outside the scope - which does not mean that another moderator or the community itself will not close it again.

  • Got it! Anyway thanks for the feedback. Have a great day!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.