RaspberryCast icon indicating copy to clipboard operation
RaspberryCast copied to clipboard

High Quality Youtube Playback

Open Wolvan opened this issue 6 years ago • 3 comments

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

Wolvan avatar Oct 01 '18 18:10 Wolvan

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?

vincelwt avatar Oct 02 '18 12:10 vincelwt

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.

Wolvan avatar Oct 11 '18 12:10 Wolvan

Code seems cleaner now, nice! I'll have a proper look and test it on my PI during the weekend :slightly_smiling_face:

mheine avatar Oct 12 '18 12:10 mheine