I want to stream youtube videos on MPV but the videos are on VP9. I don't want that…
- User
I want to stream youtube videos on MPV but the videos are on VP9. I don't want that codec and would rather like to have h264. I have tried to stream a video with this "ytdl-format=bestvideo[height<=1080][fps<=30][vcodec!=h264]+bestaudio/best" in my MPV config file but it didn't work.
- Assistant
To achieve your goal of streaming YouTube videos in H.264 instead of VP9 using MPV, you can use the
ytdl-formatoption in your MPV configuration file to specify your preference for H.264 videos. The configuration line you tried is almost correct, but it has an error in logic because it's excluding H.264 ([vcodec!=h264]), which is the opposite of what you want. Instead, you should explicitly request H.264 videos. - User
It doesn't work. Videos are still on VP9.
- Assistant
- User
I removed +bestaudio/best from line and the videos are now on H264
- Assistant
Removing
+bestaudio/bestfrom the configuration line and having success suggests that the issue might have been with how the format selection string was interpreted byyt-dlporyoutube-dlwhen used in conjunction with MPV. By specifyingbestvideo[vcodec^=avc1]without the additional audio component, you've directedyt-dlpto prioritize selecting the best H.264 video stream available, without complicating the format selection with audio preferences in the same command.This solution works well if you're primarily concerned with avoiding VP9 for video decoding reasons, such as hardware compatibility or performance issues. However, it might not always guarantee the best audio quality available, as it doesn't explicitly request the best audio stream to accompany the video. In many cases, though, YouTube's default pairings of video and audio streams should still result in a satisfactory viewing experience, especially for casual viewing where the utmost audio fidelity isn't a primary concern.