Thread: How do I rectify motion blur on mkv's

1. Does anybody have a solution to this? Basically I have converted a whole bunch of dvds to mkv using a software called 'makemkv' and what I have realised after all this time is that the output files have motion blur during scenes of increased movement. If I had known this earlier I would've never converted them to mkv, I would've just ripped the vob files and kept them untouched but now that I am in this situation, does anybody know how to remove them completely?

I am using handbrake to make the files smaller, but even by selecting the decombe filter and experimenting with the deinterlace filters, it wont get rid of it 100%. The 'slower' setting on the deinterlace filter will reduce it by a great deal, but I am looking for a way to just get rid of it completely.

Anybody know of any other software or any solutions?

I have tried converting them back to vob files, but the blur still follows through.

Please see the attached files so you know what I mean.
2. It looks like they were blend-deinterlaced. It's not motion blur. Do you have a short sample you can make available? Pictures don't really tell us much. And I take it the DVDs aren't available any more? MakeMKV doesn't reencode so the blending didn't come from it, Maybe it was already in the source DVDs. In any event, the chances are the damage can't be reversed.

Now, if you're taking pictures from a player that's deinterlacing the MKV, there's hope. If the MKVs are still interlaced they can be unblended successfully. But not with Handbrake. Only AviSynth can do the job and Handbrake doesn't use it.
3. Sure here is a sample. If you pause the video at different times you'll see the blur throughout. The eye can't pick it up whilst its in motion which is maybe the reason why I never noticed it before but now I know it is there it is bugging me.

The thing is if I watch the original dvd in my dvd player on my tv, the blur is non-existent, the movie plays sharply. It is only after I have ran it through makemkv to contain all the vob files with a .mkv extention that this occurs. It is mostly on older movies, recent films don't have this problem at all.
4. That's not the output from MakeMKV. It's from Handbrake. This has already been deinterlaced and resized and converted to H.264 video and AAC audio. How about a sample from the MakeMKV repackaged DVD? And you can leave off the censor certificate and credits next time. Something with steady movement.

If you're in England, what are you doing with an NTSC source? If there's a PAL DVD available, it's probably much better. If this was downloaded originally, maybe after being reencoded by a clueless idiot, then all bets are off.
5. Bollywood movies don't come in pal, at least not the old ones they only come in ntsc format, so this is the only format they can be purchased.

I have attached a sample of the output from makemkv, sorry i couldnt leave the credits out but it's only a few seconds anyway.
6. Originally Posted by Acehit
Bollywood movies don't come in pal, at least not the old ones they only come in ntsc format
That's not entirely true but I accept that this particular one may not be available as a PAL DVD.

Anyway, this sample is much better. It's field-blended and interlaced. It has to be unblended using an AviSynth script, one such as:

Yadif(Mode=1)#or the better and slower QTGMC
SRestore()

It came from what was originally a PAL source and the result will be a 25fps video. You can't do this in Handbrake but some program that accepts AviSynth scripts as input. The linked video only unblends it. It doesn't address any of the other problems with the movie, such as the shaky picture, the edge enhancement, or the severely blown-out whites.

7. Wow! You son of a gun, how did you do that? I'm going to download this Avisynth software now.

Can you write a short simple step by step guide on how you did this? I would so appreciate it.

You're a legend!

Thanks.
8. I have no idea why mkvmerge is being used to revamp DVD vob's (MPEG-2) to an mkv container. The DVD appears to have been made from VHS. Is the O.P. trying to re-encode to h264? The DVD appears to be blend-deinterlaced, then encoded as interlaced. I would have decoded the original DVD to lossless AVI and fixed it up in Avisynth (the color is awful and there are all kinds of motion control and frame jitter problems). I think we should go back to the original DVD to see what it looks like, and start there.

The aspect ratio in the mkv version is absurdly incorrect, and the video has been cropped. NOTE:" no one makes movies as 16x9 except for TV programs. The original movie was 1.875:1. The aspect ratio of the badly cropped and disfigured handbrake image is 2:03:1. And it's not h264, it's still MPEG2. I don't understand the purpose of this exercise. You can't fill a 16x9 frame with a 1.875:1 video anyway.
9. MakeMKV has no ability to change the picture. All it does is remux the DVD content into an MKV file. Manono's analysis is correct -- bob and srestore. It appears to be a 1.85:1 movie letterboxed in a 4:3 DAR (ITU resizing because it was recorded from video tape) frame.
10. I corrected my post. imdb reports the original aspect ratio of the movie is 1:875:1, as jagabo noted.

On a 16x9 display, it should look something like this:

Back to the original DVD.
11. Can anyone explain how I get the output like how manono did it? I downloaded avisynth but I havent got a clue what to do with it. Do I use it in conjunction with virtual dub mod or something?
12. You need to make a script file (plain text, you can use NotePad) with the extension AVS.

http://avisynth.nl/index.php/Main_Page#New_to_AviSynth_-_start_here

Within that file you open the source video and call Yadif and SRestore.

Code:
ffVideoSource("filename.mkv")
SRestore()
ffVideoSource (part of the ffmpeg source plugin) Yadif and SRestore don't come with AviSynth you'll need to download and install them (and any filters they require -- for example, SRestore has several dependencies):

http://avisynth.nl/index.php/FFmpegSource
http://avisynth.nl/index.php/Srestore

Finally, you open that AVS script as it was a video file in any editor or encoder that supports AVS scripts as input. Like VirtualDub, the x264 cli encoder, etc.

Yes, it's a PITA for someone just starting with AviSynth. But not so bad once you get set up. And there's nothing else that has these advanced abilities.
13. Ok I get the part where I open up notepad and paste in that script and save as avs file.

I already have virtual dub so I am familiar with that one.
14. SRestore is an AVSI script. You can download it from the link I gave. Put the .AVSI file in AviSynth's plugins folder.

AVSI scripts in AviSynth's plugins folder are imported automatically when AviSynth starts. Most dll filters do so to. Yadif is an exception, you need to import it into your script manually with:

Code:
Load_Stdcall_plugin("C:\Program Files (x86)\AviSynth 2.5\plugins\yadif.dll")
(Change the path if necessary.) I have an AVSI script in my plugins folder with that line so Yadif is automatically available without having to import it within the script I'm working with.

Manono alluded to this, but QTGMC() is better than Yadif(). But it's much slower and requires a bunch of other filters. Start with Yadif() and once you get that working consider using QTGMC() instead.
15. Ok so let me get this straight.

what I have done is saved that srestore.avsi file and put into the plugins directory of Avisynth 2.5.

Now what do I do with yadif? I have downloaded it and extracted all the files. Inside the folder it has a whole bunch of files titled avisynth, gpl, Makefile, yadif.dll etc etc. but where do I put these? Do these go to the plugins folder of Avisynth 2.5 as well?

Do I just transfer all the files or just the yadif.dll?
16. Just put yadif.dll in your plugins folder. The other files are not plugins. Leave them where they are.
17. Ok here's what I have done. I have copied the yadiff plugin file into the plugins directory as you suggested. and what I have also done is copied the ffms-2.17-x64.7z file into that directory as well (I think this is what I am supposed to do). This is the FFmpegSource that jagabo mentioned in the above post.

Next I have created the avs file and copied and pasted what jagabo put in the same post, but obviously with the directory where the video is, so my script looks like this

SRestore()

next I opened up virtual dub and tried to open this avs file and the following error message came up, "avi import filter error: (unknown) (80040154).

What have I forgot to do, or have I missed a step?
18. Probably missing this statement for ffms2:
Code:
loadCplugin("Path\to\Avisynth\plugins\ffms2.dll")]
Attached mkv is mostly a resize operation. That's when you see posterization, crushed blacks, clipped brights, etc. Can't fix all of it, but fixed a few spots, halos, edge ghosts, frame hops. Crop/resized for 1.875:1 aspect ratio, should fill a 16x9 window full-screen (almost). 2-channel stereo, didn't try to go with 5.1, levels, color, or text. Hope the tape doesn't look as awful as the DVD or mkvmerge sample. Quality too poor to go for HD.
19. Originally Posted by sanlyn
On a 16x9 display, it should look something like this:

Attachment 20179
Hehe, maybe it should, but it won't because the DAR is 4:3. On a 16:9 display (unless using the zoom) it'll be surrounded on all four sides by a lot of black. Almost all classic Indian widescreen films on DVD are 4:3. Just another way the Indian home video companies screw the consumer.

Edit: Oh, I see you've now cropped and resized it for better viewing on 16:9 TV sets.
20. Are you able to write me a step by step guide on how you do this? I am banging my head against the wall here. I have been using virtual dub for years, but I am totally new to this kind of video processing. I'm just completely lost I appreciate all your assistance, but what I really need is a complete breakdown of what exactly I need to do, almost like an idiots guide from start to finish.
21. #Acehit, show us your entire avs script, not just part of it.

@manono, yeah but resizing reveals even more defects (ick!). Would take a lot of work, and if those bouncing objects are in the original source forget it. A learning experience, though.
22. This is my avs script, I am attaching it.

I have inputted the Srestore.avsi, ffms-2.17-x64.7z and yadif.dll files into the plugins directory of avisynth. I have virtual sub ready, I just need advice on what exact actions to take.
23. Originally Posted by Acehit
Are you able to write me a step by step guide on how you do this?
I demuxed the video because, as sanlyn said, converting it to the MKV container is stupid if you're planning on going back to work with it again. Yes, I realize you hadn't planned on working on it again when you first made it. Then I used the M2V I got, made a D2V project file with DGIndex and used the DGDecode.dll with that D2V and MPEG2Source to make the script. Get the DGMPGDec package and read the 3 included docs. Then read them several more times until you understand. They have the best written explanation of how to create AviSynth scripts (in my opinion). I then used this script:

Import("D:\AviSynth Stuff\plugins\SRestore.avs")
MPEG2Source("E:\Test\test.d2v")
Srestore()

I opened it in XviD4PSP, and encoded it for MKV. Apparently XviD4PSP resized it behind my back where I thought I had kept the original resolution and set a SAR. I have an MP4 where I did it right.

Most of the NTSC Indian classic film DVDs are so godawful horrible that a working knowledge of AviSynth is an absolute necessity if you want to make them presentable.

Are you able to write me a step by step guide on how you do this?
The above is as close as I'm going to get to writing a step-by-step for this.
24. Originally Posted by Acehit
This is my avs script, I am attaching it.

I have inputted the Srestore.avsi, ffms-2.17-x64.7z and yadif.dll files into the plugins directory of avisynth. I have virtual sub ready, I just need advice on what exact actions to take.
First, comment out the bottom two lines and see if the script opens in VDUB:

#SRestore()

If it does, you'll then need to load the Yadif.dll into the script:

#SRestore()

See if that opens. If it does, remove the comment from the final line and see if it opens.

Always provide the complete script and error message when you don't understand.
25. Originally Posted by Acehit
This is my avs script, I am attaching it.

I have inputted the Srestore.avsi, ffms-2.17-x64.7z and yadif.dll files into the plugins directory of avisynth. I have virtual sub ready, I just need advice on what exact actions to take.
That's not your entire script. It's only the last 3 lines.

If you copied the file "ffms-2.17-x64.7z" in its entirety into your plugins folder, remove it and place it in a separate folder. A ".7z" file is not a plugin, it's a package compressed with the 7Zip compressor. If you don't have 7Zip, I've attached a plain-vanilla .zip version of the same ffms2 download, below. Download that ffms2 zip to a separate folder, unzip it, and look for two files: ffms2.dll and ffms2.avsi. Copy both of them into avisynth plugins. Don't copy any of the other ffms2 files.

You will also need the Haali Media Splitter for mkv's, mp4, and other stuff. If you don't already have it, the Haali installer can be downloaded here: http://www.videohelp.com/download/MatroskaSplitter23062013.exe . Double-click the .exe and it will install.

Here's the entire script, including the two "LoadCplugin" lines you'll need:

Code:
# #=== Avisynth plugins used:
#- requires Haali Media Splitter: http://www.videohelp.com/tools/Haali-Media-Splitter
#- ffms2.dll
#- ffms2.avsi
#- sRestore.avsi

SRestore()
If you still have a problem, something is missing from your system. If necessary, you can try manono's idea using DGDecode. Let us know.
26. I copied that entire script obviously replacing the directory to my video with what it is, but I am still getting avi import error on virtual dub. here is what my script looks like now.
27. Sorry here it is. but I will try the other method as well.
28. Hey ignore my last post, I was using the wrong virtual dub, for some reason it doesnt work on recent virtual dub but does on the older versions. manono I am using your method, and to this point I have succesfully loaded the video file into virtual dub! I am now reading the rest of the guide.
29. manono I have managed to load the file into virtual dub but now that its in there I am a bit at lost as to what to do next? The guide doesn't tell me what to do once I have the video in virtual dub
30. Ok here's where i am. I have attached the script that I am using and the error message. I am missing something. I get the same error message with virtual dub.