Any tips on saving a YouTube stream (specifically, the ISS camera feed)? What yt-dlp saves is much lower bitrate than what I request it to fetch, and this seems to be a known bug of sorts.
@vruba Very basic but do you know about -F
and -f
? this gets me the 720p stream right now with yt-dlp version 2024.03.10: yt-dlp -f 311 'https://www.youtube.com/watch?v=P9C25Un7xaM'
@nelson I know about them but it’s possible I’m using them wrong. I picked a terrible time to post this, because the stream is both off and on the night side right now, but if you run that when it actually works, it seems to be much lower-quality than what plays in a browser at the same time.
@nelson Meaning: the 311 stream that it writes to disk does not in fact have the advertised bitrate.
@vruba FWIW trying another live source I get a 1080p h264 stream at 3748kbps. I'm not certain what bitrate the browser window gets but visual quality is roughly similar. So maybe it's working? yt-dlp -f 270 'https://www.youtube.com/watch?v=3LXQWU67Ufk'
(New mystery here; yt-dlp can't find the 1440p version of this one.)
@vruba hmm apologies then, you're asking a much more sophisticated question than I know the answer for. (I should have assumed that with you!)
@nelson No no, I’m over my head here.
@todrobbins @nelson The ISS stream is live again, and playing in the browser next to vlc playing the yt-dlp stream (with the settings above) shows pretty clear differences. The yt-dlp stream is oversharp on I-frames but struggles between them; it clearly isn’t good at the translational motion.
@todrobbins @nelson The saved stream is also super crunchy at the left edge, where new pixels appear, while the YT player handles them gracefully.
@vruba hm. I generally have had good luck playing things through Streamlink, and it looks like it can also write to disk. https://streamlink.github.io/cli.html#file-output-options
This is what I’m running:
yt-dlp --user-agent "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0" --cookies-from-browser firefox -f 311 "https://www.youtube.com/watch?v=P9C25Un7xaM"
I assume the problem here is that YT runs stuff browserside to negotiate up to the good stream, but I don’t know.