numandev1 / react-native-compressor

🗜️Compress Image, Video, and Audio same like Whatsapp 🚀✨
MIT License
909 stars 85 forks source link

Compressed video on Android is not playable on macOS or iOS #268

Open noelsp opened 8 months ago

noelsp commented 8 months ago

Current behavior

It seems to be a specific problem in the combination of this video and a cell phone model. On a Xiaomi Redmi Note 10 model phone, this attached video seems to compress well, but it is only playable on Android. On iOS or macOS (QuickTime Player) it cannot be played. Possibly it is some problem with the codecs, but we don't know how to debug this.

Hundreds of videos are uploaded a week in our app and we had not previously detected compatibility problems.

Expected behavior

Like many other videos that are compressed on Android phones, it plays on iOS without any problem.

Platform

React Native Version

React Native Compressor Version

Reproducible Steps And Demo

github-actions[bot] commented 8 months ago

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

huynhhq commented 5 months ago

same here +1

barbarossusuz commented 5 months ago

same here +1

noelsp commented 4 months ago

@numandev1 Could you help us with this problem? More and more users are reporting this problem in our app. We would really appreciate it.

numandev1 commented 4 months ago

@noelsp hopefully today i will debug it

jpdelorenzo commented 4 months ago

same here +1

noelsp commented 4 months ago

@noelsp hopefully today i will debug it

Thank you! I remain attentive to any news

noelsp commented 4 months ago

Hi, do you have some news? @numandev1 Is there anything we can help with?

Titozzz commented 4 months ago

Maybe fixed by https://github.com/numandev1/react-native-compressor/pull/290?

noelsp commented 4 months ago

Maybe fixed by #290?

I just tried it, and we still have problems playing the compressed video on iOS.

This is the output after compressing, you can download it here: https://cuadernorojo-images.s3-us-west-2.amazonaws.com/uploads/activities/clwze9o53003l09jw45mngitv/2ed9864e-ce1b-495b-bbe8-1889cc2ec064.mp4

noelsp commented 3 months ago

Hi @numandev1 do you have some news?

numandev1 commented 3 months ago

@noelsp Sorry I was busy in an emergency so I was not able to work, I will work at tonight

NguyenHoangMinhkkkk commented 3 months ago

hi. im facing issue but different.

    const cmp = await RNVideoCompressor.compress(response.path, {
      maxSize: 1920,
      bitrate: 10,
      compressionMethod: 'manual',
    }).catch(er => {
      console.log('==========er-er=======', er);
    });

select and compress video from android phone -> unable to play compressed video after compressed, but when i upload it to network api, then ios device can play it im using react-native-video for playing video

caesar4321 commented 3 months ago

Same here. Hopefully find the solution soon!!

caesar4321 commented 3 months ago

@noelsp Sorry I was busy in an emergency so I was not able to work, I will work at tonight

I found that it's not for every Android phone. For example, one of my users use Oppo RMX3710 | Android 13, and the video is playing well on iOS, while I use Samsung SM-M236L | Android 14 and the video compressed on my phone won't play on iOS.

caesar4321 commented 3 months ago

Same here. Hopefully find the solution soon!!

On Nokia C20 with Android 11, the compressed video only plays the audio part of the video, not the visual frames of the video.

noelsp commented 3 months ago

Hi, do you have some news? @numandev1 This bug is increasing in our users 😢

correalm commented 2 months ago

Hello, this issue continues to occur in the version 1.8.25. Some news?

jpdelorenzo commented 1 month ago

Any news?

ChristopherGabba commented 2 weeks ago

Good afternoon @numandev1 and everyone. I appreciate this package and all the hard work that has gone into it.

However, I am also experiencing this issue.

I'm recording a video with Google Pixel 4 (I know its an old phone but still works), I run the typical code from the docs:

    const result = await VideoCompress.compress(inputFilePath, {
      compressionMethod: "auto",
      progressDivider: 10,
      downloadProgress: (percent) => {
        !!onProgress && onProgress(Math.round(percent))
      },
    })

I then upload it to S3. When I try to view that video on my iPhone using expo-video package, I get a Cannot decode error and it appears stuck on the first frame.

Perhaps there are some compression settings / workarounds for this?

I am 100% certain it has something to do with how this compression is working on Android because if I comment out the compression and upload the original "non-compressed" file, it plays fine on my iPhone.

commbits commented 5 days ago

Any updates on this? The issue is still not fixed in 1.9.0.