TwitchDownloader icon indicating copy to clipboard operation
TwitchDownloader copied to clipboard

Audio out of sync when cutting VOD

Open trevormbell opened this issue 3 years ago • 9 comments

Checklist

Edition

Windows GUI Application

Describe your issue here

When downloading a full VOD everything works perfectly, but if I try to only download a portion of the VOD the audio is out of sync with the video when playing it back. I have tried on multiple VODs and it always happens.

trevormbell avatar Feb 23 '23 15:02 trevormbell

I compared the gunshots of a VOD in the Twitch player and a cropped download in Sony Vegas 17.0 at 0.25x and found no desync.

ScrubN avatar Feb 23 '23 23:02 ScrubN

the desync I'm getting is close to a second or more. I did more testing and found it's only out of sync when playing back in VLC, windows player works fine. VLC will still play the uncut VODs properly though. maybe it's a problem on my end but I can't see what would cause such a weird edge case.

trevormbell avatar Feb 24 '23 00:02 trevormbell

It's almost certainly a duplicate of #531 #67

Again could either re-encode 1st part (which will inevitability have some loss in quality within the first 10 seconds) and would require a bit of CPU instead of it being basically a purely IO operation since we never did any re-encoding.

Or could parse out the keyframes and cut on the nearest one. Would still not be totally accurate cut but no desync. Would have to bundle ffprobe too which would suck though.

lay295 avatar Feb 24 '23 00:02 lay295

Had the same issue with some media players having a desynchronized audio, as well as some video editors: Davinci Resolve worked fine but with everything else I'd have to manually adjust the audio. Doesn't happen all the time though, don't know why. A huge bummer since downloading portions of a vod is all I need the tool for, and most of the times a download either fails for an unknown reason or results in a desynchronized audio.

indeboss avatar Feb 26 '23 11:02 indeboss

Had the same issue with some media players having a desynchronized audio, as well as some video editors: Davinci Resolve worked fine but with everything else I'd have to manually adjust the audio. Doesn't happen all the time though, don't know why.

The only application I have found that has any of the desync/freezing issues is VLC. Other media players/editors such as MPV, Sony Vegas, Blender all correctly played the video file.

A huge bummer since downloading portions of a vod is all I need the tool for, and most of the times a download either fails for an unknown reason or results in a desynchronized audio.

You can re-encode the downloads with Handbrake, Ffmpeg, or XMedia Recode and it will fix the odd playback issues.

ScrubN avatar Feb 26 '23 20:02 ScrubN

I also have this issue, the problem seems to be random because some videos are fine, what I do is download the video again from a few seconds before or after until the file doesn't have the sync issue. I blame ffmpeg because if I download segments directly with it I also get the issue.

One thing I noticed is that the start of the video seems to have an issue (the first couple seconds have no audio data) and VLC just plays the video and audio assuming they are synced from the beginning (this causes the problem with VLC).

Other players wait for the audio and video to sync, so the first couple seconds of the video have no audio and then when the audio finally starts then all is perfectly synced.

This issue with the beginning of the videos also causes other random issues in other players.

PeterPedro avatar Apr 04 '23 06:04 PeterPedro

Have same issue, only happens with some cut VOD's and only with VLC player, works fine with Windows Media Player, i guess i could switch players when i have the issue but still annoying, come to think of it might just be a issue with VLC itself.

nazsol avatar Apr 15 '23 10:04 nazsol

I think QuickTime shows the 2002 error when trying to open a downloaded vod because of this issue as well

indeboss avatar Apr 17 '23 22:04 indeboss

This is a duplicate of this: https://github.com/lay295/TwitchDownloader/issues/863

I have a PR that explains this much better in README.md: https://github.com/lay295/TwitchDownloader/pull/985

superbonaci avatar Mar 18 '24 11:03 superbonaci