numandev1 / react-native-compressor

🗜️Compress Image, Video, and Audio same like Whatsapp 🚀✨

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Video compression breaks video stream compatibility

serolgames opened this issue · comments

Hello ! I hope you're doing well.

Sorry to be back with bad news 😅

Maybe there is a workaround but I have the following issue :

In my app I can upload videos to a s3 bucket. And then the videos can be streamed by users in my app.
In the concept there is nothing complicated or difficult to set. I put manually a video in my s3 bucket and stream it perfectly in my app.
BUT if I use the app to upload videos, then the stream doesn't work and the video needs to be fully loaded before being playable.
And that's because of the compression. I tried with compression ❌ no streaming. I tried without compressing the video with your package ✅ streaming !

So, maybe you use an encoding or format that leads the stream to fail ?

Thank you !

Platform

  • Android
  • iOS

React Native Version

0.72.5

React Native Compressor Version

1.8.16

@serolgames now a days, i am very busy, hopefully i will check it after 6 to 7 days

Hello !
Hope your doing well

Any news about this problem ?

same here, looks like only happened for android

Hello,,,,,same here ! Is there any fix to this issue ?

Maybe I´m experimenting this same issue: #268

any update for this issue?

Can someone upload a demo of the issue?
I have one video with this error, but I can't upload because is private from our customer.

the issue for me is after the client uploads the compression video to the backend, the backend will use ffmpeg with the command line to generate base64 placeholder cmd := exec.Command("ffmpeg", "-i", "pipe:0", "-vframes", "1", "-q:v", "1", "-f", "singlejpeg", "pipe:1"). the error with pipe is [mov,mp4,m4a,3gp,3g2,mj2 @ 0x151f04950] stream 0, offset 0x2c: partial file [mov,mp4,m4a,3gp,3g2,mj2 @ 0x151f04950] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 640x360, 1676 kb/s): unspecified pixel format Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options

somehow the file stream is broken when uploaded by Android with this library (ios is fine)

@numandev1
Hello, any update for this issue ?

Have there been any updates here? I'm having trouble too

commented

For those who are suffering from this issue until now:

I found that this issue is because the result file actually not for faststart (moov flags should be placed before mdat, but this isn't). It can simply fixed by using ffmpeg to the result like this

ffmpeg -i result.mp4 -c copy -movflags faststart result_streamable.mp4

But this is not the happiest solution since it needs extra dependency(ffmpeg) which is quite heavy. But then, I figured out this library already have the logic for making result streamable, but it is disabled intentionally.

After enable the logic, fix some bug, I can finally get the file that may be streamable. Every probe tools said that the moov of the file is before mdat, and video is playable via player. But in browser, it is still unstreamable. I guess there is some other logical error in "convert" function in Streamable.kt

Since I'm not the media expert nor kotlin developer, I can't help but stop here.
I hope this helps someone

I am facing same issue. Is there any solution to resolve it

For those who are suffering from this issue until now:

I found that this issue is because the result file actually not for faststart (moov flags should be placed before mdat, but this isn't). It can simply fixed by using ffmpeg to the result like this

ffmpeg -i result.mp4 -c copy -movflags faststart result_streamable.mp4

But this is not the happiest solution since it needs extra dependency(ffmpeg) which is quite heavy. But then, I figured out this library already have the logic for making result streamable, but it is disabled intentionally.

After enable the logic, fix some bug, I can finally get the file that may be streamable. Every probe tools said that the moov of the file is before mdat, and video is playable via player. But in browser, it is still unstreamable. I guess there is some other logical error in "convert" function in Streamable.kt

Since I'm not the media expert nor kotlin developer, I can't help but stop here. I hope this helps someone

@numandev1 Look like it's a possible fix. Do you still work on the library ?

The issue is still there. Any news ?