VideoHelp Forum




+ Reply to Thread
Results 1 to 15 of 15
  1. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    I've got an old VCR capture from a UK TV show (thus it was broadcast at 25 fps).

    The video is 29.97 fps.
    It has a timecode which shows the original frame numbers (confirming the original 25 fps ).

    I see the pattern of frames:
    1 2 3 3 4 5 6 7 8 8 9 10 11 12 13 13 ....

    i.e. every 5th frame is duplicated.

    I think that Decimate can do this, but I can't find an intelligible explanation of how to configure it.

    So I used Srestore
    Code:
    AssumeFPS(30,sync_audio=true)
    dclip=Crop(218, 26, -332, -398) # detection clip 
    srestore(frate=25, dclip=dclip)
    Which works, but the result gives a noticeable jerk about once a second.

    Is there a better way to do this?
    Last edited by AlanHK; 11th Jul 2013 at 04:38.
    Quote Quote  
  2. If you're using Decimate from Decomb, then the DecombReferenceManual says:

    Decimate(parameter_list)

    cycle (2-25, default 5) selects the decimation ratio, that is, decimate 1 frame in every cycle frames.
    So, your cycle is six.

    Or, using TDecimate from TIVTC:

    Tdecimate(Mode=0,Cycle=6,CycleR=1)

    And you'll get back 24.975fps from both, not 25fps.
    Quote Quote  
  3. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Thanks, I'll give it a try.
    I'm sure it works, but I'll have to render it to see if it's smooth.

    Originally Posted by manono View Post
    And you'll get back 24.975fps from both, not 25fps.
    I first did AssumeFPS(30,sync_audio=true) so I do get 25 after decimation.

    PS -- comparing the Srestore and Tdecimate output, Tdecimate seems to be doing a better job, Srestore drops some non-duplicate frames that Tdecimate keeps. And encoding now: TDecimate is more than twice as fast as Srestore.
    Of course, in more weird videos it can be a lifesaver.
    Last edited by AlanHK; 11th Jul 2013 at 07:49.
    Quote Quote  
  4. Member
    Join Date
    Jan 2006
    Location
    United States
    Search Comp PM
    Originally Posted by AlanHK View Post
    I've got an old VCR capture from a UK TV show (thus it was broadcast at 25 fps).

    The video is 29.97 fps.
    It has a timecode which shows the original frame numbers (confirming the original 25 fps ).

    I see the pattern of frames:
    1 2 3 3 4 5 6 7 8 8 9 10 11 12 13 13 ....

    i.e. every 5th frame is duplicated.

    I think that Decimate can do this, but I can't find an intelligible explanation of how to configure it.

    So I used Srestore
    Code:
    AssumeFPS(30,sync_audio=true)
    dclip=Crop(218, 26, -332, -398) # detection clip 
    srestore(frate=25, dclip=dclip)
    Which works, but the result gives a noticeable jerk about once a second.

    Is there a better way to do this?
    SRestore works a lot better if you're using it with 60fps instead of 30fps. For me, I use yadif(mode=1) get rid of combing while doubling the number of frames. This, paired with srestore(frate=25,cache=10) gives a lot better calculation and prevents jerkiness.

    Also, I've been testing this out against tfm(mode=1).tdecimate(cycle=6).changefps(25) and both seem to work, but sometimes they both cause audio sync problems. does anyone have any experience with this?
    Quote Quote  
  5. Originally Posted by AlanHK View Post
    I see the pattern of frames:
    1 2 3 3 4 5 6 7 8 8 9 10 11 12 13 13 ....

    i.e. every 5th frame is duplicated.
    Except every 1001 frames. So straight 1 in 6 decimation won't work. Try TDecimate(mode=2, rate=25).
    Quote Quote  
  6. Originally Posted by jagabo View Post
    Except every 1001 frames. So straight 1 in 6 decimation won't work. Try TDecimate(mode=2, rate=25).
    As AlanHK reminded me when I pointed out he'll get back 24.975fps, he's used AssumeFPS to get the framerate to 30fps.
    Quote Quote  
  7. Originally Posted by manono View Post
    Originally Posted by jagabo View Post
    Except every 1001 frames. So straight 1 in 6 decimation won't work. Try TDecimate(mode=2, rate=25).
    As AlanHK reminded me when I pointed out he'll get back 24.975fps, he's used AssumeFPS to get the framerate to 30fps.
    But then you're changing the running time of the video, necessitating the same for the audio (which he did with sync_audio=true). I usually prefer to keep the original audio intact.
    Quote Quote  
  8. Member
    Join Date
    Jan 2006
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo View Post
    But then you're changing the running time of the video, necessitating the same for the audio (which he did with sync_audio=true). I usually prefer to keep the original audio intact.
    I think any type of filter will change the runtime by at least 20ms, if not more. I've tried a few methods and noticed that when converting 29.970 -> 25fps, if the source contains blended frames, I get almost no change in runtime if I use srestore. However, if the source is simply duplicating every 6 frames, no matter what I try (srestore or tdecimate) I get changes in runtime, and sometimes this causes a noticeable audio sync issue.
    Quote Quote  
  9. Originally Posted by ChibiBoi View Post
    Originally Posted by jagabo View Post
    But then you're changing the running time of the video, necessitating the same for the audio (which he did with sync_audio=true). I usually prefer to keep the original audio intact.
    I think any type of filter will change the runtime by at least 20ms
    There's a big difference betwen 20 ms and 7 seconds (the difference between 25 and 24.975 fps for a 2 hour movie).
    Quote Quote  
  10. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by jagabo View Post
    But then you're changing the running time of the video, necessitating the same for the audio (which he did with sync_audio=true). I usually prefer to keep the original audio intact.
    I'm reencoding audio from MP3 to AAC anyway (AVI source, making MKV). Also adjusting the volume by doing ReplayGain. Downmixing to mono (since it's a 1970s TV show, it was never real stereo.) And making a few Trims on the video, so never was using the original audio track.
    Quote Quote  
  11. Originally Posted by AlanHK View Post
    never was using the original audio track.
    Fair enough. My typical scenario is DVD to MKV where I keep the AC3 audio.
    Quote Quote  
  12. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by jagabo View Post
    Originally Posted by AlanHK View Post
    I see the pattern of frames:
    1 2 3 3 4 5 6 7 8 8 9 10 11 12 13 13 ....

    i.e. every 5th frame is duplicated.
    Except every 1001 frames. So straight 1 in 6 decimation won't work. Try TDecimate(mode=2, rate=25).
    How do you know this is the pattern?
    How could I check? I tried to jump 1000 frames and see if one had been adropped, but hard to pinpoint.

    I converted 8 50-minute videos using the first method and they seem quite smooth.

    The second method also works, but I can see it gets out of step with the mode=0 version.
    Though I'm a tyro with decimation, I'm trying to read the docs. It seems that mode 2 would be more like SRestore.
    But does it really catch the 1001 cycle (if it exists)? That's a hell of a lot of frames to analyse.
    Quote Quote  
  13. Originally Posted by AlanHK View Post
    Originally Posted by jagabo View Post
    Originally Posted by AlanHK View Post
    I see the pattern of frames:
    1 2 3 3 4 5 6 7 8 8 9 10 11 12 13 13 ....

    i.e. every 5th frame is duplicated.
    Except every 1001 frames. So straight 1 in 6 decimation won't work. Try TDecimate(mode=2, rate=25).
    How do you know this is the pattern?
    Since I haven't seen the video I don't know for sure. But it's very common for someone to take a 25 fps video and convert it to 29.97 fps with simple duplicates -- that's the way most programs does it. Essentially the same thing as ChangeFPS(). The end result is what I described.

    Originally Posted by AlanHK View Post
    How could I check?
    You'd have to step through the video frame by frame. Of course, you can start with the assumption that if frame 4 is a duplicate of frame 3 then frame 10 should be a duplicate of frame 9, frame 502 should be a duplicate of frame 501, etc. So you can zip through the video and spot check until you find a break in the pattern. Unfortunately, if the video was edited after the frame rate conversion there may be many breaks in the pattern unrelated to the frame rate conversion.

    Originally Posted by AlanHK View Post
    But does it really catch the 1001 cycle (if it exists)? That's a hell of a lot of frames to analyse.
    It doesn't analyze 1001 frames at a time. And it may make mistakes. So it's not likely to be perfect either. But it will leave you with exactly 25 fps and the same running time (within the +/- one frame error you always get with frame rate conversions).
    Quote Quote  
  14. Member
    Join Date
    Jan 2006
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo View Post
    There's a big difference betwen 20 ms and 7 seconds (the difference between 25 and 24.975 fps for a 2 hour movie).
    And does Tdecimate(mode=2,rate=25) usually do a good job at keeping the untouched AC3 audio in sync with the video without making the video jerk? I've found that even if I keep the same script using either sreset(frate=25,cache=10) or tdecimate(cycle=6,mode=1).changefps(25) they both seem to work differently depending on the video, from one video to the next. I've found some of my videos without a sync problem, and others get progressively desynced. These are actually only 11 minute videos so I'd hate to think what would happen with a 22min video or longer. The reason I had been hesitant on using tdecimate(mode=2,rate=25) was because I was unsure how well it calculated the video to output smooth playback.
    Last edited by ChibiBoi; 15th Jul 2013 at 21:12.
    Quote Quote  
  15. Originally Posted by ChibiBoi View Post
    Originally Posted by jagabo View Post
    There's a big difference betwen 20 ms and 7 seconds (the difference between 25 and 24.975 fps for a 2 hour movie).
    And does Tdecimate(mode=2,rate=25) usually do a good job at keeping the untouched AC3 audio in sync with the video without making the video jerk?
    Yes. TDecimate never causes A/V desync.
    Quote Quote  



Similar Threads

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