Skip to content
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

animated gif to webp, ffmpeg audio/video (webm) support #22

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

changhaitravis
Copy link

@changhaitravis changhaitravis commented Sep 24, 2019

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)

@ayastreb
Copy link
Owner

ayastreb commented Oct 4, 2019

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.

@changhaitravis
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants