View Full Version : Interlacing-like video glitch
zeromido
16th July 2021, 15:03
I noticed a weird glitch in one of my videos, and I'd love to hear your opinions on its possible causes and fixes.
Screenshot:
https://i.imgur.com/TExegrD.png
Sample:
https://www.dropbox.com/s/pguzhh83w9q8tzr/glitch.mkv?dl=1 (554.26 KB) (https://www.dropbox.com/s/pguzhh83w9q8tzr/glitch.mkv?dl=1)
As you can see, the animation looks like it's interlaced.
I tried playing it with MPC-BE v1.5.8, VLC v3.0.16, Google Chrome's player, and even Dropbox' player but the glitch was still there.
I also re-encoded it using ffmpeg v4.4 with the following parameters, but still no luck:
ffmpeg -i glitch.mkv -vf yadif -c:v libx264 -preset veryslow -crf 18 -c:a copy output.mp4
ffmpeg -i glitch.mkv -vf yadif -c:v libx265 -preset veryslow -crf 18 -c:a copy output2.mp4
ffmpeg -i glitch.mkv -vf bwdif -c:v libx264 -preset veryslow -crf 18 -c:a copy output.mp4
ffmpeg -i glitch.mkv -vf bwdif -c:v libx265 -preset veryslow -crf 18 -c:a copy output2.mp4
benwaggoner
16th July 2021, 16:32
Yeah, it does look like it was interlaced content that was then scaled down as progressive. A lot of older 480i animation titles have that sort of problem introduced by poor preprocessing upstream. You'll see it on streaming services and even DVDs sometimes.
A) Have you checked your source to make sure it isn't in there?
B) Have you tried deinterlacing it yourself?
Unfortunately if your source was interlaced scaled as progressive, it's extremely hard to fix that. You could probably reverse engineer the vertical scaling factor and then apply deinterlacing again, but there would be upscaling artifacts lingering. And that's much more After Effects than ffmpeg kind of work.
zeromido
7th August 2021, 12:06
Thank you for your response, and I'm terribly sorry for the late reply.
Now, to answer your questions:
A) Have you checked your source to make sure it isn't in there?
Sadly, I don't have the source.
B) Have you tried deinterlacing it yourself?
I already tried yadif and bwdif, two of ffmpeg's deinterlacing filters, but they didn't work.
It seems like fixing this glitch is not gonna be worth the trouble after all.
SeeMoreDigital
7th August 2021, 14:18
Who encodes anything at: 1280x718 pixels?!
FranceBB
9th August 2021, 16:07
Whoever screwed up the original file is an incompetent. (And I'm being polite here).
I've lost several minutes with QTGMC, Libav, TDeint, and Bob without getting anything good.
I was trying to get back the original resolution to make the fields match but nothing...
In the end, I was able to get rid of them using SRestore and treating the artifacts as if it was blending.
#Indexing
FFMpegSource2("Z:\glitch.mkv", atrack=-1)
#Getting rid of the interlacing artifacts
SRestore(omode=5, mode=3, thresh=1)
#Downscale to the original resolution by inverting the kernel used to upscale
DeBilinearResizeMT(720, 480)
https://i.imgur.com/dozMHlr.png
https://i.imgur.com/k1cZG8Q.png
https://i.imgur.com/wJsbphO.png
The problem is that if you do something like that, SRestore() will replace the screwed up frames with those that it thinks are "ok", hence removing frames and ending up with less than 23.976 as some of them are gonna be duplicated.
At that point, you might add a TDecimate() and then perform frame interpolation to go back to 23.976 like:
TDecimate()
super = MSuper(last)
vecb = MAnalyse(super,isb=true)
vecf = MAnalyse(super,isb=false)
MFlowFps(last,super,vecb,vecf,num=24000,den=1001,blend=false)
but it might introduce artifacts...
Congratulation to whoever screwed up the source...
ReinerSchweinlin
9th August 2021, 19:26
If you go with FranceBBs Solution, you could try to replicate some of the then missing frames with something like RIFE.
But to add to what others said above: There is no eays fix with this one - probably easier to get the original in a better version from somewhere...
benwaggoner
9th August 2021, 21:53
If you go with FranceBBs Solution, you could try to replicate some of the then missing frames with something like RIFE.
But to add to what others said above: There is no eays fix with this one - probably easier to get the original in a better version from somewhere...
Alas, there are a lot of older Nickelodeon shows that were created at 480i. You can find upscaled versions of them, but none have been remastered AFAIK.
ReinerSchweinlin
10th August 2021, 11:01
Alas, there are a lot of older Nickelodeon shows that were created at 480i. You can find upscaled versions of them, but none have been remastered AFAIK.
I had sone luck purchasing older DVD releases. But of course, if the only source avaible is a messed up one - its not easy to get a good result... With Cartoons, its much easier and a few lost frames donīt really make a difference in visual experience. With life-shows, I had some success with RIFE to interpolate the frames that where sorted out by srestore...
zeromido
11th November 2021, 23:15
Goodness me! I sincerely apologize for not responding...
A big Thank You to everyone!
Now, I'll comment on every statement you said as tokens of my apology and thanks...
Who encodes anything at: 1280x718 pixels?!
Thank you for making me laugh. The culprit is probably a video-processing novice, but who am I to call someone a novice when I am one myself?
Whoever screwed up the original file is an incompetent. (And I'm being polite here).
Well, I think a lot of people are going to be incompetent when compared with Doom9 veterans :D
I've lost several minutes with QTGMC, Libav, TDeint, and Bob without getting anything good.
I was trying to get back the original resolution to make the fields match but nothing...
In the end, I was able to get rid of them using SRestore and treating the artifacts as if it was blending.
You know what they: "If at first you don't succeed, try, try, try again."
#Indexing
FFMpegSource2("Z:\glitch.mkv", atrack=-1)
#Getting rid of the interlacing artifacts
SRestore(omode=5, mode=3, thresh=1)
#Downscale to the original resolution by inverting the kernel used to upscale
DeBilinearResizeMT(720, 480)
Believe it or not, it was my first time using AviSynth. It took me an hour to setup all the plugins...
Regardless, it was great seeing the magic happen for the first time.
Notes to self:
1. Get the following plugins/scripts to avoid problems when using SRestore: Average-v0.95, GRunT-v1.02, masktools2-v2.2.28, RgTools-v1.2, SMDegrain, srestore_v2.796, TIVTC-v1.0.26, and Zs_RF_Shared.
2. Thank real.finder (https://forum.doom9.org/showthread.php?p=1913890#post1913890) and Google (https://www.google.com/search?q=srestore+script+error+expected+avisynth)!
The problem is that if you do something like that, SRestore() will replace the screwed up frames with those that it thinks are "ok", hence removing frames and ending up with less than 23.976 as some of them are gonna be duplicated.
Yeah, the video did seem choppy even after exporting it using ffmpeg:
ffmpeg_4.4.1.exe -i Fix.avs -vcodec libx264 -crf 23 -acodec copy Fixed.mkv
At that point, you might add a TDecimate() and then perform frame interpolation to go back to 23.976 like:
TDecimate()
super = MSuper(last)
vecb = MAnalyse(super,isb=true)
vecf = MAnalyse(super,isb=false)
MFlowFps(last,super,vecb,vecf,num=24000,den=1001,blend=false)
but it might introduce artifacts...
Unfortunately, it did: https://i.imgur.com/3rfWVKy.png https://i.imgur.com/8UaBSau.png The artifacts looks cool, though.
Congratulation to whoever screwed up the source...
I doubt he/she will ever notice the glitch anyway.
If you go with FranceBBs Solution, you could try to replicate some of the then missing frames with something like RIFE.
But to add to what others said above: There is no eays fix with this one - probably easier to get the original in a better version from somewhere...
RIFE is... hard to install. Its requirements don't match my system (particularly torch and torchvision). I spent 30 minutes to get it working, but I just need to sleep.
Alas, there are a lot of older Nickelodeon shows that were created at 480i. You can find upscaled versions of them, but none have been remastered AFAIK.
The show was produced in 2011. Is that old?
I had sone luck purchasing older DVD releases. But of course, if the only source avaible is a messed up one - its not easy to get a good result... With Cartoons, its much easier and a few lost frames donīt really make a difference in visual experience. With life-shows, I had some success with RIFE to interpolate the frames that where sorted out by srestore...
It really is not easy. I have the artifacts to prove it.
videoh
11th November 2021, 23:32
Sadly, I don't have the source. Why don't you have the source?
zeromido
13th November 2021, 17:47
Why don't you have the source?
Because whoever made the video I have didn't share the source.
FranceBB
14th November 2021, 10:32
Why don't you have the source?
Because whoever made the video I have didn't share the source.
Careful here, though, 'cause if you downloaded it illegally we would have to stop here and we can't help you any longer... :(
A hint: next time, cap the .ts directly from the TV. If you do that, it's very unlikely that it's gonna be screwed up 'cause it's the file aired and encoded live by the broadcaster itself.
For instance, we air the Italian Dubbed version of Nickelodeon and every episode of every show goes through Manual QC (on top of automated QC through Tektronix Cerify which we're soon going to replace with Aurora).
I still remember in 2016 when I had to encode something called like Marco and Star against the evil forces or something like that. Imagine a grown up man in a light dimmed room checking with a waveform monitor and two LM-100 a cartoon.
It made me think, though: if you think that adults make up the cartoons that children watch 'cause there's no child that works for other children, it makes you think a bit.
Full disclosure: that lasted a week or two before I asked to move myself back to encode real TV Series and I've got another coworker handling those cartoons xD
zeromido
19th November 2021, 22:16
Careful here, though, 'cause if you downloaded it illegally we would have to stop here and we can't help you any longer... :(
Thanks for the tip!
A hint: next time, cap the .ts directly from the TV. If you do that, it's very unlikely that it's gonna be screwed up 'cause it's the file aired and encoded live by the broadcaster itself.
For instance, we air the Italian Dubbed version of Nickelodeon and every episode of every show goes through Manual QC (on top of automated QC through Tektronix Cerify which we're soon going to replace with Aurora).
I still remember in 2016 when I had to encode something called like Marco and Star against the evil forces or something like that. Imagine a grown up man in a light dimmed room checking with a waveform monitor and two LM-100 a cartoon.
I stared into audio waveforms, too... but for a personal project... I wanted to make a dual-audio movie. It should've been simple: mux the dubbed audio track into the video and you're done. However, the dubbed audio was out of sync. I tried delaying the audio track using the muxer, but it didn't work. After some time, I realized that the dubbed audio was cut. In other words, the dubbing studio didn't dub all of the original audio for some reason. So, I thought I'd add the missing parts from the original audio. Audacity was the first program to come to my mind. I imported the whole video to Audacity because for some reason, importing the extracted audio track made the original track out of sync. Then, I dug through the audio to copy the missing parts from the original audio track to the dubbed audio track. It worked in the end, but it was tedious work...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.