VideoHelp Forum




+ Reply to Thread
Results 1 to 28 of 28
  1. I have a 720 x 480 NTSC video I need to convert to PAL 720 x 576. I tried this script but the resulting video has jerky playback:

    Code:
    MPEG2Source("I:\1\Part 2 NTSC.d2v")
    DeGrainMedian(limitY=2, limitUV=3, mode=1, interlaced=true)
    Crop(0,12,-0,-12)
    AddBorders(0, 12, 0, 12)
    ConvertToYUY2(interlaced=true)
    LeakKernelBob(order=0,sharp=true).AssumeFrameBased()
    LanczosResize(720,576)
    ConvertFPS(50.00)
    SeparateFields()
    SelectEvery(4,0,3)
    Weave()
    converttoyv12(interlaced=true)
    Any suggestions on what is the best and fastest script for the job?
    Last edited by VideoFanatic; 11th Jun 2012 at 18:38.
    Quote Quote  
  2. Originally Posted by holygamer View Post
    Any suggestions on what is the best and fastest script for the job?
    No one can guess. Upload a short 10 second sample from the source, one with steady movement. One thing I, for one, would never do is to purposely blend something using ConvertFPS. But if it's really video (as opposed to film), there is no perfect conversion from NTSC to PAL. All have their drawbacks.

    Also, if the jerky playback is due to a wrong field order somewhere (you didn't say how you encoded it for MPEG-2), then that could easily explain it. Is it really, really, jerky? Maybe a short sample from the finished product could also be useful.
    Quote Quote  
  3. Sorry I just assumed there was a standard method for converting 720 x 480 NTSC to 720 x 576 PAL, that's why I never provided a video!?

    The video I want to convert is from a VHS-to-DVD conversion. I don't have the VHS tape, just the DVD. I just demuxed the 720 x 480 interlaced NTSC MPEG2 from the DVD. Here's that MPEG2: https://dl.dropbox.com/u/57941257/NTSC%20Smooth%20Clip.mpg

    Normally I just use a player that can play NTSC and PAL. However my PAL video was missing a part I needed to copy from the NTSC video. That's why I need to convert the NTSC part to PAL.

    Here's a short Bluray sample ISO which contains the NTSC MPEG2 original file and the NTSC to PAL conversion as a h264 .ts file.

    https://dl.dropbox.com/u/57941257/NTSC%20to%20PAL.iso

    The conversion has a visual problem I don't know how to describe. You only see it when watching the Bluray on your TV. I am just looking for suggestions on the best way to convert NTSC to PAL with Avisynth. I don't mind what script is used.
    Last edited by VideoFanatic; 11th Jun 2012 at 21:33.
    Quote Quote  
  4. Your source is top field first but you're using "LeakKernelBob(order=0..."
    Quote Quote  
  5. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Here is a very quick'ndirty conversion to PAL.

    I did not write this script. It was prepared by the program I used to do the conversion.

    AVISYNTH SCRIPT
    Import("C:\Program Files\AVStoDVD\Lib\A2DSource.avsi")
    LoadPlugin("C:\Program Files\AVStoDVD\DGIndex\DGDecode.dll")
    LoadPlugin("C:\Program Files\AVStoDVD\Lib\LeakKernelDeint.dll")
    Video = MPEG2Source("C:\......\NTSC Smooth Clip.d2v")
    # Audio is frameserved by AviSynth just for Preview and Edit purposes.
    Audio = A2DAudioSource("C:\...\NTSC Smooth Clip T80 2_0ch 256Kbps DELAY 0ms.ac3", CacheFolder="C:\DOCUME~1\.....\LOCALS~1\Temp")
    Video = Video.ConvertToYV12(interlaced=true)
    Video = Video.ChangeFPS("pal_video")
    Video = Video.LeakKernelBob(1,7,false,false)
    Video = Video.Lanczos4Resize(720,576)
    Video = Video.SeparateFields().SelectEvery(4,1,2).Weave()
    Image Attached Files
    Last edited by DB83; 12th Jun 2012 at 05:04.
    Quote Quote  
  6. Jagabo, I just found that script, I've no idea what I'm doing! If you know of a better script for converting NTSC to PAL, please tell me. I don't mind what plugin is used.

    DB83 you said "Here is a very quick'ndirty conversion to PAL" but you didn't post anything!
    Quote Quote  
  7. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by holygamer View Post
    Jagabo, I just found that script, I've no idea what I'm doing! If you know of a better script, please tell me.

    DB83 you said "Here is a very quick'ndirty conversion to PAL" but you didn't post anything!
    It is there now. The upload of the attatment failed first time.

    Also added a script
    Quote Quote  
  8. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by jagabo View Post
    Your source is top field first but you're using "LeakKernelBob(order=0..."
    Yes, you should use order=1.
    In addition to that, your final re-interlacing is done as bottom field first. To maintain the original field order, add AssumeTFF() before SeparateFields().
    (Also, the call to AssumeFrameBased() is redundant as LeakKernelBob delivers a frame-based (and BFF-assumed) result.)
    Last edited by Gavino; 12th Jun 2012 at 05:14.
    Quote Quote  
  9. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by DB83 View Post
    ...
    Video = Video.ChangeFPS("pal_video")
    Video = Video.LeakKernelBob(1,7,false,false)
    ...
    A smoother result will be obtained by bobbing before changing the frame rate:
    Video = Video.LeakKernelBob(1,7,false,false)
    Video = Video.ChangeFPS("pal_double")
    Quote Quote  
  10. For interlaced video:

    Code:
    Mpeg2Source("filenmae.d2v") 
    AssumeTFF() # or AssumeBFF() depending on the source
    
    # deinterlace
    QTGMC()
    # or Yadif(mode=1, order=0 or 1), 0=bff, 1=tff
    
    # resize to PAL frame size
    LanczosResize(720,576)
    # or whichever resizer you want, BilinearResize(), Spline16Resize(), etc.
    
    # change frame rate to PAL frame rate, blending
    ConvertFPS(50.00)
    # you can also use ChangeFPS() for no blending
    # or motion interpolation with mv_tools, SmoothFPS()
    # https://forum.videohelp.com/threads/345077-30fps-24fps-WITHOUT-pulldown?p=2152668&viewf...=1#post2152668
    
    # re-interlace
    AssumeTFF() # or AssumeBFF(), whichever you want the output to be
    SeparateFields()
    SelectEvery(4,0,3)
    Weave()
    Quote Quote  
  11. OP did ask "best" script, is it better to use MVTools? - eg:

    Code:
    QTGMC(SubPel=2) 
    super=MSuper(levels=1, pel=2) 
    MFlowFps(super, QTGMC_bVec1, QTGMC_fVec1, num=50, den=1
    Spline36Resize(720,576)
    AssumeBFF()
    SeparateFields()
    SelectEvery(4,0,3)
    weave()
    Does this work better? (I don't know, am just wondering, as I need to do a NTSC-to-PAL conversion also).
    Quote Quote  
  12. Motion interpolation can generate unsightly artifacts. For example: https://forum.videohelp.com/threads/339017-Motion-Interpolation-%28VidFIRE%29-Software?...=1#post2107214 You'll have to try it on your video to see if it's acceptable.
    Quote Quote  
  13. Jagabo I used the following script you suggested which works perfectly but it's quite slow. For future use I would like to see if I can find a faster script.
    Code:
      MPEG2Source("I:\Part 2 NTSC.d2v")
      Crop(4,12,-8,-12)
      Tweak(Bright=0, Sat=0.7, Cont=1.0, Hue=10.0, Coring=False)
      AddBorders(6, 12,  6, 12)
      AssumeTFF()
       
      # deinterlace
      QTGMC()
       
      # resize to PAL frame size
      Lanczos4Resize(720,576)
       
      # change frame rate to PAL frame rate, blending
      ConvertFPS(50.00)
       
      # re-interlace
      AssumeTFF() # or AssumeBFF(), whichever you want the output to be
      SeparateFields()
      SelectEvery(4,0,3)
      Weave()
    I tried using Yadif instead which is much faster. There are no negative effects apart from the picture quality which seems slightly lower than before. Is there any other script you could suggest that's gives good quality but is fast?
    Code:
      MPEG2Source("I:\Part 2 NTSC.d2v")
      Crop(0,12,-0,-12)
      Tweak(Bright=0, Sat=0.7, Cont=1.0, Hue=10.0, Coring=False)
      AddBorders(0, 12, 0, 12)
      AssumeTFF() 
       
      # deinterlace
      Load_Stdcall_plugin("C:\Program Files\AviSynth 2.5\plugins\yadif.dll")
      Yadif(mode=1, order=1)
       
      # resize to PAL frame size
      Lanczos4Resize(720,576)
       
      # change frame rate to PAL frame rate, blending
      ConvertFPS(50.00)
       
      # re-interlace
      AssumeTFF() 
      SeparateFields()
      SelectEvery(4,0,3)
      Weave()
    Quote Quote  
  14. From the QTGMC doc (which you can easily read yourself):
    "Placebo", "Very Slow", "Slower", "Slow", "Medium", "Fast", "Faster", "Very Fast", "Super Fast", "Ultra Fast", "Draft"
    The default preset is "Slower". Don't be obsessed with using slower settings, the differences can be small.
    While Yadif is maybe the fastest decent bob deinterlacer, you can get faster results (faster than the default 'Slower' setting in QTGMC, if slower than using Yadif), by trying a faster setting in QTGMC, one like:

    QTGMC(Preset="Faster")
    Quote Quote  
  15. Originally Posted by chowmein View Post
    OP did ask "best" script, is it better to use MVTools? - eg:

    Code:
    QTGMC(SubPel=2) 
    super=MSuper(levels=1, pel=2) 
    MFlowFps(super, QTGMC_bVec1, QTGMC_fVec1, num=50, den=1
    Spline36Resize(720,576)
    AssumeBFF()
    SeparateFields()
    SelectEvery(4,0,3)
    weave()
    Does this work better? (I don't know, am just wondering, as I need to do a NTSC-to-PAL conversion also).
    I tried that but it's far too slow. Is there anything faster than QTGMC(Preset="Ultra Fast") which looks just as good? The speed of Ultra Fast is about 4 frames per second.

    LeakKernalBob doesn't look as good as QTGMC(Preset="Ultra Fast").
    Last edited by VideoFanatic; 14th Jun 2012 at 04:00.
    Quote Quote  
  16. Geez, what do you want? Buy a faster computer, be satisfied with sub-par results, or let it run all night. The best bob deinterlacers take time. Since you're converting to PAL DVD, make an intermediate lossless AVI and then run that through your MPEG-2 encoder. That way the slow script runs only once, instead of multiple times.
    Quote Quote  
  17. I'm just looking to see if there's a faster script that's all. I'd be a fool to use a slow script if there's a faster one available.

    Could you please explain that further? How do I make an intermediate lossless AVI?

    What do you mean by "that way the slow script runs only once, instead of multiple times"? My script is only running once so I don't know what you mean by that. If I did all that how would it be any faster? The computer I have is already fast but the script is slow.

    I'm encoding h264 not MPEG2.
    Last edited by VideoFanatic; 14th Jun 2012 at 04:29.
    Quote Quote  
  18. Originally Posted by holygamer View Post
    I'm encoding h264 not MPEG2.
    Originally Posted by holygamer View Post
    I have a 720 x 480 NTSC video I need to convert to PAL 720 x 576.
    I took that to mean you're making a PAL DVD. If it's not for DVD then forget my suggestion. As for other bobbers, you'll find a number of them in this list:

    http://avisynth.org/mediawiki/External_filters#Deinterlacing
    Quote Quote  
  19. If you're not making a DVD there's no reason to convert the frame size to 720x576 (loss of quality). There's also probably no reason to convert the frame rate (loss of quality). Most players will play a wide range of frame rates. Lastly, there's probably no reason to re-interlace the video at the end (loss of quality). You need to find out exactly what your player supports and convert accordingly.

    You may be able to reduce your script to:

    Code:
    MPEG2Source("I:\Part 2 NTSC.d2v")
    Crop(4,12,-8,-12)
    Tweak(Bright=0, Sat=0.7, Cont=1.0, Hue=10.0, Coring=False)
    AddBorders(6, 12,  6, 12)
    AssumeTFF()
       
    # deinterlace
    QTGMC(preset="very fast") #or other option
    It may not be necessary to add borders back, depending on your encoder and your player.
    Last edited by jagabo; 14th Jun 2012 at 07:07.
    Quote Quote  
  20. I already said in my 3rd post that I have an episode which is PAL 720 x 576. A part of the episode is missing which I have taken from the NTSC episode and converted to PAL and added to the PAL video as I can't have multiple resolutions inside the same video which also applies to the framerate. I want to keep the PAL episode video as the NTSC episode was of a lower quality visually.

    I was only adding borders because I cropped the garbage off all sides which you can't see anyway when viewing in 1080i and after pressing the aspect ratio button on your remote to zoom in about in inch. Bluray only supports a minimum resolution of 720 x 480 or 720 x 576 so I need to add borders if I'm cropping.

    From what I've been told and from what I've seen before, converting to progressive gives a worse picture quality than keeping it interlaced.

    In case I have whole NTSC videos in future that I'm adding to a disc which has PAL videos - I thought that most Bluray players support NTSC or PAL, not both unless you buy a multi-region player? I know my home made discs aren't region coded but I assume a multi-region Bluray player would play NTSC and PAL?
    Last edited by VideoFanatic; 14th Jun 2012 at 10:43.
    Quote Quote  
  21. If you have a multicore computer you can speed up QTGMC() by enabling multithreading in AviSynth.

    Code:
    SetMtMode(5, 6) # Mpeg2Source() requires mode 5
    Mpeg2Source("filename.d2v")
    SetMtMode(2) # QTGMC works with mode 2
    AssumeTFF()
    QTGMC()
    You'll need a multithreaded build of AviSynth. For example, on my 4 core i5 2500K, with QTGMC() at its default settings, encoding with x264 at the "ultrafast" preset (minimize encoding time so we are looking mostly at QTGMC speed), I get about 11 fps with one thread, 35 fps with six threads. With QTGMC(preset="ultra fast") I get about 78 fps with one thread, 185 with six threads
    Last edited by jagabo; 14th Jun 2012 at 11:47.
    Quote Quote  
  22. I thought about downloading a mutli-threaded supported version before but I thought it was still in beta or something and that not all scripts in the normal version of Avisynth work with it? So does the normal version not make use of a dual core PC then or does it only use 1 core?
    Quote Quote  
  23. Originally Posted by holygamer View Post
    I thought about downloading a mutli-threaded supported version before but I thought it was still in beta or something and that not all scripts in the normal version of Avisynth work with it? So does the normal version not make use of a dual core PC then or does it only use 1 core?
    The regular build only uses only one thread, one core. The multithreaded builds are betas but they're pretty stable. Not all filters work properly in multithreaded mode. With those you can just limit your processing to a single thread (don't use SetMtMode() at all) or use one of the "safer" modes for those filters -- like I did for Mpeg2Source().
    Quote Quote  
  24. Thanks for your help. I think I should create a dedicated thread for this topic HERE. If you can help with that, please do.
    Quote Quote  
  25. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by holygamer View Post
    Here's a short Bluray sample ISO which contains the NTSC MPEG2 original file and the NTSC to PAL conversion as a h264 .ts file.

    https://dl.dropbox.com/u/57941257/NTSC%20to%20PAL.iso

    The conversion has a visual problem I don't know how to describe. You only see it when watching the Bluray on your TV. I am just looking for suggestions on the best way to convert NTSC to PAL with Avisynth. I don't mind what script is used.
    I'll post this here rather in your other topic.

    I do not have a BD-burner and I hardly expect anyone to actually burn a disk from this iso to test it.

    But I did take a quick look at the stream contents. AFAIK your h264 file is NOT BD compatable. It is not even SD compatable for a BD disk. That could well explain your playback issues.

    But why even attempt to make a BD disk. The original (VHS) to dvd is quite low quality. Make a dvd. Surely your blu-ray player can handle that.
    Quote Quote  
  26. I put both a NTSC and PAL clip on the same disc so you could test it and I forgot that when I make the disc you have to select if you want the whole disc to be NTSC or PAL. So the disc is now NTSC or PAL, I can't remember which. Is that the problem you're referring to? My non-test Blurays will be all PAL or NTSC.

    I'm making a Bluray because I can get up to half the file size of MPEG2 in the same quality by using h264 and I can fit more episodes on a disc. MPEG2 only supports a max bitrate of 9800. In the tests I've done I can get better quality than that by using h264 at half that bitrate.
    Quote Quote  
  27. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    The AVC file is PAL 720*576 25fps ac3 audio
    The mpeg2 is NTSC 720*480 29.97i ac3 audio

    If I read the BD specs correctly, neither of these fit.

    What you appear to be attempting is the BD equivilent of a data disk - just a batch of videos. Would you need the BD-overhead (folders etc) for that ?

    Your bitrate arguement does not stand up since the source files are not anywhere near the max. You do not get any better quality if you attempt to re-encode a 4000 kbps file at a higher rate.
    Quote Quote  
  28. You're clearly wrong. Why wouldn't Bluray support standard definition PAL or NTSC? I've made several Blurays of both and given them to friends of mine and they play fine on their Bluray players.

    I've no idea what you're talking about bd-overhead folders and so on. I use multiAVCHD and it produces a BDMV and Certificate folder. That's what Blurays have. If I used TsMuxer to make a Bluray, it would do the same thing.

    I'm not debating the issue about bitrates with you - what I told you is fact from what I've observed. In the tests I did with a low bitrate 4 to 4.7 Mbps MPEG2 which had blocking and picture noise, I fixed those problems with Avisynth and made an MPEG2 and I found that I had to use a 9.8 Mbps bitrate to get the best quality. 8 Mbps had a bit of blurrying, 9 Mbps was acceptable but still had a tiny bit of noise and pixellation, 9.8 Mbps had virtually no problems at all.

    If I wanted the same or better quality with h264 I could use half the bitrate of 9.8 Mbps. So yes I do get better quality by encoding at a higher bitrate. The underlying picture quality may still be the same but the compression artefacts and noise is removed so it looks much better.

    Anyway this thread has already been solved. I am now able to convert NTSC to PAL without any negative effects.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!