VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Member nbarzgar's Avatar
    Join Date
    Sep 2004
    Location
    Austria
    Search Comp PM
    Hello All,

    I've tried converting a DVD of an old movie I own using Avisynth and filters.

    The original DVD plays at 29.97 fps, already jerky on my standalone Blu-Ray player (recent Sony) as well as on my Windows 10 computer (2,6 Ghz CPU, 8GB RAM, Nvidia Geforce GT 1030 graphics).

    I know that the mpeg2 stream is reported as being progressive, but my impression was when loading via DGIndex and Avisynth into VirdtualDubMod that separating fields had an effect...so it seems to be interlaced...? Hybrid?
    (Find MediaInfo report of .VOB below)

    I saved it to my HDD and thought, filtering (determining field order, tried Telecide, SeparateFields and Select..., deinterlacing with Kerneldeint: mapping on to determine threshold) so far to no avail.
    I also did some research but din't find any more helpful posts or ideas.

    I attach a sample clip to this post and hope someone here can help me figure out what's going on.

    Is it hopeless because the transfer or the DVD production process are at fault?

    Thanks for any help in advance!

    BR
    nbarzgar
    Code:
    General
    Complete name                            : D:\Video\DVD\Omar Khayyam\video_ts\VTS_01_1.VOB
    Format                                   : MPEG-PS
    File size                                : 1 024 MiB
    Duration                                 : 26 min 0 s
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 5 506 kb/s
    
    Video
    ID                                       : 224 (0xE0)
    Format                                   : MPEG Video
    Format version                           : Version 2
    Format profile                           : Main@Main
    Format settings                          : BVOP
    Format settings, BVOP                    : Yes
    Format settings, Matrix                  : Default
    Format settings, GOP                     : M=3, N=15
    Duration                                 : 26 min 0 s
    Bit rate mode                            : Variable
    Bit rate                                 : 5 013 kb/s
    Maximum bit rate                         : 9 000 kb/s
    Width                                    : 720 pixels
    Height                                   : 576 pixels
    Display aspect ratio                     : 4:3
    Frame rate                               : 25.000 FPS
    Standard                                 : PAL
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Compression mode                         : Lossy
    Bits/(Pixel*Frame)                       : 0.483
    Time code of first frame                 : 00:00:00:00
    Time code source                         : Group of pictures header
    GOP, Open/Closed                         : Open
    GOP, Open/Closed of first frame          : Closed
    Stream size                              : 932 MiB (91%)
    
    Audio #1
    ID                                       : 189 (0xBD)-128 (0x80)
    Format                                   : AC-3
    Format/Info                              : Audio Coding 3
    Muxing mode                              : DVD-Video
    Duration                                 : 25 min 59 s
    Bit rate mode                            : Constant
    Bit rate                                 : 192 kb/s
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Sampling rate                            : 48.0 kHz
    Frame rate                               : 31.250 FPS (1536 SPF)
    Bit depth                                : 16 bits
    Compression mode                         : Lossy
    Stream size                              : 35.7 MiB (3%)
    Service kind                             : Complete Main
    
    Audio #2
    ID                                       : 189 (0xBD)-129 (0x81)
    Format                                   : AC-3
    Format/Info                              : Audio Coding 3
    Muxing mode                              : DVD-Video
    Duration                                 : 25 min 59 s
    Bit rate mode                            : Constant
    Bit rate                                 : 192 kb/s
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Sampling rate                            : 48.0 kHz
    Frame rate                               : 31.250 FPS (1536 SPF)
    Bit depth                                : 16 bits
    Compression mode                         : Lossy
    Stream size                              : 35.7 MiB (3%)
    Service kind                             : Complete Main
    
    Menu
    Image Attached Files
    Last edited by nbarzgar; 27th Apr 2019 at 08:14. Reason: corr lang
    Quote Quote  
  2. That clip has both missing frames and duplicate frames. And there is no consistent pattern to take advantage of. It's going to be very difficult to fix.
    Quote Quote  
  3. Member nbarzgar's Avatar
    Join Date
    Sep 2004
    Location
    Austria
    Search Comp PM
    Originally Posted by jagabo View Post
    That clip has both missing frames and duplicate frames. And there is no consistent pattern to take advantage of. It's going to be very difficult to fix.

    Thanks for the hint.
    Any ideas how I could proceed?
    Quote Quote  
  4. Some duplicate frames are simply duplicates. Those can be removed with DeleteFrame().

    Other duplicates are there taking the place of a missing frame, ie instead of 1 2 3 4 5 you have 1 2 2 4 5. The second of the duplicates can replaced with motion interpolated between the surrounding frames. I created a function called ReplaceFramesMC() that does that. It was based on a function originally called RX().

    In places where there are missing frames you can use InsertFramesMC() (also based on the filter originally called RX()) to create a new frame with motion interpolated between the frame before and the frame after.

    Code:
    ######################################################
    [
    function ReplaceFramesMC(clip Source, int N, int "X")
    {
      # N is number of the 1st frame in Source that needs replacing. 
      # X is total number of frames to replace
      #e.g. ReplaceFramesMC(101, 5) would replace 101,102,103,104,105 , by using 100 and 106 as reference points for mflowfps interpolation
     
      X = Default(X, 1)
    
      start=Source.trim(N-1,-1) #one good frame before, used for interpolation reference point
      end=Source.trim(N+X,-1) #one good frame after, used for interpolation reference point
     
      start+end
      AssumeFPS(1) #temporarily FPS=1 to use mflowfps
      
      super = MSuper(pel=2, hpad=0, vpad=0, rfilter=4)
      backward_1 = MAnalyse(super, chroma=false, isb=true, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24))
      forward_1 = MAnalyse(super, chroma=false, isb=false, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24))
      backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=8, searchparam=1, search=3)
      forward_2 = MRecalculate(super, chroma=false, forward_1, blksize=8, searchparam=1, search=3)
      backward_3 = MRecalculate(super, chroma=false, backward_2, blksize=4, searchparam=0, search=3)
      forward_3 = MRecalculate(super, chroma=false, forward_2, blksize=4, searchparam=0, search=3)
      MBlockFps(super, backward_3, forward_3, num=X+1, den=1, mode=0)
    
      AssumeFPS(FrameRate(Source)) #return back to normal source framerate for joining
      Trim(1, framecount-1) #trim ends, leaving replacement frames
      
      Source.trim(0,-N) ++ last ++ Source.trim(N+X+1,0)
    }
    
    
    ######################################################
    #
    # Insert missing frames
    #
    ######################################################
    
    function InsertFramesMC(clip Source, int N, int "X")
    {
      # Insert X motion interpolated frames at N
      # N is the insertion point
      # X is the number of frames to insert
      # the frames will be interpolated with Source frames N-1 and N as references
    
      X = Default(X, 1)
    
      loop(Source, X+1, N, N)
      ReplaceFramesMC(N, X)
    }
    
    ######################################################

    A short example from your clip:

    Code:
    import("C:\Program Files (x86)\AviSynth\plugins\ReplaceFramesMC.avs") 
    
    Mpeg2Source("Test2.d2v", CPU2="ooooxx", Info=3) 
    
    Trim(1250,1299) # just a short section with constant motion
    ShowFrameNumber(x=20, y=20)
    src = last
    
    DeleteFrame(1)
    InsertFramesMC(3)
    DeleteFrame(5)
    ReplaceFramesMC(17)
    DeleteFrame(21)
    InsertFramesMC(22)
    DeleteFrame(25)
    InsertFramesMC(27)
    DeleteFrame(29)
    ReplaceFramesMC(41)
    DeleteFrame(45)
    InsertFramesMC(46)
    
    StackHorizontal(src,last)
    But that means you must go through the video frame by frame to locate the duplicate and missing frames. It's will take eons.

    Note that the new video contains two fewer frames after 50 frames. I suspect that's because the real underlying frame rate is 24 fps.
    Image Attached Files
    Quote Quote  
  5. Member nbarzgar's Avatar
    Join Date
    Sep 2004
    Location
    Austria
    Search Comp PM
    Originally Posted by jagabo View Post
    Some duplicate frames are simply duplicates. Those can be removed with DeleteFrame().

    Other duplicates are there taking the place of a missing frame, ie instead of 1 2 3 4 5 you have 1 2 2 4 5. The second of the duplicates can replaced with motion interpolated between the surrounding frames. I created a function called ReplaceFramesMC() that does that. It was based on a function originally called RX().

    In places where there are missing frames you can use InsertFramesMC() (also based on the filter originally called RX()) to create a new frame with motion interpolated between the frame before and the frame after.

    (...)

    But that means you must go through the video frame by frame to locate the duplicate and missing frames. It's will take eons.

    Note that the new video contains two fewer frames after 50 frames. I suspect that's because the real underlying frame rate is 24 fps.
    Hello @jagabo,
    awesome, I thank you so much for your time and trouble!
    I will review this at leisure.
    BR
    nbarzgar
    Quote Quote  



Similar Threads