bandwidth-hero-proxy
bandwidth-hero-proxy copied to clipboard
animated gif to webp, ffmpeg audio/video (webm) support
Hi, can you create a "beta" branch or something to track the upstream development of new features?
I'm upstreaming added features to bandwidth-hero because I've added
- animated GIF to webp (apng is already efficient, so it's allowed to pass through under a certain size) GIFs do not get converted to B&W...
- ffmpeg audio/video (vp9/opus webm) support for media tag. Videos do not get the B&W video filter applied, although that would be a minor change.
- Content-Disposition filename is well formatted and helps with image save as attempts being properly named.
- Compression now attempts to compress more aggressively at larger file sizes/lower resolutions.
- Packages updates
I also tried handling streaming videos such as DASH and HLS, but it's far more difficult to detect (esp. youtube videos) and handle, so I'm only doing non-streaming videos and audio for now. It may involve a different code path that handles xhr.
Media (
Again, my chrome testing has been sparse, and the animated GIF support does write to os.tmpdir() which may be undesired. I may sneak in a revision to put in environment variables to turn this (animated GIF support) off, and control the max video resolution cap, "-cpu-used" value, as well as the audio/video bitrate target multipliers.
Finally feel free to squash my last 5 commits together, those were me trying to get it to work better on google cloud functions (dead end for media feature)
hi @changhaitravis thanks for contributing! Sorry, I don't have much time now, will try to get a look/test/merge it in the few next weeks.
No worries, I'm probably going to update it this weekend so that the gif and media functionality can be disabled or have the bitrate multipliers and resolution and duration caps exposed and controlled using environment variables.
I've been using the new ffmpeg feature for a little over a week now running under a google cloud free-tier "micro" VM, and the current configuration is optimized for that, and I may leave these values as default.