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

Audio is exactly 2 seconds behind #83

Open
eugeny-dementev opened this issue Apr 24, 2024 · 7 comments
Open

Audio is exactly 2 seconds behind #83

eugeny-dementev opened this issue Apr 24, 2024 · 7 comments
Labels
bug Something isn't working out of scope Relates to third party dependency

Comments

@eugeny-dementev
Copy link

Each stream captured have exactly 2 seconds desync behind video

Firstly I've run mostly example configuration with no change to yt-dlp command. Default one as in example livestream_saver.cfg

When noticed the issue I've run yt-dlp command directly but reduced version:
yt-dlp -f bestvideo+bestaudio --live-from-start <youtube_stream_link>
Left it for the night and it end up being perfect, no sync issue

Updated command in livestream_saver.cfg to be the same with only -f and --live-from-start arguments and nothing changed, still each stream recorded has that exactly 2 seconds desync

What can I try to fix the issue?

@glubsy
Copy link
Owner

glubsy commented May 2, 2024

I did not notice this bug on my side (yet) but it's definitely related to yt-dlp.

Make sure that the yt-dlp you are using in your virtual environment is up to date. This is separate from any yt-dlp client you have installed on your system, we're talking about the library package of yt-dlp in this case:

source path/to/venv/bin/activate
pip install --upgrade yt-dlp

Be wary that the yt-dlp configuration is done in ytdlp_config.json currently.
The example ytdlp_command variable in livestream_saver.cfg is only used by hooks (for example: on_upcoming_detected_command, etc.)

This is not something I can fix, but thanks for reporting anyway. Will keep an eye on this.

@glubsy glubsy added the out of scope Relates to third party dependency label May 2, 2024
@eugeny-dementev
Copy link
Author

Thank you for reply. One important thing I forgot to mention. I'm using https://hub.docker.com/r/glubsy/livestream_saver

Inside is definitely old version of yt-dlp: 2023.12.30
While the latest is 2024.04.09

@eugeny-dementev
Copy link
Author

I'm not sure why your Dockerfile doesn't pulls latest version of yt-dlp, don't really have much experience with python and pip, but maybe switching to ADD --chmod=755 https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp /usr/bin approach to build docker image would change something?

@eugeny-dementev
Copy link
Author

@glubsy Please check updates on the context

@glubsy
Copy link
Owner

glubsy commented May 18, 2024

Currently there is no mechanism to fetch the latest version of yt-dlp inside the docker image (at run-time). The embedded yt-dlp is the latest version coming from the upstream github repository at the time of image building.

I updated the Docker hub image 13 days ago with the latest version of yt-dlp (2024.04.09), perhaps this will help in that regard.

Does the desync happen over time, or right from the start of the video?

@eugeny-dementev
Copy link
Author

Right from the start. It's rock solid exactly 2 seconds through the whole video. I'll try new image and report with updates

@eugeny-dementev
Copy link
Author

It's the same with new image with latest yt-dlp

@glubsy glubsy added the bug Something isn't working label Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working out of scope Relates to third party dependency
Projects
None yet
Development

No branches or pull requests

2 participants