react-native-compressor icon indicating copy to clipboard operation
react-native-compressor copied to clipboard

Video Quality lost

Open alihussainkabri opened this issue 1 year ago • 6 comments

when I am uploading video from my react native app then it was going to reduce the quality of the video.

alihussainkabri avatar Mar 15 '24 10:03 alihussainkabri

👋 @alihussainkabri Thanks for opening your issue here! If you find this package useful hit the star🌟!

github-actions[bot] avatar Mar 15 '24 10:03 github-actions[bot]

That's the goal of the package... If you reduce the size of your video/image a bit of the quality will be lost. if you think your video quality is too low, simply reduce the compression level It's not an issue, you can close it

serolgames avatar May 21 '24 11:05 serolgames

How can i reduce that can you give me snippet of the code

On Tue, 21 May 2024 at 4:56 PM, serolgames @.***> wrote:

That's the goal of the package... If you reduce the size of your video/image a bit of the quality will be lost. if you think your video quality is too low, simply reduce the compression level It's not an issue, you can close it

— Reply to this email directly, view it on GitHub https://github.com/numandev1/react-native-compressor/issues/278#issuecomment-2122416134, or unsubscribe https://github.com/notifications/unsubscribe-auth/APDLZVLTLUQI25RJSTJ5M6TZDMVN5AVCNFSM6AAAAABEXWTYN6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRSGQYTMMJTGQ . You are receiving this because you were mentioned.Message ID: @.***>

alihussainkabri avatar May 21 '24 11:05 alihussainkabri

This is a code I made to use compression in percent :

const videoCompressionLevel = 40;
                const originalVideoMetada : VideoMetada = await getVideoMetaData(result.assets[0].uri) as VideoMetada;
                const targetBitrate : number = Math.round((originalVideoMetada.size) / ((originalVideoMetada.duration / 60) * 0.0075) * (1 - (videoCompressionLevel / 100)))

                const compressedVideo = await VideoCompressor.compress(
                    result.assets[0].uri,
                    {
                    
                        progressDivider: 20,
                        maxSize: 1920,
                        bitrate: targetBitrate,
                        compressionMethod: "manual",
                        downloadProgress: (progress) => {
                            console.log('downloadProgress: ', progress);
                        },
                    },
                    (progress) => {
                        console.log('Compression Progress: ', progress);
                    }
                ); 
```  if this fits your needs, don't forget to close the issue 

serolgames avatar May 21 '24 14:05 serolgames

I have tried putting different values of Bitrate but I am getting the same Output every time

AryanGupta2002 avatar May 22 '24 10:05 AryanGupta2002

you need to put compressionMethod: "manual". I tried the way, I got different outputs but the quality is not good any any output.

srinu6 avatar Jun 24 '24 06:06 srinu6

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jun 25 '25 02:06 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Jul 03 '25 02:07 github-actions[bot]