Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output seems to be slightly too fast #18

Open
BlackCapCoder opened this issue Aug 13, 2018 · 0 comments
Open

Output seems to be slightly too fast #18

BlackCapCoder opened this issue Aug 13, 2018 · 0 comments

Comments

@BlackCapCoder
Copy link

BlackCapCoder commented Aug 13, 2018

I am using sonic to speed up the audio of videos, and have been noticing that I am getting a slight audio/video desync. At 2.5x this seems to be around half a second for every half an hour of video (original length).

Example

$ youtube-dl -f bestaudio "https://www.youtube.com/watch?v=8sBYyrJDC0o" -o aud.webm
$ ffmpeg -loglevel panic -i aud.webm -f wav - | sox -t wav - -t wav slow.wav
$ sonic -s 2.5 slow.wav fast.wav

$ ffmpeg -i slow.wav 2>&1 | grep Duration | awk '{print $2}' | tr -d ,
00:31:00.10

$ ffmpeg -i fast.wav 2>&1 | grep Duration | awk '{print $2}' | tr -d ,
00:12:23.40

The first time is the length of the original audio, the second is the length of the audio sped up to 2.5x with sonic.

s = 31*60 +  0 + 10/60 = 1860.1666666666667
f = 12*60 + 23 + 40/60 = 0743.6666666666666
s/2.5                  = 0744.0666666666667
s/f                    = 2.5013446884805024

In this case the sped up audio was about 400ms shorter than what I was expecting- 743.6 seconds rather than 744-, and the speed up factor was about 2.501 rather than the specified 2.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant