Skip to content

[Error] While compressing 4k video #343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
rishabh-arch opened this issue Apr 5, 2025 · 1 comment
Open
1 task done

[Error] While compressing 4k video #343

rishabh-arch opened this issue Apr 5, 2025 · 1 comment

Comments

@rishabh-arch
Copy link

rishabh-arch commented Apr 5, 2025

Current behavior

I am trying to compress this video with "auto" and "manual" both
video link - https://signage-video-list-aws.s3.ap-south-1.amazonaws.com/video-1739112485062.mp4
video is 4k resolution.

metadata  - 
length : 20 sec
frame width : 3840
frame height : 2160
bitrate : 24551kbps

whenever i try to compress it throws an error

[java.lang.Throwable: java.lang.Throwable]

Expected behavior

I thought it will work on other device who have more memory. But still issue is same in all devices. but other videos under 1920 works fine.

Platform

  • Android

React Native Version

0.77

React Native Compressor Version

"react-native-compressor": "^1.11.0",

Reproducible Steps And Demo

const compressionCallback = async (uri: string) => {
   const { compress } = compression;
   if (compress) {
     console.log("url123", url);
     const compressedUri = await Video.compress(uri, {
       compressionMethod: "manual",
       downloadProgress: (progress) => {
         // console.log("Compression progress:", progress);
         setProgress(progress);
       },
       progressDivider: 1,
       bitrate: 2_800_000,
       maxSize: 720,
     }).catch((err) => {
       console.log("Error in compression", err);
       return uri;
     });
     const newFilePath = `${downloadFolder}${fileName}`;
     console.log("Compressed file saved to:", newFilePath);
     const meta = await getVideoMetaData(compressedUri);
     console.log("MetaData", meta);
     await FileSystem.moveAsync({
       from: compressedUri,
       to: newFilePath,
     });
     return newFilePath;
   }
   return uri;
 };
Copy link

github-actions bot commented Apr 5, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant