do compression for video as well
See original GitHub issueThis extension uses a heroku instance to change jpg/png to .webp. Siince .webp images are usually smaller, this saves bandwidth.
Some sites now have short preview videos which are typically encoded in H.264. I would like to save bandwidth with videos as well, by converting h.264 to h.265. The conversion will typically reduce video size by 50-65%.
For example, assuming the heroku instance has “ffmpeg” command available (there are packs on github that provide a static “ffmpeg” executable for heroku), a sample convert would look like
ffmpeg -i input.mp4 -c:v hevc output.mp4
and the h.265 video (output.mp4) would be sent to chrome, which can be played at the user’s end (using this extension for example)
How would I go about achieving this? Which files would I have to change/modify? Thanks.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top GitHub Comments
This sounds like a great idea!
An approach is to change this extension to also catch videos. First add
media
(https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/ResourceType) to catch video and audio. Then the extension must determine if the URL is a video link. Then it should redirect the URL to the proxy with an added flag to signal the proxy that it is a video. In the proxy (https://github.com/ayastreb/bandwidth-hero-proxy), the video must be downloaded, converted, and send back. I think the proxy must supported streaming so that it won’t reach limits on heroku free tier.It’s best to start with figuring out if the proxy can support the downloading, conversion and maybe streaming within a limited heroku instance (free tier).
I actually trying to compress youtube video when streaming. Still no luck and the server itselft are too hot (using much ram) to process the compresion. I use fluent-ffmpeg
And youtube player would not want to play from another source.
But compress the video and play using another player may success