I have a dvd boxset I would like to make playable on my android tablet, so I need a mkv/mp4 output. It is an (partially) interlaced PAL 4:3 DVD. The source was converted to pal, but I'm not sure if it's from 23.976 or 29.97fps. It looks like I have the same problem as the people with PAL DVD boxes from shows as Futurama and Family Guy. I don't know a lot about avisynth so those replies didn't help me much.
I did the following things:
1. Use makemkv to create a mkv file
2. Use tsmuxergui to slowdown the fps from 25 to 23.976 (eac3to for audio)
3. Use handbrake to remove the interlacing (decomb bob, crf 16, variable framerate, preset slower, crop and anamorphic strict
I still have some ghosting/blended fields in my output. Is there any way I could fix this? If I skip step 2 or use a constant frame rate, the same problem happens.
+ Reply to Thread
Results 1 to 30 of 42
-
-
You should probably tell what the DVDs are of because if it's anime or animation, your ability to fix this may be limited even with AviSynth, and yes, you're going to have to use that to fix it. Unfortunately in PAL land it's not impossible to have 23.976 sources -> 29.97 for NTSC DVD -> 25 for PAL DVD and you may not really be able to undo that kind of damage. Animation/anime is even crazier with different sections coming from different frame rate sources in some cases. Sometimes even our most experienced members can't undo the damage in the final product. If we knew what this was, it would be useful because some of our members may be specifically familiar with the source video and how it was converted to PAL DVD.
You might post a very short (10-20 seconds) excerpt from one of your videos that is giving you problems and our AviSynth experts will likely be willing to help you with it. Having a sample will give them an idea of what can realistically be done. Pick a section that's giving you ghosting for the sample. I tried to avoid using AviSynth in the past and I had no choice but to struggle with using it. I can do simple operations that meet my rather limited needs and now I'm glad I know how to use it, even if I don't use it in the very complex ways that some do. -
Then you can forget about getting rid of the blending.
3. Use handbrake to remove the interlacing (decomb bob, crf 16, variable framerate, preset slower, crop and anamorphic strict
I still have some ghosting/blended fields in my output.
As jman98 suggested, post a short 10 second or so sample, one with steady movement. Then maybe you can get an AviSynth script to unblend it. Or maybe it can't be fixed at all. Depends on how the conversion was made. -
That's the usual NTSC->PAL with field blending. You can get rid of most of the blending with:
Code:Yadif(mode=1) # or some other double frame rate field matcher SRestore()
-
I've installed avisynth. What program should I use to open/run the avs script? VirtualDub says "There is no function named Yadif"
My AVS script looks like this:
Code:DirectShowSource("D:\tst\title04_track1_eng.mpg") Yadif(mode=1) # or some other double frame rate field matcher SRestore()
-
Yadif is a third-party filter - it's not built into AviSynth. You need to first get it:
http://www.avisynth.nl/users/warpenterprises/
Then put it into your AviSynth 'Plugins' folder. And it has to be loaded into the script as a 'C' Plugin:
LoadCPlugin("C:\Path\To\Yadif.dll")
DirectShowSource("D:\tst\title04_track1_eng.mpg")
Yadif(mode=1) # or some other double frame rate field matcher
SRestore()[/code]
You also have to get SRestore:
http://avisynth.nl/index.php/Srestore
And you'd be better off not using DirectShowSource but MPEG2Source together with DGDecode.dll. Its use is explained in tutorials included in the DGMPGDec package. -
It looks like it works with this script
Code:LoadCPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\yadif\yadif.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\masktools2-25.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\dgmpgdec158\DGDecode.dll") MPEG2Source("D:\tst\title04_track1_eng.d2v") Yadif(mode=1) # or some other double frame rate field matcher SRestore()
-
I use the following command line, but I want keep the original aspect ratio while I crop a few pixels on each side
Code:x264.exe --profile high --preset slower --level 3.1 --crf 16 --tune animation --video-filter crop:10,6,8,6 --output output.mkv test.avs
-
No, your original screencap aspect ratio and the Handbrake aspect ratios are wrong. You obviously have a 704x576 ITU cap padded to 720x576. The 704x576 frame contains the 4:3 DAR image with a SAR of 12:11. You should not be cropping 6 lines off the top and bottom. 704:576 x 12:11 = 4:3.
Actaully, to be even more precise it's a 4:3 cap in a 702x576 frame with a 128:117 SAR. 702x576 * 128:117 = 4:3. But the 704 pixel wide frame is usually used because it's mod 16.
Handbrake is assuming the 4:3 is in the entire 720x576 frame. Which is technically accurate by the DVD/MPEG2 specification. But this video was captured by a capture device that uses the ITU spec and the video was converted to DVD MPEG 2 without regard to the DVD/MPEG2 spec.Last edited by jagabo; 16th Oct 2014 at 17:04.
-
I already mentioned it doesn't use AviSynth. And since there's no way at all to get it properly unblended if you're using Handbrake, then the obvious answer is to use an encoder that accepts AviSynth scripts as input. I use RipBot264 but there are others. You could also crop and resize in the script, something like:
Crop(10,6,-8-,6)#like jagabo, I wonder about the top and bottom crops
LanczosResize(640,480)#just an example -
Ah, like that. But I still would like to remove 6 lines from the top and the bottom because of the flickering, any suggestion on how I should do that, or is it impossible?
-
Cropping does not change the SAR of the remaining pixels. So no matter what you crop the remaining pixels have a SAR of 12:11, or 128:117 if you prefer.
-
-
Yes, Xvid4PSP is another, but only the 5.0 versions allow for editing a script once it's been accepted (I think), and the 7.0 versions are known to be buggy (he says, having never tried one himself, but only read it). I mentioned RipBot264 because it is easier for a beginner to use, in my opinion, but if you want to add things to the command line (like a SAR), it's also easily done.
-
I'll stick to the commandline x264. I've also looked up the difference between the PAL and NTSC version and the PAL version has a slight stretch, but I'm not sure that's what jagabo meant (http://www.dvdbeaver.com/film/DVDCompare9/futurama.htm).
What I would like to have as output:
An anamorphic x264+ac3 mkv in 23.976fps without field-blending and without black and flickering edges (top&bottom and left&right) that doesn't look stretched/looks the same if I played it on my tv.
AVS:
Code:LoadCPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\yadif\yadif.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\masktools2-25.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\dgmpgdec158\DGDecode.dll") MPEG2Source("D:\tst\title04_23.976fps_track1_eng.d2v") Yadif(mode=1) # or some other double frame rate field matcher SRestore()
Code:x264.exe --profile high --preset slower --level 3.1 --crf 16 --tune animation --sar=12:11 --video-filter crop:8,6,8,6 --output output.mkv test.avs eac3to.exe title04.ac3 title04n.ac3 -slowdown -384
Also, my audio source is AC3 192kbps 2.0, should I stick to 192kbps after the slowdown or should I use something higher like 384kbps? -
Slowdown? I don't use the command line but why is anything being slowed down? By converting to PAL using field-blending the original 23.976fps length is retained. Neither the video nor the audio needs slowing. If you'll check the length of your script, it's the same as the source. If that command slows the audio, you're just making it out-of-synch.
Unless I misunderstand what that part of the command is really doing. And if you're converting the original 192 to 384, you're just wasting space, in my opinion. The audio quality won't improve. Me, I'd use 128. And if you really want the best possible results, QTGMC should be used as the bobber. But you'll have trouble getting it to work. And it's much slower than Yadif. How much slower depends on the settings used, but at the default setting it's way slower. -
@manono My commandline output is 22:35 at 23.976FPS. The original is 21:40 at 25FPS.
Also, could QTGMC also work as Decomber instead of Deinterlacer? Because not everything is interlaced (e.g. the entire intro). Time/CPU is not really an issue. -
Open before and after scripts in VDub and check File->File Information. The script as given above does not change the length. To check it before the filtering, open this in VDub and check:
LoadCPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\yadif\yadif.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\masktools2-25.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\dgmpgdec158\DGDecode.dll")
MPEG2Source("D:\tst\title04_23.976fps_track1_eng.d 2v")
Return Last
Yadif(mode=1) # or some other double frame rate field matcher
SRestore()
Th framerate before should be 25fps, after 23.976fps, in Vdub and the lengths identical or nearly so. Maybe that incorrect '- slowdown' line in your encoder did it. I already told you about that, just as I already told you how to crop in AviSynth.
Also, could QTGMC also work as Decomber instead of Deinterlacer?
Are you saying that first part isn't blended or somehow reacts differently to the unblending process than the rest of the episode? Once again, forget Handbrake for this kind of work (and for anything else as far as I'm concerned).Last edited by manono; 18th Oct 2014 at 19:00.
-
I think I did it right this time. My output is a perfect looking 23.976fps progressive video in the right aspect ratio without 4% speedup+high pitched audio and ghosting (see attachment).
AVS:
Code:LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\masktools2-25.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\dgmpgdec158\DGDecode.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\decomb\Decomb.dll") Import("C:\Program Files (x86)\AviSynth 2.5\plugins\QTGMC-3.32.avsi") MPEG2Source("D:\tst\title03_track1_eng.d2v") QTGMC( Preset="Slower" ) SRestore(frate=25) Crop(12,6,-10,-6)
Code:x264.exe --profile high --preset slower --level 3.1 --crf 16 --tune animation --sar=12:11 --output output.mkv test.avs eac3to.exe t3.ac3 t3n.ac3 -slowdown -192 -keepDialNorm
Thanks for everyones help -
Yes, the blending is gone and it plays smoothly. Except you didn't follow the script you gave:
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\masktools2-25.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\dgmpgdec158\DGDecode.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\decomb\Decomb.dll")
Import("C:\Program Files (x86)\AviSynth 2.5\plugins\QTGMC-3.32.avsi")
MPEG2Source("D:\tst\title03_track1_eng.d2v")
QTGMC( Preset="Slower" )
SRestore(frate=25)
Crop(12,6,-10,-6)
because the framerate isn't 25fps. Had you made it 25fps, there would have been blended and/or duplicate frames remaining.
Good going! At the beginning you didn't want to mess with AviSynth at all and now you're using some fairly difficult scripts.
Edit: Or, for some reason, you used TSMuxer to slow it to 23.976 after using the script you gave? Why?Last edited by manono; 18th Oct 2014 at 17:17.
-
You can use TFM() to double frame rate decomb:
Code:Interleave(TFM(field=1),TFM(field=0))
-
There is no speedup to get rid of! This is not a speedup film transfer (25p clean frames), it's a field blended normconversion. Such conversion does not affect the playback speed at all.
You should stick to manono's script and leave the audio as is because it's at the original speed already.Last edited by Skiller; 19th Oct 2014 at 07:13.
-
When removing field blending from an NTSC to PAL conversion SRestore() should leave you with 23.976 fps. If you set it to 25 fps you will be left with one blended frame, or at least one duplicate frame, every second. This can be hard to see with animated material since there are so many duplicate frames to start with. But look for a long panning shot -- there's usually motion between each frame in those. You'll probably see the duplicate/blended frame there.
When you do need to slow or speed up the frame rate for some reason you can use AssumeFPS() rather than encoding with the wrong frame rate then using TSMuxer to override that frame rate. For example AssumeFPS(24000,1001).Last edited by jagabo; 19th Oct 2014 at 07:22.