caydey / ffshare

An android app to compress image, video and audio files through ffmpeg before sharing them
GNU General Public License v3.0
593 stars 27 forks source link

Highest quality video but under a specific file size. #43

Open Ryuo1 opened 1 year ago

Ryuo1 commented 1 year ago

I want to send high quality videos on Discord, but the app compresses them too much. 8mb.video solves this problem, but it's not offline.

What I want to say is, is there a way to compress the video just under 8 mb, but the highest quality possible under 8 mb.

meyverick commented 1 year ago

I'm facing a "similar" problem. I don't care about the quality of the video/image/sound but I need to get the best quality while being always under a specified size. Is it possible?

I mean an easy and automatic mode that choose the best qscale/crf for my file to respect the max size.

Also, a separate settings of max file size for each file type (image, video and audio) could be welcomed 🙂

Menelmacar commented 1 year ago

I don't think there exists an algo that knows the size before it actually transcodes. Something that works often but likely not the "best" just under 8mb would be possible by a self made algorithm after some try and error.. But is not really a solvable problem.

Ryuo1 commented 1 year ago

But 8mb.video and Steelseries Moments already do it?

Noitarud commented 3 months ago

In the parameters(which voids the other preferences in the options), Setting -b bitrate will limit the video stream bits per second, if you want 8mb you would have to know the resultant audio size before calculating. You can limit FPS with -r rate if you need quality over smoothness, stops shakey video (probably better options in ffm to stop that though).

Edit: there is a "Video Max file size", was this overlooked?

Menelmacar commented 1 month ago

Edit: there is a "Video Max file size", was this overlooked?

It didn't work the last time I tried that. But it's some time ago. I've found my preferred setting already, not involving that option...