New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow user to disable video in the player #2014
Comments
Hi, I guess that if you're on another tab, your web browser optimize video playing so the CPU overhead is insignificant. Regarding bandwidth, h264 is very good at optimizing static images so again, the overhead is insignificant. We don't want to add this complexity in PeerTube for so little gain.
People can already upload audio files if their admin allows it. |
@Chocobozzz the CPU overhead might be insignificant but what about data transfer? Is h264 that efficient? |
Also, music videos might not necessarily have a static image. There could be animation, or an actual music video playing, which would take a lot of bandwidth and cpu for transmission and decoding. |
I see a few possibilities here which could help to improve the utility of PT in these situations:
While h264 is an effective codec it still adds overhead for any static image added to the stream. Testing with Firefox (nightly, 72.0a1) on my lowly Thinkpad T42p makes the thing jump to 100% CPU when playing audio tracks with static imagery (~50% Web Content, ~13% GPU Process, ~10% firefox-72.0a1 and some other related stuff). Playing a true audio-only stream in a browser takes no more than 10% so there is a marked difference.While PeerTube is a video streaming platform and as such does not focus on audio-only content it probably does not take that much work to add true audio-only content (possibly with a static image (as in jpeg instead of h264) where the video would be). I'll do some experiments around this theme as such a facility would be a marked improvement for one of my use cases: video lectures. Listening to such while on the road gobbles up ~400MB/hour for a low-res video version while audio-only versions don't take much more than ⅒ of that. |
I made a proof of concept of how this could work by adding a Here are the resulting files after uploading a 5 minute music video with a still image:
...and here's how the player presents these 'resolutions': Playing the Further enhancements would include:
As to whether something like this should become part of PeerTube remains to be seen. While this implementation works it is far from ideal. A better solution would be to serve audio and video as separate streams which get combined in the player as this makes it possible to offer multiple audio streams for a given video. This might wreak havoc with the p2p streaming functionality as it doubles the number of streams which need to arrive in a timely fashion. Combining the streams on the server comes with its own issues related to server load and less efficient use of the torrent swarm. |
The player now:
These changes can be found in the https://github.com/Yetangitu/PeerTube/tree/audio-only I won't do a pull request yet as I don't think this is the best way to achieve audio-only playback, it just happens to be the easiest way and as such the one I chose for this proof-of-concept. |
@Yetangitu honestly that looks great to me, maybe there could be other (better?) ways to do it, but as a first test to see how people feel about it, this seems pretty nice to me! |
Wouldn't a PR actually be a great way to discuss this and see what the response is? |
I think this is too much of a hack to add it permanently to PeerTube, hence my reticence to submit a PR. I made it to test the feasibility of using the standard player and P2P distribution methods to play audio-only files, this turns out to work just fine so now it is time to think about a more versatile way of handling audio and video streams. If the idea of having separate audio and video streams does not pan out this method could be revisited. @Chocobozzz, @Nutomic, any ideas on this subject? |
BTW, I looked a bit into the differences between |
@Yetangitu I think you should make a PR, even if it is hacky. Discussing your changes across different issues and without seeing the code sucks. |
OK, I'll submit it and see where the discussion goes. Edit: done, see #2213 |
Enhancement
Add an option in the player to allow user to disable video (play and download only soundtrack).
Why?
When playing music videos, I don't care about the image. Disable video would reduce used bandwidth and CPU.
Next step?
Allow to upload sound files? Allow to disable video by default when editing video settings.
The text was updated successfully, but these errors were encountered: