Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrupt frame detection and replacement #171

Open
masc4ii opened this issue Jul 20, 2019 · 13 comments
Open

Corrupt frame detection and replacement #171

masc4ii opened this issue Jul 20, 2019 · 13 comments
Assignees

Comments

@masc4ii
Copy link
Collaborator

masc4ii commented Jul 20, 2019

When using ML cameras near to the edge of maximal write speed, we get here and there corrupted frames (mostly half of the frame is pink). It should be possible to detect such frames. In a first version we could manually select such bad frames.

Another task would be to replace such corrupted frames with:

  • the previous frame
  • the following frame
  • a blended frame ((previous+following)/2)
  • a synthetic frame (optical flow)
@ilia3101
Copy link
Owner

Hmm very exciting idea

@ilia3101
Copy link
Owner

I think corrupt frame replacement should be done inside mlvObject, so it can be treated the same from outside when requesting a frame to process. @bouncyball-git as you have worked on that part of mlv app a lot, do you approve?

@bouncyball-git
Copy link
Collaborator

bouncyball-git commented Jul 22, 2019

Discovery and replacement of the corrupted frames at the RAW level, I guess, is applicable only for:

"the previous frame" and "the following frame"
Well... may be for blended frame as well but not for optical flow.

As you understand most Important thing here is the reliable discovery alg.

@masc4ii
Copy link
Collaborator Author

masc4ii commented Jul 22, 2019

I 100% agree. Optical flow should work after debayering only. If we would like to export as DNG / MLV dublicating one frame is easiest, blending could also work.

@ilia3101
Copy link
Owner

Oh yeah optical flow would not be possible then :/

@masc4ii
Copy link
Collaborator Author

masc4ii commented Jul 22, 2019

But never mind... I checked some sources for optical flow: yes, very nice (I don't understand anything).

@ilia3101
Copy link
Owner

ilia3101 commented Jul 22, 2019

Actually we could do optical flow before debayer - split the image in to four: R G1 G2 and B, then optical flow on each one. Though it may generate some grain or pixel pattern oddness. It would be an interesting idea to try. Also may be faster than doing it after debayer.

Those frames should also be cached, as it would not be quick (I assume).

@masc4ii
Copy link
Collaborator Author

masc4ii commented Jul 23, 2019

If you have a look here, there are several optical flow implementations.
https://www.ipol.im/
It is indeed very interesting!

@DeafEyeJedi
Copy link

DeafEyeJedi commented Jul 23, 2019 via email

@masc4ii
Copy link
Collaborator Author

masc4ii commented Jul 23, 2019

Yes, interesting. But I don't know yet what to do with that code. On this page you can try out (life) the algorithms. I find anything else but not the interpolated picture...

@dannephoto
Copy link
Collaborator

dannephoto commented Jul 31, 2019

This idea is really good and important. FFmpeg wise it should be possible to output someting even if frames are missing here and there. Some links:
http://paulherron.com/blog/forcing_keyframes_with_ffmpeg

https://stackoverflow.com/questions/50546359/ffmeg-force-keyframe-at-specific-interval

https://superuser.com/questions/908280/what-is-the-correct-way-to-fix-keyframes-in-ffmpeg-for-dash/908706#908706

@pigeonhill
Copy link

Plus 1 for such a feature.

My use case is when using MLV App to process for stills photography, for example averaging an MLV to simulate a long exposure.

With no audio to worry about, ‘all’ one would need to do would be to delete the corrupted frame, ie no continuity issues.

But, of course, I realise this app is mainly for videographers ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants