VideoHelp Forum
+ Reply to Thread
Results 1 to 20 of 20
Thread
  1. Member
    Join Date
    Nov 2013
    Location
    Western Australia
    Search Comp PM
    Hello everyone.

    Long story short, I would like to show a movie to my grandparents who are in their 90s and it would be easier for them to follow if it was slowed down a little. My source files are ripped from a bluray movie and the audio and video are separate, so this will need to be put into consideration.

    I'm using avisynth + MeGUI but my knowledge of it is very limited. I would like to slow down the movie by either 3% or 4%. Similar to how PAL movies are sped up by 4%, I feel this is a decent amount of difference.

    I have noticed if you simply type a command, the parameters won't show up. But if you type the command and then hit enter, they will. Please provide an example for 3% and 4% slowdown and give as much detail as possible.

    Thank you in advance.
    Quote Quote  
  2. AssumeFPS(23.976, sync_audio=true)

    Though I'm not sure this will work in Megui -- doesn't it handle audio separately?
    Quote Quote  
  3. Member
    Join Date
    Nov 2013
    Location
    Western Australia
    Search Comp PM
    Originally Posted by jagabo View Post
    AssumeFPS(23.976, sync_audio=true)

    Though I'm not sure this will work in Megui -- doesn't it handle audio separately?


    23.976 is the standard framerate for bluray movies. (with a handful of exceptions) I'm looking to slow down the movie by 3% or 4%, with the source file being a standard 23.976 film.

    MeGUI can take scripts for audio separately.
    Quote Quote  
  4. Then use 3 or 4 percent less than 23.976. 23.976 * 0.96 ~= 23.017.
    Quote Quote  
  5. Member
    Join Date
    Nov 2013
    Location
    Western Australia
    Search Comp PM
    Originally Posted by jagabo View Post
    Then use 3 or 4 percent less than 23.976. 23.976 * 0.96 ~= 23.017.
    My maths is HORRIBLE, I didn't think of that.

    That hopefully solves the video, but what about the audio? The audio's pitch would also need to be appropriately changed.
    Quote Quote  
  6. Kawaiiii
    Join Date
    May 2021
    Location
    Italy
    Search Comp PM
    Originally Posted by WAusJackBauer View Post
    That hopefully solves the video, but what about the audio? The audio's pitch would also need to be appropriately changed.
    you'll simply have to slow down the audio of the same amount/ratio WITHOUT changing the pitch (or you'll have an horrible shift (down) of the pitch ), then remux video and audio.
    Quote Quote  
  7. Member
    Join Date
    Nov 2013
    Location
    Western Australia
    Search Comp PM
    Originally Posted by krykmoon View Post
    Originally Posted by WAusJackBauer View Post
    That hopefully solves the video, but what about the audio? The audio's pitch would also need to be appropriately changed.
    you'll simply have to slow down the audio of the same amount/ratio WITHOUT changing the pitch (or you'll have an horrible shift (down) of the pitch ), then remux video and audio.
    I don't know how to do this in the slightest.

    I would've thought the pitch also needed to be changed.
    Last edited by WAusJackBauer; 15th May 2021 at 11:51.
    Quote Quote  
  8. If you can't handle audio in the same script as the video, in the audio script use AssumeSampleRate() to set the sample rate 4 percent slower than the original rate. For example, if the original is 48000 Hz change it to 46080 Hz. Players might have trouble with an unusual sample rate like that so follow up by resampling back to the original sample rate.

    Code:
    AssumeSampleRate(46080)
    ResampleAudio(48000)
    This will change the pitch as well as lengthening the audio.

    If you don't want the pitch shift use TimeStretch() instead:

    Code:
    TimeStretch(tempo=0.96)
    Actually you can use TimeStretch() to change the length+pitch if that's what you want. See the docs.
    Last edited by jagabo; 15th May 2021 at 11:49.
    Quote Quote  
  9. Member
    Join Date
    Nov 2013
    Location
    Western Australia
    Search Comp PM
    Originally Posted by jagabo View Post
    If you can't handle audio in the same script as the video, in the audio script use AssumeSampleRate() to set the sample rate 4 percent slower than the original rate. For example, if the original is 48000 Hz change it to 46080 Hz. Players might have trouble with an unusual sample rate like that so follow up by resampling back to the original sample rate.

    Code:
    AssumeSampleRate(46080)
    ResampleAudio(48000)
    This will change the pitch as well as lengthening the audio.

    If you don't want the pitch shift use TimeStretch() instead:

    Code:
    TimeStretch(tempo=0.96)
    Actually you can use TimeStretch() to change the length+pitch if that's what you want. See the docs.
    Ah yes I remember my brother showing me something about TimeStretch years ago for converting PAL movies to NTSC speed.

    So assuming I want 4%, I have typed tempo=0.96 but I get an error that says "Input audio sample format to TimeStretch must be float"

    I then tried typing =0.96 for rate and pitch (was that correct?) but then I got a "Script error: syntax error"
    Quote Quote  
  10. Kawaiiii
    Join Date
    May 2021
    Location
    Italy
    Search Comp PM
    Originally Posted by WAusJackBauer View Post
    I would've thought the pitch also needed to be changed.
    Think about it this way: changing TEMPO is making the audio slower or faster; changing PITCH is changing the frequency/tone of the sounds.. in this case DOWN.. so a woman's voice may sound like a man's one (this is only to make an example, I don't think a so little shift can lead to something so radical like that)

    You don't want (nor need) changing the pitch (frequency) of the audio .. so TimeStretch() is the correct way to go for this specific task.

    NOTE : to be precise and clear.. when you simply slow down an audio (in analogue devices too).. the pitch goes down by itself (since it depends on the speed the audio plays at - it's just physics - like with records: a 33 rpm record will play at a higher pitch at a speed of 45 rpm ).

    With digital audio and PC software.. the algorithms involved can treat these two factors as they were separate .. and compensate for that shift for you, if that's not what you want/need
    Last edited by krykmoon; 15th May 2021 at 12:21.
    Quote Quote  
  11. Member
    Join Date
    Nov 2013
    Location
    Western Australia
    Search Comp PM
    Originally Posted by krykmoon View Post
    Originally Posted by WAusJackBauer View Post
    I would've thought the pitch also needed to be changed.
    Think about it this way: changing TEMPO is making the audio slower or faster; changing PITCH is changing the frequency/tone of the sounds.. in this case DOWN.. so a woman's voice may sound like a man's one (this is only to make an example, I don't think a so little shift can lead to something so radical like that)

    You don't want (nor need) changing the pitch (frequency) of the audio .. so TimeStretch() is the correct way to go for this specific task.

    NOTE : to be precise and clear.. when you simply slow down an audio (in analogue devices too).. the pitch goes down by itself (since it depends on the speed the audio plays at - it's just physics - like with records: a 33 rpm record will play at a higher pitch at a speed of 45 rpm ).

    With digital audio and PC software.. the algorithms involved can treat these two factors as they were separate .. and compensate for that shift for you, if that's not what you want/need
    Oh right of course. I'm so used to changing the pitch because I live in a PAL region and on PAL movies the pitch is higher than it should be.

    I'm still insure of what to do though. I'm pretty clueless with this kind of stuff so I guess if you can give an example as if you were doing it yourself and then I can just copy and paste it.
    Last edited by WAusJackBauer; 15th May 2021 at 12:31.
    Quote Quote  
  12. Kawaiiii
    Join Date
    May 2021
    Location
    Italy
    Search Comp PM
    I'm not an Avisynth expert.. especially when audio is involved.

    But IF the software you use to encode can take the audio from the avisynth script I would do something like this:

    Code:
    # inside the quotes put the full path to your video, with file extensions - the one I provided is only an example
    
    fileName = "D:\Movies\MyMovie.mkv"
    
    
    # Values lesser than one will slow the media down while greater than 1 will speed it up.
    SpeedRatio = 0.96
    
    
    
    A = FFAudioSource(fileName)
    V = FFVideoSource(fileName)
    
    V = V.AssumeFPS(23.976 * SpeedRatio)
    A = A.TimeStretch(tempo=100 * SpeedRatio)
    
    
    AudioDub(V, A)
    (NOTE: I'm using Avisynth+ 64bit, and the FFMPEG2 plugin as Source for both A/V. I don't know what's your avisynth setup and what you use)
    Last edited by krykmoon; 15th May 2021 at 15:05.
    Quote Quote  
  13. I know how to use AviSynth but I don't know enough about Megui to advise you.
    Quote Quote  
  14. Member
    Join Date
    Nov 2013
    Location
    Western Australia
    Search Comp PM
    Originally Posted by jagabo View Post
    I know how to use AviSynth but I don't know enough about Megui to advise you.
    That's ok you can actually ignore MeGUI in this situation.
    Quote Quote  
  15. Krykmoon's already given you one example. Here's another:

    Code:
    a = LWLibavAudioSource("3IVX.avi") # get the audio
    v = LWLibavVideoSource("3IVX.avi") # get the video
    AudioDub(v,a) # join them into a single stream
    
    TimeStretch(tempo=96) # stretch the audio by 4 percent
    AssumeFPS(framerate*0.96) # stretch the video by four percent
    Note that this leaves you with a frame rate of 23.017 (assuming a 23.976 fps source). Some encoders (MPEG 2 for DVD, for example) won't like that.
    Quote Quote  
  16. Member
    Join Date
    Nov 2013
    Location
    Western Australia
    Search Comp PM
    Originally Posted by jagabo View Post
    Krykmoon's already given you one example. Here's another:

    Code:
    a = LWLibavAudioSource("3IVX.avi") # get the audio
    v = LWLibavVideoSource("3IVX.avi") # get the video
    AudioDub(v,a) # join them into a single stream
    
    TimeStretch(tempo=96) # stretch the audio by 4 percent
    AssumeFPS(framerate*0.96) # stretch the video by four percent
    Note that this leaves you with a frame rate of 23.017 (assuming a 23.976 fps source). Some encoders (MPEG 2 for DVD, for example) won't like that.
    Perfect that worked, thank you!

    Strange that when combined with the video it didn't come up with that float error

    EDIT: Actually I do get the error when I use the source audio. (DTS file) I wasn't getting the error because I accidentally dragged and dropped in an AC3 encode of the audio that I had from a while back.

    So any ideas how to fix this float error? "Input audio sample format to TimeStretch must be float"
    Last edited by WAusJackBauer; 17th May 2021 at 11:12.
    Quote Quote  
  17. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Convert your audio to float (if it is DTS is ISN'T decoded that way by default).

    Code:
    ConvertAudioToFloat ()
    After adjustment, you most likely will need to convert back, though you should normalize first to avoid clipping.

    something like...
    Code:
    Normalize (...)
    ConvertAudioTo24bit ()
    Scott
    Quote Quote  
  18. Member
    Join Date
    Nov 2013
    Location
    Western Australia
    Search Comp PM
    Originally Posted by Cornucopia View Post
    Convert your audio to float (if it is DTS is ISN'T decoded that way by default).

    Code:
    ConvertAudioToFloat ()
    After adjustment, you most likely will need to convert back, though you should normalize first to avoid clipping.

    something like...
    Code:
    Normalize (...)
    ConvertAudioTo24bit ()
    Scott
    I tried ConvertAudioToFloat () on its own and that seems to have done done the trick! Thank you!

    Everything seems good in the preview, audio is in sync and pitch is not changed, but incase something happens after the encode, what numbers/settings should I use for Normalize?

    Also should I use Normalize and ConvertAudioTo24bit before or after TimeStretch?
    Last edited by WAusJackBauer; 17th May 2021 at 11:41.
    Quote Quote  
  19. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Because you are converting to float and doing a pitch-correcting time stretch/shrink, your samples are being interpolated. It is very unlikely (esp. since you didn't make any other changes, AFAIK), but there is always the possibility that some of those interpolations generated new samples that are "out-of-bounds" compared to the original 16/24bit integer format. If that happens, those samples will clip. Normalize "resets" the whole clip so the max is right at the limit and all is below, making everything "valid" again.
    The default settings (the clip in question, 1.0 - for normal 0dBFS as the peak, show=false/omitted) should be fine. Use it AFTER TimeStretch. It is there to correct the above possibility that might occur during the timestretch.

    Hope that helps,

    Scott
    Quote Quote  
  20. Member
    Join Date
    Nov 2013
    Location
    Western Australia
    Search Comp PM
    Originally Posted by Cornucopia View Post
    Because you are converting to float and doing a pitch-correcting time stretch/shrink, your samples are being interpolated. It is very unlikely (esp. since you didn't make any other changes, AFAIK), but there is always the possibility that some of those interpolations generated new samples that are "out-of-bounds" compared to the original 16/24bit integer format. If that happens, those samples will clip. Normalize "resets" the whole clip so the max is right at the limit and all is below, making everything "valid" again.
    The default settings (the clip in question, 1.0 - for normal 0dBFS as the peak, show=false/omitted) should be fine. Use it AFTER TimeStretch. It is there to correct the above possibility that might occur during the timestretch.

    Hope that helps,

    Scott
    It does. The encode worked!

    Thank you all very much for your help and patience! I really appreciate that there are people like you that are willing to help
    Last edited by WAusJackBauer; 18th May 2021 at 01:47.
    Quote Quote  



Similar Threads

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