The GetDPI Photography Forum

Great to see you here. Join our insightful photographic forum today and start tapping into a huge wealth of photographic knowledge. Completing our simple registration process will allow you to gain access to exclusive content, add your own topics and posts, share your work and connect with other members through your own private inbox! And don’t forget to say hi!

Automatically / Programatically Remove Bad Frames from Video.

AustinPass

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

https://drive.google.com/file/d/1hp2i0l4Msq2BdgVidE08iwUiW38R_BBE/view?usp=sharing_eil&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?
 

dougpeterson

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

https://drive.google.com/file/d/1hp2i0l4Msq2BdgVidE08iwUiW38R_BBE/view?usp=sharing_eil&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
 

romkus01

New member
Video editing is the process of editing segments of motion video production footage, special effects and sound recordings in the post-production process. Motion picture film editing is a predecessor to video editing and, in several ways, video editing simulates motion picture film editing, in theory and the use of linear video editing and video editing software on non-linear editing systems (NLE). Using video, a director can communicate non-fictional and fictional events. The goal of editing is to manipulate these events to bring the communication closer to the original goal or target. It is a visual art.[3]

Early 1950s video tape recorders (VTR) were so expensive, and the quality degradation caused by copying was so great, that a 2-inch Quadruplex videotape was edited by visualizing the recorded track with ferrofluid, cutting it with a razor blade or guillotine cutter, and splicing with video tape. The two pieces of tape to be joined were painted with a solution of extremely fine iron filings suspended in carbon tetrachloride, a toxic and carcinogenic compound. This "developed" the magnetic tracks, making them visible when viewed through a microscope so that they could be aligned in a splicer designed for this task.

Improvements in quality and economy, and the invention of the flying erase-head, allowed new video and audio material to be recorded over the material already present on an existing magnetic tape. This was introduced into the linear editing technique. If a scene closer to the beginning of the video tape needed to be changed in length, all later scenes would need to be recorded onto the video tape again in sequence. In addition, sources could be played back simultaneously through a vision mixer (video switcher) to create more complex transitions between scenes. A popular 1970-80s system for creating these transitions was the U-matic equipment (named for the U-shaped tape path). That system used two tape players and one tape recorder, and edits were done by automatically having the machines back up, then speed up together simultaneously, so that the edit didn't roll or glitch. Later, in the 1980-90's came the smaller beta equipment (named for the B-shaped tape path), and more complex controllers, some of which did the synchronizing electronically. outsoursing traning
 

Attachments

Top