-
Notifications
You must be signed in to change notification settings - Fork 139
High Quality Youtube Playback #81
base: master
Are you sure you want to change the base?
Conversation
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 vincelwt#60
|
Hello! When we first made RaspberryCast we were using Isn't it possible to use these the bindings in this case? |
process.py
Outdated
| ) | ||
| if "/tmp/" in url: | ||
| os.system( | ||
| "rm -rf " + url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line sort of scares me - is there not a safer way to do this? 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You know, you're right. That wasn't a good idea. Sorry, this is my first time playing around with python, I'm still getting used to it. I'll look into it!
Using `rm -rf` was quite frankly a terrible idea, this way only a file can be deleted, minimizing potential harm.
In theory, this should increase speed of the youtube-dl processing. I have not tested the speed advantage much, but what could go wrong with calling native bindings?
|
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 🙂 |
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