VideoHelp Forum




+ Reply to Thread
Page 1 of 3
1 2 3 LastLast
Results 1 to 30 of 67
  1. I've recently decided to re-encode this video where the 1st and 3rd part need the audio and video slowed down but the middle part is fine. Sorry I had to upload the whole thing so you can see the problem, I tried to make it small so it's around 250MB. You don't even need to encode the video to see the problem. You can just load the script and save the WAV file and if you look at 16 minutes - 21 mins 57 secs you can hear that the audio for the middle part was slowed down.

    I set the trims so that the 1st and 3rd part of the video is slowed down and the middle part is left alone. Everything is fixed apart from the middle part which was fine to begin with but now it plays slower. What did I do wrong in my script?

    Code:
    vid=Mpeg2Source("E:\Fast Video (ECW Oct 19 1999).d2v", CPU=6)
    aud=NicAC3Source("E:\Fast Video (ECW Oct 19 1999) T80 2_0ch 128Kbps DELAY 0ms.ac3")
    AudioDub(vid,aud)
    Main=last
    
    Main
    Trim(0,28787) # This part needs the audio and video slowed down
    AssumeFPS(25) AssumeTFF() 
    QTGMC(Preset="Super Fast", sharpness=0.7) 
    source=last  
    super = source.MSuper(pel=2)  
    backward_vec = MAnalyse(super, overlap=4, isb = true, search=3)  
    forward_vec = MAnalyse(super, overlap=4, isb = false, search=3)  
    source.MFlowFps(super, backward_vec, forward_vec, blend=false, num=60000, den=1001) 
    AssumeTFF().Vinverse().RemoveSpots().AddGrainC(var=1.0,uvar=1.0).SeparateFields().SelectEvery(4, 0, 3).Weave()
    TimeStretch(rate=83.41666667) 
    A=last
    
    Main
    Trim(28788,39486)  # This is 16 minutes - 21 mins 57 secs. It does NOT need to be slowed down.
    AssumeTFF() QTGMC(Preset="Super Fast", sharpness=0.7)
    Vinverse() RemoveSpots() AddGrainC(var=1.0,uvar=1.0) SeparateFields() SelectEvery(4,0,3) Weave() 
    B=last
    
    Main
    Trim(39487,74377) # This part needs the audio and video slowed down
    AssumeFPS(25) AssumeTFF() 
    QTGMC(Preset="Super Fast", sharpness=0.7) 
    source=last  
    super = source.MSuper(pel=2)  
    backward_vec = MAnalyse(super, overlap=4, isb = true, search=3)  
    forward_vec = MAnalyse(super, overlap=4, isb = false, search=3)  
    source.MFlowFps(super, backward_vec, forward_vec, blend=false, num=60000, den=1001) 
    AssumeTFF().Vinverse().RemoveSpots().AddGrainC(var=1.0,uvar=1.0).SeparateFields().SelectEvery(4, 0, 3).Weave()
    TimeStretch(rate=83.41666667)
    C=last
    
    A++B++C
    
    SoundOut() # Once you've saved the audio you can comment this line out to prevent it asking you to save the audio every time you refresh the script in AvsPmod
    Last edited by VideoFanatic; 28th Aug 2013 at 09:33.
    Quote Quote  
  2. Looks like someone sped a 25 fps PAL video up to 29.97 fps.
    Quote Quote  
  3. The programme only aired in NTSC regions so I don't think it was originally a PAL video. Any suggestions on how to fix it though?
    Quote Quote  
  4. Slow it down?
    Quote Quote  
  5. I know how to convert NTSC to PAL so should I just do that? What about the audio though? Won't the audio be out of sync with the video then? How do I slow down the audio?
    Quote Quote  
  6. Originally Posted by VideoFanatic View Post
    I know how to convert NTSC to PAL so should I just do that? What about the audio though? Won't the audio be out of sync with the video then? How do I slow down the audio?

    There are many ways .

    You can patch the elementary video with restream to 25 fps if you don't want to re-encode the video . Or if you want to make it completely PAL , resize to 720x576 use AssumeFPS(25), and re-encode (be careful about interlaced resizing method if you do)

    To slow down audio, you can use various audio editors e.g. audacity, timestretch in avisynth with soundout

    TimeStretch(rate=83.41666667)
    Soundout()

    Timestretch is expressed as a percentage, so 25/(30000/1001) * 100 =~ 83.41666667

    (but it won't be NTSC DVD compliant @ 720x480 , 25 frames per second)
    Last edited by poisondeathray; 2nd Feb 2013 at 11:52.
    Quote Quote  
  7. The programme only aired in NTSC regions so I don't understand how it's playing so fast in the first place. The current 29.97 frame rate should be correct yet it's playing too fast. I can't convert to PAL because you can't have a PAL video on the same disc that has NTSC videos on it.

    I'll try your audio solution but is there any way to fix the video without converting to PAL?
    Quote Quote  
  8. Originally Posted by VideoFanatic View Post
    The programme only aired in NTSC regions so I don't understand how it's playing so fast in the first place. The current 29.97 frame rate should be correct yet it's playing too fast. I can't convert to PAL because you can't have a PAL video on the same disc that has NTSC videos on it.

    I'll try your audio solution but is there any way to fix the video without converting to PAL?


    It's playing fast because it was PAL at some point in it's life as jagabo mentioned. If you slow it down (both video & audio ) to 25 FPS it sounds and looks about right.

    DGPulldown works only with progressive material, one option is to re-encode the video as 720x480 progressive, 25fps , and use DGPulldown to make it NTSC DVD compliant (output NTSC 29.97 signal using flags) , and use the slowed down audio . But you lose 1/2 the motion samples (will look choppy) when you deinterlace

    I can't think of any good way to do this on a NTSC DVD
    Quote Quote  
  9. Maybe another approach would be to use the slowed down audio , interpolate the frames

    For the video, AssumeFPS(25), Bob Deinterlace to 50p (eg using QTGMC) , MVTools or simlar tools like svpflow or interframe to interpolate to 59.94p, Reinterlace as 59.94 fields per second

    But interpolation often leads to edge morphing artifacts. You can use blends (convertfps) or dupes (changefps), but blends are blurry, dupes are choppy

    You can expermiment and see which option you like better
    Quote Quote  
  10. Or could I just convert to PAL to fix the video. And fix the audio seperately. Then convert the video back to NTSC? I've converted from NTSC to PAL before and I didn't need to do anything to the audio so it should work.
    Quote Quote  
  11. Originally Posted by VideoFanatic View Post
    Or could I just convert to PAL to fix the video. And fix the audio seperately. Then convert the video back to NTSC? I've converted from NTSC to PAL before and I didn't need to do anything to the audio so it should work.
    But that's the problem, converting back to NTSC. How would you convert back to NTSC? I listed the 3 methods above. This isn't a typical "NTSC speedup". You can't just speed it up, or you're left with the same thing as the orginal

    PAL <=> NTSC usually refer to 25p vs. 24p (ie. 23.976p) the percentage difference is small . It's usually done with a simple slowdown, or speedup for the reverse

    In contrast, 25 vs. 29.97 is a large % difference. That's why you can hear "chipmunk" voices . Someone screwed up this one.
    Quote Quote  
  12. Originally Posted by VideoFanatic View Post
    I've converted from NTSC to PAL before and I didn't need to do anything to the audio so it should work.
    No. In this case you are going to slow the video down. So the running time will be longer. You can use Audacity to change the running time of the audio. Actually, I think AviSynth has built in audio features for that too. But I haven't used them. See ResampleAudio(), AssumeSampleRate(), TimeStretch(), etc.
    Last edited by jagabo; 2nd Feb 2013 at 13:05.
    Quote Quote  
  13. Here is an example using the interpolate method (mflowfps) for the video , reinterlaced, audio done with timestretch() , mentioned earlier

    (I didn't bother doing any cleanup, it's just to demonstrate the motion , sync, and audio pitch/tempo )
    Image Attached Files
    Quote Quote  
  14. Nice job, pdr.
    Quote Quote  
  15. Thanks poisondeathray, the video sample you posted looks fine and you've improved the audio as well. Could you please share the script you used to do all that?

    Also, do you think that's the best audio we can hope for or can it be improved because it still sounds a little weird.
    Quote Quote  
  16. Originally Posted by VideoFanatic View Post
    Thanks poisondeathray, the video sample you posted looks fine and you've improved the audio as well. Could you please share the script you used to do all that?

    Also, do you think that's the best audio we can hope for or can it be improved because it still sounds a little weird.

    The audio was done with timestretch described in post #6 above. You can play with the other parameters, you might get a better result. I used the default settings for seekwindow, overlap etc...
    http://avisynth.org/mediawiki/TimeStretch

    Or using a dedicated audio editor will probably give you better results.



    The video was done by bob deinterlacing to 50p , interpolating to 59.94p using mflowfps, then reinterlacing
    You can clean up noise and fix the colors too if you want

    Code:
    MPEG2Source()
    AssumeFPS(25)
    AssumeTFF()
    Crop(8,0,0,0)
    QTGMC(preset="faster", sharpness=0.7)
    
    source=last
    super = source.MSuper(pel=2)
    backward_vec = MAnalyse(super, overlap=4, isb = true, search=3)
    forward_vec = MAnalyse(super, overlap=4, isb = false, search=3)
    source.MFlowFps(super, backward_vec, forward_vec, blend=false, num=60000, den=1001)
    
    AddBorders(4,0,4,0)
    AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave()
    Quote Quote  
  17. My video has different parts that play fine and other have speedup. How would I go about using your script on just the parts that need slowed down?

    I normally do this to have different settings on different parts of a video:
    Code:
    filtered=Tweak(Hue=-0, Sat=1.0, Bright=0, Cont=1.0, Coring=False) ReplaceFramesSimple(last,filtered,Mappings="[0 6151]") 
    
    filtered=Tweak(Hue=-10, Sat=1.0, Bright=0, Cont=1.0, Coring=False) ReplaceFramesSimple(last,filtered,Mappings="[6152 80000]")
    Quote Quote  
  18. You can divide the different parts up using trim() , apply the various filters to sections , then join them with aligned splice
    Quote Quote  
  19. What's aligned splice?
    Quote Quote  
  20. Originally Posted by VideoFanatic View Post
    What's aligned splice?

    Iit's appending segments using "++" . You're less likely to have audio problems than unaligned splice "+"

    http://avisynth.org/mediawiki/AlignedSplice


    e.g

    a = avisource()
    b = avisource()

    a ++ b
    Quote Quote  
  21. Why do I need to use the above method? Doesn't trim join the segments anyway such as this:

    trim(0, 20512). Tweak(Hue=-0, Sat=1.0, Bright=0, Cont=1.0, Coring=False) ++trim(20512,78229). Tweak(Hue=-0, Sat=1.0, Bright=0, Cont=1.0, Coring=False)
    Quote Quote  
  22. Originally Posted by VideoFanatic View Post
    Why do I need to use the above method? Doesn't trim join the segments anyway such as this:

    trim(0, 20512). Tweak(Hue=-0, Sat=1.0, Bright=0, Cont=1.0, Coring=False) ++trim(20512,78229). Tweak(Hue=-0, Sat=1.0, Bright=0, Cont=1.0, Coring=False)


    Trim doesn't join, the "++" joins segments


    You had a thread about this already. I suggest you go back and re-read that. There are many different ways you can organize your scripts . If there are not too many segments, I like breaking them out into separate sections and giving them labels/names. The danger of using trim() is that it refers to "last", but I sometimes lose track of what "last" meant. You end up mixing filters on the wrong section or double filtering




    The way I like doing it is something like this


    Code:
    Main=WhateverSource()
    
    
    Main
    Trim(0,100)
    Filter1()
    Filter2()
    A=last
    
    
    Main
    Trim(500,600)
    Filter3()
    Filter4()
    B=last
    
    
    Main
    Trim(800,900)
    Filter5()
    Filter6()
    C=last
    
    A ++ B ++ C
    I made up imaginary "trims" . "A" refers to 0-100 , "B" refers to 500-600, "C" refers to 800-900) . You can give them more descriptive names too, like "intro", or "stong_filtered", etc... instead of A,B,C

    You used ReplaceFramesSimple in an earlier script, you can do it that way too .
    Last edited by poisondeathray; 4th Feb 2013 at 20:00.
    Quote Quote  
  23. Originally Posted by poisondeathray View Post
    You end up mixing filters on the wrong section or double filtering
    Or putting the pieces back together incorrectly:
    Originally Posted by VideoFanatic View Post
    trim(0, 20512). Tweak(Hue=-0, Sat=1.0, Bright=0, Cont=1.0, Coring=False) ++trim(20512,78229). Tweak(Hue=-0, Sat=1.0, Bright=0, Cont=1.0, Coring=False)
    Quote Quote  
  24. ReplaceFramesSimple() won't work because he's changing the number of frames (speed) of one of the videos.
    Quote Quote  
  25. Originally Posted by jagabo View Post
    ReplaceFramesSimple() won't work because he's changing the number of frames (speed) of one of the videos.

    whoops you're right ! He's going to be interpolating / adding more frames to those sections
    Quote Quote  
  26. What you want is something like:

    Code:
    src=AviSource()
    
    p1 = Trim(0,10).Tweak(...)
    p2 = Trim(11,20).Tweak(...)
    p3 = Trim(21,30).Tweak(...)
    
    p1++p2++p3
    Last edited by jagabo; 4th Feb 2013 at 20:54.
    Quote Quote  
  27. I also tried all the trim methods you mentioned but none of them worked. To recap, my video & audio is playing too fast and I need to slow it down. However a middle part of the video plays fine without problems. So I need to only slow down the fast parts. The below script works however I cannot get your solution to work where it only applies the fix to the fast parts. Can someone please give an example script where it only applies the fixes to specific sections?

    Code:
    Mpeg2Source("E:\2 = New\SpeedUp.d2v", CPU=6)
    
    AssumeFPS(25)
    
    AssumeTFF() 
    QTGMC(Preset="Super Fast", sharpness=0.7) 
    
    source=last 
    super = source.MSuper(pel=2) 
    backward_vec = MAnalyse(super, overlap=4, isb = true, search=3) 
    forward_vec = MAnalyse(super, overlap=4, isb = false, search=3) 
    source.MFlowFps(super, backward_vec, forward_vec, blend=false, num=60000, den=1001)
    
    AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave()
    Quote Quote  
  28. Code:
    src=Mpeg2Source("E:\2 = New\SpeedUp.d2v", CPU=6)
    
    part1 = Trim(0,1000)
    part3 = Trim (2000,0)
    
    #part2
    Trim (1001,1999)
    AssumeFPS(25)
    AssumeTFF() 
    QTGMC(Preset="Super Fast", sharpness=0.7) 
    super = MSuper(pel=2) 
    backward_vec = MAnalyse(super, overlap=4, isb = true, search=3) 
    forward_vec = MAnalyse(super, overlap=4, isb = false, search=3) 
    source.MFlowFps(super, backward_vec, forward_vec, blend=false, num=60000, den=1001)
    AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave()
     
    part1++part2++part3
    Quote Quote  
  29. Just break it out .

    Code:
    Main=Mpeg2Source()
    
    Main
    Trim(0,100)
    A=last
    
    Main
    Trim(101,200)
    AssumeFPS(25) 
    AssumeTFF()  
    QTGMC(Preset="Super Fast", sharpness=0.7) 
    source=last  
    super = source.MSuper(pel=2)  
    backward_vec = MAnalyse(super, overlap=4, isb = true, search=3)  
    forward_vec = MAnalyse(super, overlap=4, isb = false, search=3)  
    source.MFlowFps(super, backward_vec, forward_vec, blend=false, num=60000, den=1001) 
    AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave()
    B=last
    
    Main
    Trim(201,300)
    C=last
    
    A++B++C
    Change the trim numbers to the correct numbers corresponding to the sections
    Quote Quote  
  30. Oh, I just realized the ends (part1 and part3 in my example) need the frame rate change, not the middle (part2). I'll leave it up to the OP to adjust the code.
    Quote Quote  



Similar Threads

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