Hi,
I have two sources, a 720p50 and a 1080p50 stream, 1hr long.
These are identical frame to frame for the most part.
The 1080p50 stream has sporadic artifacting (bright white macro blocks).
This occurs couple of times a minute or so.
I would like to replace the broken frames in the 1080p50 stream with the 720p50 frames (as the 1080p50 is much sharper otherwise).
Two ways I can see to do this:
Extract all the frames to images (bmp or png?), manually replace the broken ones. (This will require a lot of storage and setup time)
Use an NLE to replace the frames when necessary, but picking out an individual frame will likely be difficult. (Kdenlive or resolve)
Alternatively some kind of script that would allow me to press a button and save a frame number to a file would at least speed it up significantly. (might be possible with mpv?)
If anyone can suggest a more streamlined workflow or tool for this that would be great.
Thanks.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 10 of 10
Thread
-
-
Make sure it's not some decoding error first, eg. try different players, mpv, mpchc, ffplay etc...
How many consecutive frames do the "bright white macro blocks" occur in? How much area do they cover per frame?
Use an NLE to replace the frames when necessary, but picking out an individual frame will likely be difficult. (Kdenlive or resolve)
Why would it be difficult ?
A NLE would be the method of choice for most people that do this manually
Alternatively some kind of script that would allow me to press a button and save a frame number to a file would at least speed it up significantly. (might be possible with mpv?)
Alternatively you can use avisynth or vapoursynth and specify the frames to replace using RemapFrames. avspmod has a macro to insert current framenumber.py, and you can map it to a hotkey (so you don't have to type frame numbers) - so you could play/preview or go frame by frame and write the replacement script at the same time
If the defect frames are very different from surrounding frames, lasting 1 frame, you could probably script automatic detection and replacement using conditionalfilter
Or if the brightness is very different than "normal" frames, you could probably script automatic detect/replace as well -
Sadly not a decoding error. It definitely appears like a decoding error further up the chain (Such as terrestrial TV when the signal is intermittent and the motion vectors get applied to the wrong I frame) but it is baked into my source.
How many consecutive frames do the "bright white macro blocks" occur in? How much area do they cover per frame?
Why would it be difficult ?
A NLE would be the method of choice for most people that do this manually
For each frame -- Hide 1080p50 track
- Right click -> Export Image to Project
- Click Save
- Drag Image from Project Bin to Timeline
- Show 1080p50 track
How would that speed it up? If you save a frame number you still have extra steps to perform to replace frames
Then with the frame numbers I can use a script to replace.
"insert current framenumber.py" looks like it should work well for this.
Otherwise I might try adapting this .
If the defect frames are very different from surrounding frames, lasting 1 frame, you could probably script automatic detection and replacement using conditionalfilter
Or if the brightness is very different than "normal" frames, you could probably script automatic detect/replace as well
Normally I end up shooting myself in the foot when I try heuristics anyway.
Thanks for the pointers. -
Well if you do it that way it's much slower. Why would you export individual frames ?
The way you would do this is slightly different in different editors -
One way is : Put 720p50 on top layer (scaled to 1080) . Hide the visibility of the layer, so you only see the bottom 1080 layer. when you see bad frames on the bottom 1080 layer, make cuts on the scaled 720 top layer to "cover up" the bad frames on the bottom 1080 layer. Another way you can do it is with opacity keyframes. 100% when you want top layer to show, 0% when you want bottom to show. Set keyframes to no interpolation (or on/off) - basically you're toggling visibility of the layer
Or multicam edit. The 2 "cams" are 720(scaled to 1080) and the 1080 version. This would probably be the easiest/fastest/ least number of keys/ and most interactive for most people (hotkey switches the cam), but not all free versions have multicam editing, I can't recall if the non studio version of Resolve has it
How would that speed it up? If you save a frame number you still have extra steps to perform to replace frames
Then with the frame numbers I can use a script to replace.
"insert current framenumber.py" looks like it should work well for this.
Otherwise I might try adapting this .
Just like you don't need images for a NLE...you can do it directly in a NLE -
One way is : Put 720p50 on top layer (scaled to 1080) . Hide the visibility of the layer, so you only see the bottom 1080 layer. when you see bad frames on the bottom 1080 layer, make cuts on the scaled 720 top layer to "cover up" the bad frames on the bottom 1080 layer. Another way you can do it is with opacity keyframes. 100% when you want top layer to show, 0% when you want bottom to show. Set keyframes to no interpolation (or on/off) - basically you're toggling visibility of the layer
Or multicam edit. The 2 "cams" are 720(scaled to 1080) and the 1080 version. This would probably be the easiest/fastest/ least number of keys/ and most interactive for most people (hotkey switches the cam), but not all free versions have multicam editing, I can't recall if the non studio version of Resolve has it
You don't need images, or to replace images in a folder when you use avisynth or vapoursynth - everything is frameserved and referenced to the video(s). You don't need a "physical" image sequence or to waste any space
It seems that "10 10" would replace frame 10 of A with frame 10 of B.
My first instinct was the folder of frames as that was how upscaling with some of the ML stuff used to be done.
If I was doing scene by scene or similar scale, a NLE would be the obvious choice, it's just that at single frames the scale is so small and frequent it becomes unweildy (at least for me) to use a NLE for this task.
Basically, more than one key press for each frame was more than I was willing to do. I only have so much dedication.Last edited by ajingo; 25th Sep 2021 at 17:30.
-
Wait... Did you mean the frames don't align ? I assumed when you said "These are identical frame to frame for the most part." that you meant they were identical , except the 1080 version has some artifacting ?
Another option to remapframes is clipclop. You might like the syntax better (or not) -
Assuming you have videos that align:
If you have only a few "bad" frames, but mostly "good", it's better to swap the tracks, 1080 on top, 720 on bottom. You're poking "holes" in the top track for the 720 version to appear.
I don't understand why you need to zoom at all ? You actually don't have to toggle visibility, and you can edit by keyboard shortcuts . Hit play or frame step, whenever you see bad frame, mark in, mark out when frames end. Delete. Go to next... repeat
Not sure how kdenlive does multicam edit, but that's basically what you want, and it stays on the current track until you toggle it. The hotkey is toggling the "cam", ie. camera switching. e.g. if the "1" key is 720, "2" key is 1080 , you start with "2". The entire video is 1080 until you hit "1" , then from then on it's 720, move the playhead as soon as you hit 2, it switches back to 1080. In some editors, you have multiple views - so one is looking at say the 1080 version only, the other is looking at the final multicam edit. So you use the 1080 view to guide the multicam edit. You go along, once you see a bad frame you hit 1, if there is more than one, keep on going, as soon as 1080 is ok, you hit 2 (it switches back to the 1080 track). This is interactive and the fastest/ fewest number of keystrokes by a large margin if your videos align, because you don't have to mark in/ out or delete - everything is "built in" to that 1 key stroke -
Upload a sample of the video with "bright white macro blocks" and an overlapping segment from the good 720p video. That will help determine if the fix can be automated.
-
Alternatively some kind of script that would allow me to press a button and save a frame number to a file would at least speed it up significantly.
EDIT : To get Sawbones / FrameSurgeon, as it's not made very clear in the linked Doom9 thread :
https://www.mediafire.com/folder/hb26mthbjz7z6/StainlessSLast edited by abolibibelot; 4th Oct 2021 at 02:25.
Similar Threads
-
I'm looking for for sources to learn about video coding
By rockerovo in forum Newbie / General discussionsReplies: 1Last Post: 26th Jul 2018, 17:14 -
Combining Movies from different sources
By Brenna84 in forum Authoring (DVD)Replies: 5Last Post: 21st Aug 2017, 17:22 -
Making a vid from two different sources using avisynth
By pooksahib in forum Video ConversionReplies: 7Last Post: 18th Jun 2017, 23:26 -
Need developers or sources.
By aleniko in forum Newbie / General discussionsReplies: 0Last Post: 24th Jan 2017, 14:47 -
Merging sources
By Akai-Shuichi in forum RestorationReplies: 2Last Post: 22nd Nov 2016, 19:12