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

Add support for high-res video. #1292

Closed
wants to merge 1 commit into from

Conversation

nolliag
Copy link

@nolliag nolliag commented Sep 30, 2024

Summary

This PR adds support for playing high-res video (with audio) via the vlc and mpv players.

Details

YT started splitting high-res video and audio into separate streams some time ago. The only stream that typically combines the two is the low-res 360p phone-compatible stream.

This PR addresses issue #942, by leveraging the ability for mpv and vlc to accept separate audio and video streams as CLI parameters. (See separate note below for mplayer.)

This PR is a more general solution than thatonearchguy's #1284 PR, leveraging the current URL handling architecture.

Compatibility Note

While mplayer does provide support for loading and playing a separate audio file, mplayer will only load local files and does not support streaming from remote URLs. Due to this limitation, this PR leaves the default functionality untouched for mplayer (meaning it will only play the 360p streams).

Code Formatting Note

I followed the PEP-8 standards for most of the code except where that would conflict with the existing code formatting (long lines). I'm more than happy to adjust that (or anything else) based on feedback!

Testing

Testing was manual. I've been running these changes for the past few months on Linux.

These changes have also been tested on Windows and work for vlc and mpv.

I also verified that the download feature continues to work, although it is unlikely this change would have affected it as it uses the built-in yt-dlp download functionality via pafy.

Known Issues

Having run this for a couple months, I've noticed two occasions where mpv would play the video, but not the audio stream. This seems to have been due to a network failure when mpv attempted to retrieve the audio stream. Stopping the stream and restarting it fixed the problem in both cases.

…ilable. Update vlc and mpv facades with separate audio streams.
@nolliag nolliag changed the base branch from master to develop September 30, 2024 17:17
@nolliag nolliag changed the base branch from develop to master September 30, 2024 17:19
@nolliag nolliag closed this Sep 30, 2024
@nolliag nolliag deleted the play-high-res-video branch September 30, 2024 17:23
@henkmet
Copy link

henkmet commented Oct 1, 2024

Why did you close this pr?

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

Successfully merging this pull request may close these issues.

2 participants