Site Sponsors
Results 1 to 2 of 2

Thread: Automatically / Programatically Remove Bad Frames from Video.

  1. #1
    New Member
    Join Date
    Jun 2019
    Posts
    1
    Post Thanks / Like

    Automatically / Programatically Remove Bad Frames from Video.

    I have a load of time-lapse videos created from some cheap IP cameras that look like this:

    https://drive.google.com/file/d/1hp2...il&ts=5d126f03

    They're cool, and very effective, but due to the cheapness of the cameras, the effects of a harsh winter and the poor ADSL broadband at the remote location there are lots of corrupted frames. Is there a way to programatically remove or drop the corrupted frames? I was wondering if there was a way of checksumming the frames, and then removing anything that was outside of an accepted "range" of values. For example, if 40%+ of the frame was pink, then it would clearly be outside of the expected range.

    As there's no accompanying audio, it wouldn't cause an issue for loss of sync in this regard. If it helps, the cameras/software produce accompanying JPG's for every frame in the video, so if it were easier to look at each of these JPG's and delete the corrupted ones before re-combining into a video then that would be possible to do.

    Any ideas?

  2. #2
    Workshop Member
    Join Date
    May 2008
    Location
    NYC
    Posts
    3,957
    Post Thanks / Like
    Images
    7

    Re: Automatically / Programatically Remove Bad Frames from Video.

    Quote Originally Posted by AustinPass View Post
    I have a load of time-lapse videos created from some cheap IP cameras that look like this:

    https://drive.google.com/file/d/1hp2...il&ts=5d126f03

    They're cool, and very effective, but due to the cheapness of the cameras, the effects of a harsh winter and the poor ADSL broadband at the remote location there are lots of corrupted frames. Is there a way to programatically remove or drop the corrupted frames? I was wondering if there was a way of checksumming the frames, and then removing anything that was outside of an accepted "range" of values. For example, if 40%+ of the frame was pink, then it would clearly be outside of the expected range.

    As there's no accompanying audio, it wouldn't cause an issue for loss of sync in this regard. If it helps, the cameras/software produce accompanying JPG's for every frame in the video, so if it were easier to look at each of these JPG's and delete the corrupted ones before re-combining into a video then that would be possible to do.

    Any ideas?
    You could do this with AppleScript and Capture One (here's our kit for getting started, or you can try googling around for free info to get started). I'd suggest by picking several (7? 15?) RGB pickers, and taking a moving average (probably median) of 15-30 frames and then flagging images where 1/3rd or more of the pickers are more than X% (30%?) brighter or darker than that median. We do vaguely similar (but more involved) in our DT Time Lapse Editor software that stabilizes and batch edits high-end time lapse footage. You could also use the Exposure Evaluation (average total scene brightness) but it would be less robust.

    But it would be a TON of work. At least several hours of coding assuming you already have a background in programming. As brutal as it is, you might well be better off manually going through the footage one JPG at a time in Capture One or Bridge or Photo Mechanic or LR.

    A big advantage of doing it this way vs other programming libraries is that you'd see the result of your work visually immediately.

    Doug
    Doug Peterson , Digital Transitions | Email
    Dealer for: Phase One, Mamiya Leaf, Arca-Swiss, Cambo, Eizo, Profoto
    Office: 877.367.8537. Cell: 740.707.2183

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •