Fixing VHS rips

Discuss just about anything else
User avatar
Hallfiry
7-bit super nerd
Posts: 210
Joined: March 20th, 2012, 10:41 am
Contact:

Fixing VHS rips

Post by Hallfiry »

One of my secret hobbies are algorithms that work on images. My techniques are not very advanced, however they are usually close to the data, make not too many assumptins and don't use too weird math. (it doesn't get worse than fourier transform)

When I recently uploaded a VHS recording of our local school theater club from 1983 (oh recycling yard, you have such treasures), I noticed that all VHS rips seem to have randomly shifted lines at the bottom. I thought there must be a way to fix this issue (properly) and thus I started working on an algorithm from scratch. A few hours later I had something on paper and the next day I implemented it and another day later I improved it drastically with a few little changes to the code.

This is my result after those three days:
http://www.youtube.com/watch?v=wlIFitUUlLY

It's pretty good for a first try, I think. However there are still a few frames that didn't turn out as good as I would have hoped, so there's a little bit of work ahead of me before I can say that this project is over and I can publish my (ridiculously simple) algorithm.
Magazine cover disk catalog:
http://www.kultcds.com/Catalog/
developertn
9-bit ubernerd
Posts: 833
Joined: March 23rd, 2015, 4:23 pm

Re: Fixing VHS rips

Post by developertn »

Jesus Christ!hehe

Well, did you know when I was in my early years of math classes that we are taught all complexity starts from the basics.

So don't put yourself down because advance theories comes from what is simple.

The reason they are called advance is because many years of simple added together.

People look at my math and call it weird.

However they don't know I started as a kid getting straight A in school.

Remember we ALL learn how to count from one to ten.

Some of us decide to count to the point where others have stopped.

When you stop that is when the other one who continues succeed!!!!!!!!!!!!

Those who stop has given up and allowed others to continue.

Therefore, Thank God Jesus Christ for the possibilities of people "out classing another" through perseverance#!!
developertn
9-bit ubernerd
Posts: 833
Joined: March 23rd, 2015, 4:23 pm

Re: Fixing VHS rips

Post by developertn »

So I don't know how far you are however Thank you for the encouragement. I'm tired and seem to have run out of steam. So I guess it is your turn and other's turn to succeed.

Enjoy! And thank you for a "short-lived" sprint while it lasted.

Bless Jesus Christ! Then bless my real mom Huong Thi Vu for raising me up to continue even when I have nothing left.

Honour to my real father Nguyen Binh Thuy for also teaching me to continue to study.
Honour to my real mother Huong Thi Vu for teaching me to be loving.

Love to my real sister Nguyen Khoa Thi for helping out.
Love to my real sister Nguyen Khoa Thuyen for forgiving me. :D
User avatar
Hallfiry
7-bit super nerd
Posts: 210
Joined: March 20th, 2012, 10:41 am
Contact:

Re: Fixing VHS rips

Post by Hallfiry »

Well, thanks for engaging in the thread but um...
si tacuisses, philosophus mansisses

However, I changed a few details about the algorithm and added a tiny interpolation routine and now it looks like this:
http://www.youtube.com/watch?v=dWjZyni8ODQ

In some parts it really looks like it was never damaged.
Magazine cover disk catalog:
http://www.kultcds.com/Catalog/
developertn
9-bit ubernerd
Posts: 833
Joined: March 23rd, 2015, 4:23 pm

Re: Fixing VHS rips

Post by developertn »

Jesus!

Well everything looks good.

Your algorithm should be pretty simple to shift it.

However if it is missing parts and a blank area shows then there is nothing you can do about that.

The cleanest outcome in my personal suggestion is just to remove the bottom portion that is messed up.

That way you have a fully cleaned video.
User avatar
Hallfiry
7-bit super nerd
Posts: 210
Joined: March 20th, 2012, 10:41 am
Contact:

Re: Fixing VHS rips

Post by Hallfiry »

developertn wrote:The cleanest outcome in my personal suggestion is just to remove the bottom portion that is messed up.

That way you have a fully cleaned video.
Your post started so great and then you went full retard :/
It's like those people who say "lol, why should you play a beta when the game is already long released".

You know Rembrandt 's painting "The Night Watch"? It was once cropped at the edges to fit into a smaller hall. Now the borders are lost and only known from early copies. Don't be a cropper, son.
Magazine cover disk catalog:
http://www.kultcds.com/Catalog/
developertn
9-bit ubernerd
Posts: 833
Joined: March 23rd, 2015, 4:23 pm

God, Jesus Christ, is number one!hehe

Post by developertn »

Jesus Christ!hehe

Thank you father. Your ideals are awesome. I understand now that preserving the entire originals are best. I forget sometimes people's greatest work including my own are betas. When I start to refine the quality is degraded and that something special is lost.

Bless Jesus Christ; I didn't realize there were such people on all BBS's hehe
Bless my real mom Huong Thi Vu for telling me I have a long ways to go before someone calls me great hehe

Honours to my real dad Nguyen Binh Thuy for teaching to keep studying even if that Borland book is boring.
Honours to my real mom Huong Thi Vu for being nice to me and accepting shadey qualities when others are harsh on me.

Love to my cousin who I consider a brother who was there for me when I was just a kid who needed a friend.
I once had no friends and I had forgotten him with all this excitement unfortunately.

Well thanks for all the people who are wonderful to me - it is time I send my brother a email hehe

Thank you Jesus Christ.

Thank you to Mary who prays for me when I am being stupid, arrogance, proud, vain, and such#!! :lol:
Malvineous
8-bit mega nerd
Posts: 292
Joined: March 17th, 2007, 6:40 pm
Location: Brisbane, Australia
Contact:

Re: Fixing VHS rips

Post by Malvineous »

@Hallfiry: Wow that's pretty good! I've always found that sort of image manipulation to be intimidating. I wonder whether you could pad the missing pixels on the end of the line with those from the line above, to disguise it even more? Then the end of the lines would effectively be lower resolution rather than missing entirely.

EDIT: Sorry I just noticed you already did this - I missed your followup post buried in the middle there. That looks great! I wonder whether you can drop those frames that suddenly flicker white (where the lines above don't also flicker white), perhaps by repeating the previous frame for those last lines. Kind of amazing really how well you can clean up footage like that.
User avatar
Hallfiry
7-bit super nerd
Posts: 210
Joined: March 20th, 2012, 10:41 am
Contact:

Re: Fixing VHS rips

Post by Hallfiry »

Malvineous wrote:@Hallfiry: Wow that's pretty good! I've always found that sort of image manipulation to be intimidating. I wonder whether you could pad the missing pixels on the end of the line with those from the line above, to disguise it even more? Then the end of the lines would effectively be lower resolution rather than missing entirely.

EDIT: Sorry I just noticed you already did this - I missed your followup post buried in the middle there. That looks great! I wonder whether you can drop those frames that suddenly flicker white (where the lines above don't also flicker white), perhaps by repeating the previous frame for those last lines. Kind of amazing really how well you can clean up footage like that.
I'm glad you like my little project.

About the heavy flickers: Those are usually failures of my algorithm. I've already reduced them in the newest version, but I'm working on some details now to get rid of them entirely. If however it does not work automatically, the user will have to select those frames manually and have them fixed by the algorithm with different settings. This would be not too much effort, since they are easy to spot for humans AND they are quite rare in the newest version, as there are only 10 failing frames in 15 seconds of footage at 25 fps, which I consider better than the original footage that had all frames failing by default :D

EDIT: But it occurs sometimes that single lines have big errors in them, so it might be good to do a quick cleanup after the first fixing by checking if pixel values are plausible and if not, replacing them with something like the average of the above and below pixel. MrFlibble would probably encourage me to simply use a median (which isn't a bad idea per se), but I'm somehow not happy with that kind of noise reduction here. I wanna be very selective about what pixels to actually "correct" and which to keep.

EDIT2: A little background information: The algorithm works on two differnt kinds of lines, smooth lines and edgy lines. For mathematical reasons it is useful to seperate those by some measure to handle them differntly and avoid errors. THe flickers are usually the result of a misidentification. The newest version has a few of those, but less then earlier versions. The entire video with its 754 frames has 40 broken frames (that's 5.3%), with a big cluster of them in the late parts where the camere zooms away and the toy railroad moves along the bottom of the screen and the whiote from of the stage comes into frame. Along this tim, the interpolation pulls the gray from the stage into areas that should be white from the front of the stage. So far no big problem, because the cheap interpolation was just to make the colors a bit more pleasing in the areas that have no data, so anythjing from the area around them would be more or less fine. However, the new colors from above make the line seem edgy to the detection instead of smooth resulting in some horrible outcome. The next step is thus to mark the interpolated pixels during the cleanup and and take them into account for line classification. This will also make the algorithm faster, as smooth lines are a lot faster to correct than edgy lines.
Magazine cover disk catalog:
http://www.kultcds.com/Catalog/
developertn
9-bit ubernerd
Posts: 833
Joined: March 23rd, 2015, 4:23 pm

Re: Fixing VHS rips

Post by developertn »

Jesus Christ!hehe

Wow. Some fancy words I remember from my college years. "Median", "interpolation", and such are from my probability and statistics class and my college algebra class. I've sublimated them over the years and haven't really used them much. However they're still in the recesses of my subconscious. hehe
developertn
9-bit ubernerd
Posts: 833
Joined: March 23rd, 2015, 4:23 pm

Re: Fixing VHS rips

Post by developertn »

Jesus Christ!hehe

Well, I don't want to take your joy away from you.

I know there are projects that I enjoy working on and love it when others support me.

So thank you all those times you supported me.

Maybe one of these days I can have another quality developertn and such up hehe :lol:

Serious -



Bless Jesus Christ then my real mom Huong Thi Vu for teaching me to be loving to others!!!!!!!!!!!!

Honour to my real mother Huong Thi Vu for teaching me to care about others#!!

Honour to my real father Nguyen Binh Thuy for teaching me to keep working on my own project and be happy.
developertn
9-bit ubernerd
Posts: 833
Joined: March 23rd, 2015, 4:23 pm

God, Jesus Christ, is number one!hehe

Post by developertn »

Jesus Christ!hehe

I hope you get your program up and running so we can all see the miracle. hehe :lol: However, I know I am personally ONLY mere mortal. I cannot be like Jesus Christ. Jesus Christ has given ALL life forces to EVERYONE!!!!!!!!!!!! That is why when God's son died, God resurrected and allowed to enter Heaven's gate.

On the other hand, even if you program for the rest of your life, can you sacrifice your life WITHOUT any gains! So you see ONLY Jesus Christ can live without any rewards#!!
developertn
9-bit ubernerd
Posts: 833
Joined: March 23rd, 2015, 4:23 pm

Re: Fixing VHS rips

Post by developertn »

Well, I wish it were different however I messed up my The Holy Bible a long time ago. This is only a few of the authentic pages that remains with me. The Holy Bible is the authentic 1611 King James Version EDITION. The resolutions are extreme to preserve the original quality.

http://www.mediafire.com/view/d21oyfuus ... Moses.jpeg
User avatar
Hallfiry
7-bit super nerd
Posts: 210
Joined: March 20th, 2012, 10:41 am
Contact:

Re: Fixing VHS rips

Post by Hallfiry »

I know life was and/or is difficult to you and you're grateful for the tiny things (which I am, too), but please don't hijack my thread with 90% bible gossip 8% "I hope your project will succeed with the help of christ" and 2% actually talking about the topic.
developertn wrote:Well, I wish it were different however I messed up my The Holy Bible a long time ago. This is only a few of the authentic pages that remains with me. The Holy Bible is the authentic 1611 King James Version EDITION. The resolutions are extreme to preserve the original quality.

http://www.mediafire.com/view/d21oyfuus ... Moses.jpeg
I'll say it and call me a maniac, and tar and feather me, but: your copy of the KJ bible version from 1611 is as authentic as my 80s photocopies of a few pages from an 80s CHIP magazine issue that I found in our cellar and couldn't throw away because I love old photocopies for some sentimental reason.


Talk about VHS rips and math and whatever, but not about nothing. Posting pictures of unrelated preservation efforts is fine, but not of your semi-special KJ bible that I can easily get from the internet (I assume).

[/rage]
Magazine cover disk catalog:
http://www.kultcds.com/Catalog/
developertn
9-bit ubernerd
Posts: 833
Joined: March 23rd, 2015, 4:23 pm

Re: Fixing VHS rips

Post by developertn »

June 29, 2015

Dear Hallfiry,

Please don't get upset. It seems you have misunderstood my post. I gave you something I felt IS of high sentimental value to me. Whether it is authentic or not is besides the point. What is important is that I took the time out and cared enough to share something that is very special to me just like you share your CD collections with the world. I was reading a book to try to understand the sexes better. It says men and women communicate differently so they tend to "miscommunicate". Maybe it is my shelterred life being very close to a priest these days. If you notice my posts I tend to try and save everyone although they may not like me for it much like someone tries to save a drug user and gets hassled for someone trying to care!!!!!!!!!!!! Then I think back to The Holy Bible and realize Jesus Christ saves everyone yet they all hated him for it until he was gone from their lives#!!

Sincerely,
Tien Khoa Nguyen
Resident Developer
Post Reply