question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

do compression for video as well

See original GitHub issue

This 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:open
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
brianvanburkencommented, Oct 26, 2019

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).

2reactions
mandaputtracommented, Nov 5, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Will compressing a video reduce its quality? - Quora
No. Zipping is lossless compression. However, most video files are already heavily compressed, so zipping them is not likely to make them any...
Read more >
The Why, What, and How of Video Compression - Explainly
Compressing, storing and sharing video can get complicated. ... losing too much quality, you can definitely compress below 10 Mbps as well.
Read more >
What is video compression and what does it do? - iStock Blog
As the name suggests, lossless compression compresses the video file with no loss of information or quality (visual image or audio) whatsoever.
Read more >
How To Compress a Video: Lower the Size but Not the Quality
Fortunately, we do have video compression to shrink those file sizes without losing video quality. Here's a primer on how compression works, ...
Read more >
How to Compress a Video Without Losing Quality: Guide - Artlist
264 is your best codec option. It is extremely well optimized to maximize quality while minimizing file size. This is crucial for reducing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found