VideoHelp Forum




+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 42
  1. 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.
    Quote Quote  
  2. Banned
    Join Date
    Oct 2004
    Location
    Freedonia
    Search Comp PM
    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.
    Quote Quote  
  3. Originally Posted by pub View Post
    I don't know a lot about avisynth so those replies didn't help me much.
    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.
    Because none of what you did can fix your problem. Handbrake can do nothing about NTSC->PAL ghosting because it doesn't use AviSynth.

    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.
    Quote Quote  
  4. Thanks for your replies. I have multiple boxsets but the ones that have the most visible blending are the Futurama ones.
    I've included 3 attachments, original.mkv is from the dvd, 23.976fps.mkv is the output from tsmuxer and output.mkv is the output from handbrake.
    Image Attached Files
    Quote Quote  
  5. 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()
    Image Attached Files
    Quote Quote  
  6. 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()
    Quote Quote  
  7. Originally Posted by pub View Post
    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.
    Quote Quote  
  8. 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()
    But the output file is over 30GB. Is this normal or is this a problem with VirtualDub?
    Quote Quote  
  9. The output of AviSynth is always uncompressed frames. You need to compress the video with an encoder or editor.
    Quote Quote  
  10. 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
    That doesn't happen, instead of becoming 750x564 and in the correct aspect ratio, it becomes 702x564. If I use the Strict option and fill in the pixels needed to crop in Handbrake it get's the right size, but I can't open an AVS file with Handbrake
    Quote Quote  
  11. The video has a 12:11 SAR. Add "--sar=12:11" to your command line.
    Quote Quote  
  12. Doesn't work, image gets wider then normal.


    Original screencap, right aspect ratio


    After Handbrake encoding screencap, right aspect ratio


    After commandline encoding screencap, wrong aspect ratio
    Quote Quote  
  13. 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.
    Quote Quote  
  14. Originally Posted by pub View Post
    ...but I can't open an AVS file with Handbrake
    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
    Quote Quote  
  15. 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?
    Quote Quote  
  16. 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.
    Quote Quote  
  17. Banned
    Join Date
    Oct 2004
    Location
    Freedonia
    Search Comp PM
    Originally Posted by pub View Post
    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?
    It's possible. This should do it

    crop(0,6,0,-6)

    Xvid4PSP can read AviSynth scripts and I personally prefer using to Handbrake. You should find a guide online as it's not very intuitive (in my opinion) but it's not terribly complicated once you get the hang of using it.
    Quote Quote  
  18. 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.
    Quote Quote  
  19. 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()
    CMD:
    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
    Is this correct? The output looks OK but I want to be sure because if I did something wrong I might be doing it wrong in the future.
    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?
    Quote Quote  
  20. Originally Posted by pub View Post
    -slowdown -384
    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.
    Quote Quote  
  21. You could do the cropping in AviSynth instead of x264. Crop(8,6,-8,-6).
    Quote Quote  
  22. @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.
    Quote Quote  
  23. Originally Posted by pub View Post
    @manono My commandline output is 22:35 at 23.976FPS. The original is 21:40 at 25FPS
    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?
    The question doesn't make any sense as another name for interlacing is combing. After using QTGMC or any bobber, there will be no interlacing remaining. If you're using 'Decomb' in the bastard Handbrake sense, then no, QTGMC isn't a single-rate deinterlacer. It's a double-rate deinterlacer, just like Yadif(Mode=1), except better. Handbrake's Decomb uses Yadif in single-rate mode and it has nothing as good as several AviSynth deinterlacers.

    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.
    Quote Quote  
  24. 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)
    CMD:
    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
    TSMuxer: 25fps to 23.976fps


    Thanks for everyones help
    Image Attached Files
    Quote Quote  
  25. 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.
    Quote Quote  
  26. Sorry, double post.
    Quote Quote  
  27. You can use TFM() to double frame rate decomb:

    Code:
    Interleave(TFM(field=1),TFM(field=0))
    Quote Quote  
  28. Originally Posted by manono View Post
    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?
    I wanted to get rid of the 4% speedup done by the NTSC->PAL conversion. If I didn't use tsmuxer and removed frate=25 I would get an 23.976fps output with the 4% speedup. That 4% speedup is annoying if you used to watch the episodes in NTSC format
    Quote Quote  
  29. Member Skiller's Avatar
    Join Date
    Oct 2013
    Location
    Germany
    Search PM
    Originally Posted by pub View Post
    I wanted to get rid of the 4% speedup done by the NTSC->PAL conversion.
    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.
    Quote Quote  
  30. 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.
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!