VideoHelp Forum




+ Reply to Thread
Page 2 of 3
FirstFirst 1 2 3 LastLast
Results 31 to 60 of 67
  1. Originally Posted by jagabo View Post
    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.

    LOL I did the same thing
    Quote Quote  
  2. Originally Posted by manono View Post
    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)
    In the sample video I did this and it joined the talking segment and wrestling segment into 1 video without problem so how is it putting the pieces back together incorrectly?:

    Code:
    trim(0, 465). Tweak(Hue=-0, Sat=1.0, Bright=0, Cont=1.0, Coring=False) ++trim(466,694). Tweak(Hue=-0, Sat=1.0, Bright=0, Cont=1.0, Coring=False)
    Quote Quote  
  3. Originally Posted by VideoFanatic View Post
    In the sample video I did this and it joined the talking segment and wrestling segment into 1 video without problem so how is it putting the pieces back together incorrectly?:

    Code:
    trim(0, 465). Tweak(Hue=-0, Sat=1.0, Bright=0, Cont=1.0, Coring=False) ++trim(466,694). Tweak(Hue=-0, Sat=1.0, Bright=0, Cont=1.0, Coring=False)
    Yes, your code worked. But it is only using one filter. It's going to get very ugly with the full QTGMC, MvTools, Reinterlace sequence. At least break that out into a separate function. Then you can call it with a much cleaner looking:

    Code:
    Trim(...).ChangeSpeed()++Trim(...)++Trim(...).ChangeSpeed()
    Or if you have many sections:
    Code:
    Trim(...).ChangeSpeed()\
    ++Trim(...)\
    ++Trim(...).ChangeSpeed()\
    ++Trim(...)\
    ++Trim(...).ChangeSpeed()\
     etc.
    Quote Quote  
  4. Poisondeathray - I've got it working with the below code. Annoyingly it doesn't work in multi-threaded. Anyway, you said to slow down the audio you used: TimeStretch(rate=83.41666667) Soundout(). So do I just use that code in the parts that are playing too fast? How do I import the AC3 file so I can do the timestretch?

    Code:
    Main=Mpeg2Source("E:\2 = New\SpeedUp.d2v", CPU=6)  
    
    Main
    Trim(0,300)
    McTemporalDenoise(settings="medium", interlaced=true)
    AssumeTFF() QTGMC(Preset="Super Fast", sharpness=0.7)
    Vinverse() RemoveSpots() AddGrainC(var=1.0,uvar=1.0) SeparateFields() SelectEvery(4,0,3) Weave() 
    A=last
    
    Main
    Trim(301,465)
    McTemporalDenoise(settings="medium", interlaced=true)
    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(466,694)
    McTemporalDenoise(settings="medium", interlaced=true)
    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()
    
    C=last
    
    A++B++C
    Quote Quote  
  5. I would join the audio separately. You can use various methods

    eg
    https://forum.videohelp.com/threads/213080-Join-AC3-files

    ie. Take the audio from section C using the timestretch script and using Trim() to mark the start/end points, or use an audio editor to slow it down , join them with one of the methods in the thread above

    To import audio only in an avs script you can use NicAC3Source() , or FFAudioSource() . If there is an audio delay , don't forget to add that (it should be written in the name)

    To cut audio you can use delaycut


    Alternatively , you can specify audio with each section in the script by using AudioDub() , but this means you re-encode the entire audio (lose quailty in all the sections instead of just 1)
    Quote Quote  
  6. There are inconsistencies in your script. You don't have "." between some of the filter calls . I don't know if that was a copy/paste error
    Quote Quote  
  7. I didn't have a period because my scripts worked fine without them. I'm still a bit confused about what I'm supposed to be doing to only slow down the audio on 1 section of the video. I've got this so far. I get the following error "no audio found in clip"

    Code:
    Main=Mpeg2Source("E:\2 = New\SpeedUp.d2v", CPU=6)  
    NicAC3Source("E:\2 = New\SpeedUp T80 2_0ch 256Kbps DELAY 0ms.ac3")
    
    Main
    Trim(0,300)
    # McTemporalDenoise(settings="medium", interlaced=true)
    AssumeTFF() QTGMC(Preset="Super Fast", sharpness=0.7)
    Vinverse() RemoveSpots() AddGrainC(var=1.0,uvar=1.0) SeparateFields() SelectEvery(4,0,3) Weave() 
    A=last
    
    Main
    Trim(301,465)
    # McTemporalDenoise(settings="medium", interlaced=true)
    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(466,694)
    # McTemporalDenoise(settings="medium", interlaced=true)
    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()
    TimeStretch(rate=83.41666667) Soundout()
    C=last
    
    A++B++C
    Quote Quote  
  8. You have to join the audio stream to the video stream. Use AudioDub().
    Quote Quote  
  9. Code:
    vid=Mpeg2Source("E:\2 = New\SpeedUp.d2v", CPU=6)   
    aud=NicAC3Source("E:\2 = New\SpeedUp T80 2_0ch 256Kbps DELAY 0ms.ac3")
    AudioDub(vid,aud)
    Main=last
    .
    .
    .
    Quote Quote  
  10. Originally Posted by VideoFanatic View Post
    Originally Posted by manono View Post
    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)
    In the sample video I did this and it joined the talking segment and wrestling segment into 1 video without problem so how is it putting the pieces back together incorrectly?
    Note the bold-faced frame numbers. You ended one trim with one frame and began the next with the same one. You increased the total frame count by one, probably something you didn't intend. I suppose it was meant as an example since your Tweak settings do nothing, but still...
    Quote Quote  
  11. OK so this is my test example what I've got so far. Is that correct? When I load my script I see 3 SoundOut popups. Should I just save an AC3 file of every file? Then what do I do because I need to join them again?

    Should I just use the TimeStretch(rate=83.41666667) Soundout() text on the parts that I want slowed down and Soundout() on parts that already play fine?

    Code:
    vid=Mpeg2Source("E:\2 = New\SpeedUp.d2v", CPU=6)   
    aud=NicAC3Source("E:\2 = New\SpeedUp T80 2_0ch 256Kbps DELAY 0ms.ac3")
    AudioDub(vid,aud)
    Main=last
    
    Main
    Trim(0,300)
    # McTemporalDenoise(settings="medium", interlaced=true)
    AssumeTFF() QTGMC(Preset="Super Fast", sharpness=0.7)
    Vinverse() RemoveSpots() AddGrainC(var=1.0,uvar=1.0) SeparateFields() SelectEvery(4,0,3) Weave() 
     Soundout()
    A=last
    
    Main
    Trim(301,465)
    # McTemporalDenoise(settings="medium", interlaced=true)
    AssumeTFF() QTGMC(Preset="Super Fast", sharpness=0.7)
    Vinverse() RemoveSpots() AddGrainC(var=1.0,uvar=1.0) SeparateFields() SelectEvery(4,0,3) Weave() 
    TimeStretch(rate=83.41666667) Soundout()
    B=last
    
    Main
    Trim(466,694)
    # McTemporalDenoise(settings="medium", interlaced=true)
    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()
    TimeStretch(rate=83.41666667) Soundout()
    C=last
    
    A++B++C
    Quote Quote  
  12. Take out all instances of soundout. Soundout is for encoding audio through avisynth

    If you include audio in the script, you can feed the avs into an encoder that accepts avs scripts .

    Or you can use 1 soundout() at the very end of the script, after A++B++C


    Timestretch should only be used for part C, not part B (I'm assuming C is the only "bad" part)
    Quote Quote  
  13. I'm confused. In your early post you said "To slow down audio, you can use various audio editors e.g. audacity, timestretch in avisynth with soundout". So that's what I'm doing but now you're saying to not use SoundOut.

    If I just use TimeStretch then it won't fix the audio. I thought the whole idea of this was to do both the video and audio fixes in the script? I'm aware that I'll probably have to re-encode the audio, that's fine but I just need to know what I'm supposed to do.
    Quote Quote  
  14. Erase all instances of soundout , keep timestretch only for part C, add soundout() to the end after A++B++C . This will give you 1 audio (joined)

    If you didn't want to use soundout to encode audio, you can comment out soundout and use that avs script as input into another audio encoder.

    This is more damaging than if you cut the AC3, and only encode part C. Then join the original A and B

    Does that make sense ?
    Quote Quote  
  15. Why is SoundOut needed? I have a similar script and audio is passed through properly without using it (though it's only stereo).

    There's another way to approach this, maybe a little more straight forward:

    Code:
    src = WhateverSource()
    norm = FilterSequenceA(src)
    slow = FilterSequenceB(src)
    
    Trim(slow,...)++Trim(norm,...)++Trim(slow,...)
    The only difficulty here is that you have to figure out what frame numbers in the slow video conform to the trims in the norm video.
    Quote Quote  
  16. Originally Posted by jagabo View Post
    Why is SoundOut needed? I have a similar script and audio is passed through properly without using it (though it's only stereo).
    soundout isn't required; it's an encoder

    you can do the same thing without soundout , just feed the script into an encoder (without soundout)
    Quote Quote  
  17. I've recently decided to re-encode this video. 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.

    I had it working before where the fast video and audio sections were slowed down to normal speed. However when I tried to re-encode the original video again, the script is not working correctly. 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).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)
    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,74379) # 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
    
    filtered=Tweak(Hue=-10, Sat=0.7, Coring=False) ReplaceFramesSimple(last,filtered,Mappings="[0 9857]")
    
    filtered=Tweak(Sat=0.7, Coring=False) ReplaceFramesSimple(last,filtered,Mappings="[9858 29050]") 
    
    filtered=Tweak(Sat=0.6, Coring=False) ReplaceFramesSimple(last,filtered,Mappings="[29051 74379]") 
    
    ColorYUV(off_u=3, off_v=-0) 
    
    ConvertToRGB32(interlaced=true). RGBAdjust(1.0, 0.95, 1.05). Converttoyv12(interlaced=true)
    
    Crop(18,0,-0,-4)
    AddBorders(18,2,16,2, $000000)
    Quote Quote  
  18. That script doesn't work with that video because the last frame number on line 47 "Mappings="[29051 74379]" is larger than the number of frames in the video. Replace 74379 with 74377.

    If you had looked at the error message AviSynth returned you would have seen this.
    Last edited by jagabo; 1st Aug 2013 at 20:24.
    Quote Quote  
  19. The video is made longer by slowing down the speed which is why there is more frames than before. I looked at the video in AvsPmod and 74379 is the last frame?
    Quote Quote  
  20. 74377 is the last frame. Maybe some of the time stretching functions have changed a little?
    Quote Quote  
  21. Ok it looks like when I re-encoded the video for uploading that a couple of frames were removed. Anyway, do you know how to fix the problem where the middle part of the video is slowed down instead of staying at the speed it originally was?
    Quote Quote  
  22. The middle part of the video isn't sped up here. Are you sure you're looking at the right part of the video? Remember, part A is longer than it originally was so part B starts later than it originally did -- around frame 34511 rather than 28788.
    Last edited by jagabo; 1st Aug 2013 at 21:27.
    Quote Quote  
  23. In the video I uploaded the middle part plays fine but when I use the script I posted it slows down the middle part for some reason. Yes I'm sure the frame numbers are correct.
    Quote Quote  
  24. I meant the output of the script didn't have a sped up middle section.
    Quote Quote  
  25. So the middle part is fine before I used my script. After I used my script is slows down the middle part for some reason. How can I prevent that?
    Quote Quote  
  26. Like I said, your script doesn't slow the middle part when I run it.
    Quote Quote  
  27. I updated my OP here. Can you please try to save the WAV file to see what I'm talking about.
    Quote Quote  
  28. The script is doing exactly what you're telling it to do. The problem is, and I told you this before, your trims are in the wrong places. In the pair of lines that reads:

    Code:
    Main
    Trim(28788,39486)  # This is 16 minutes - 21 mins 57 secs. It does NOT need to be slowed down.
    Add .Invert to Main:

    Code:
    Main.Invert
    Trim(28788,39486)  # This is 16 minutes - 21 mins 57 secs. It does NOT need to be slowed down.
    Then scroll through the video and it will be obvious that the trim is wrong. It looks (sounds?) to me like the middle section should be frames 24233 to 33768.
    Last edited by jagabo; 28th Aug 2013 at 11:18.
    Quote Quote  
  29. I don't understand that because when I load my script in AvsPmod the start and end trims are trimming the exact sections that I want slowed down? Yet when the video is encoded it's not slowing down the correct sections. Here are the the trims and trim times and also I've shown the times in the video with no script. What am I doing wrong?

    1st Part (needs slowed down): Trim(0,28787) # 0 - 16 minutes (0 - 13 minutes 21 secs in the video before the script sees it)

    2nd Part (does NOT need slowed down): Trim(28788,39486) # 16 minutes - 21 mins 57 secs (13 minutes 21 secs - 18 minutes 46 secs in the video before the script sees it.

    3rd Part (needs slowed down): Trim(39487,74377) # 21 minutes 57 secs - 41 mins 21 secs (18 minutes 46 secs - 35 mins 29 secs in the video before the script sees it)
    Quote Quote  
  30. 13 minutes and 21 seconds isn't frame 28787 in the original video. It's frame 24006.

    (13 * 60 + 21) * 29.97 ~= 24006

    Click image for larger version

Name:	cut.jpg
Views:	218
Size:	53.3 KB
ID:	19755
    Last edited by jagabo; 28th Aug 2013 at 13:18.
    Quote Quote  



Similar Threads

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