-
-
Notifications
You must be signed in to change notification settings - Fork 43
Compression quality: can we add more detailed settings? #50
Comments
I just compared FFmpeg and Swift native on macOS and FFmpeg is on average 10X slower for video compression. I was using media_tool_flutter which is a little faster than light_compressor in my tests. @delfme, do you have better results or why you avoid the native iOS version? |
@starkdmi sorry this got lost. Isn't https://github.com/starkdmi/media_tool_flutter slow on android due to lack of native implementation? |
@starkdmi for us ffmpeg is slow only on android, it depends on the command you are using to compress video. |
@delfme yes, media_tool supports ios/mac only as for now, ffmpeg was a temporary fix for other platforms but no real demand here. As for compression options of light_compressor package, isn't |
Yes indeed this was our workaround. What performance are you achieving on android with ffmpeg and hevc_mediacodec and hevc_videotoolbox codecs? |
@delfme, to try those codecs:
Use:
For HEVC add For faster playback start time you can try adding Note that hardware accelerated codecs could provide worse results, and aren't always faster but more efficient, adjust your quality if needed. |
Thx will try those ones. Did you try unltrafast without r and g, and crt 28? It is fast on our side. String command = "-i $_filePath -c:v libx264 -crf 28 -preset ultrafast $outputPath"; |
@delfme ultrafast produce larger files, I prefer default presets, you could just lower quality for playback on mobiles (via crf). There is also libx265 for you to try. I do not use g (keyframe interval), r (frame rate) under 30 is a good choice (excluding slo-mo). |
Hello,
We are testing the plugin and like it very much.
However, to get better results for our use case, we would need to set compression options.
For example, let's us consider an input File with size: 13.66MB
On iOS, FFMPEG is fast:
result is 3.96MB in 2.5 sec, which is our reference
With veryfast preset and below settings for -g and -r
String command = "-i $_filePath -c:v libx264 -crf 23 -preset veryfast -g 12 -r 25 $outputPath";
On Android (mid-end phone) , it performs poorly, mostly due to Dart:
5.81MB in 6.39 sec
On Android with LightCompressor, we get better results than FFMPEG:
For this specific case, we would like to get about
3,5-4MB in 2.5-3sec
and we think this would be possible if we had a way to set compression options.Can you please add this feature?
The text was updated successfully, but these errors were encountered: