RaspberryCast
RaspberryCast copied to clipboard
High Quality Youtube Playback
The way Youtube delivers media files now is by splitting them up into 2 separate streams of audio only and video only. Unfortunately, it isn't possible to get a fully muxed stream that has decent quality anymore.
I attempted to mux using ffmpeg, but the speed was nowhere near sufficient to give a smooth stream. In the end, the only option that really worked out is have Youtube-dl download the video and audio, mux it into a local file and then have omxplayer play this file.
The video file gets removed as soon as playback is finished as to not cause hard drive clutter on already limited space like an RPi.
Closes #60
Hello! Thank you for your contribution :)
When we first made RaspberryCast we were using os.system
to use youtube-dl but it turns out it is much much slower than using the youtube_dl Python bindings. Switching to them saved a few seconds of processing for each videos.
Isn't it possible to use these the bindings in this case?
Alright, first things first, I fixed the deletion mechanism. I really don't know what I was thinking when I wrote this and figured "rm -rf is a great idea!". That should be fixed by using python's removal now, hooray!
Furthermore, I tried implementing native youtube-dl calls. It seems to work so far.
Code seems cleaner now, nice! I'll have a proper look and test it on my PI during the weekend :slightly_smiling_face: