LightCompressor icon indicating copy to clipboard operation
LightCompressor copied to clipboard

Compression quality does not change the final size

Open james04gr opened this issue 3 years ago • 0 comments

I have a Samsung S22 with Android 12 device. I use CameraX to record a video with my application. I set the VideoCapture like below

videoCapture = VideoCapture.Builder().apply { setAudioBitRate(44_000) setVideoFrameRate(30) setTargetResolution(Size(720, 1080)) setBitRate(50_000) setAudioChannelCount(1) }.build()

The captured video has duration 1minute and is about 9.5MB size. After the capture i compress the video with the below configuration VideoCompressor.start( context = applicationContext, uris = uris, isStreamable = false, storageConfiguration = StorageConfiguration( isExternal = false ), configureWith = Configuration( quality = quality, isMinBitrateCheckEnabled = false, videoBitrate = null, disableAudio = false, keepOriginalResolution = false ), listener = object : CompressionListener { ...

As i can see in the OnSuccess callback, the output size is almost the same regardless of the quality i choose. Specifically i see that

  • Initial Video Size ~9.6MB (1.mp4) ULTRA_LOW quality ---> Compress Size 8494341 Bytes (8.49MB)

  • Initial Video Size ~9.5MB (2.mp4) VERY_HIGH quality ---> Compress Size 8499488 Bytes (8.49MB)

I attach the 2 videos in case you want to make some tests https://www.mediafire.com/file/pgfogpcyukqibqw/1.mp4/file https://www.mediafire.com/file/gb9ihpsfpzpk9vv/2.mp4/file

Why is this happening?

james04gr avatar Aug 31 '22 14:08 james04gr