Video Compression Background Mode Expiration Limit
Hi, Is it possible to increase the time limit of video background compression? Currently I'm unable to compress a video of size 1GB in background due this limitation. The task automatically expires after some time while the compression was only completed 70-80% done. Also is it normal that large video (4k, 1GB) takes more than 30 seconds to compress? I am using the latest expo sdk (50.0.14) and react-native-compressor (1.8.24).
This is how I'm using the library
try {
const Compressor = isVideo ? VideoCompressor : ImageCompressor;
await VideoCompressor.activateBackgroundTask((data) => {
console.log("Background Mode Expired", data);
});
const compressed = await Compressor.compress(
realPath,
{
progressDivider: 10,
// compressionMethod: isVideo ? "manual" : "auto",
// ...(isVideo && { bitrate: 3000000 }),
},
(p) => {
console.log(
`File ${fileIndex + 1} Compression: ${Math.ceil(p * 100)}% complete`,
);
},
);
const compressedMetaData = await getMetaData(compressed);
metaData = compressedMetaData;
fileSize = metaData.size;
path = compressed;
await VideoCompressor.deactivateBackgroundTask();
} catch (error) {
throw error;
}
👋 @Hosam-hsm Thanks for opening your issue here! If you find this package useful hit the star🌟!
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.
This issue was closed because it has been stalled for 7 days with no activity.