shahen94 / react-native-video-processing

Native Video editing/trimming/compressing :movie_camera: library for React-Native
https://shahen94.github.io/react-native-video-processing/
MIT License
1.25k stars 325 forks source link

The quality of android compression #88

Open narychen opened 6 years ago

narychen commented 6 years ago

I just compressed a video taken by my android phone which size is 2160x3840 7.7 MB After compression I got a video with only 502KB 370x658 The compression is too much overhead. And when you watch the video you find it lost too much frames. On ios I use just the same parameter as the demo and it will downsize 1/3 of the raw video. On android you see it is 1/15

shahen94 commented 6 years ago

@narychen thanks for reporting this ! On iOS we're used bitrates to reduce video frames, but we didn't used it on android.

I have no time to work on it in these days, but if you could send the PR i'll merge right away.

Here's the example https://unix.stackexchange.com/a/38380 And starting point https://github.com/shahen94/react-native-video-processing/blob/master/android/src/main/java/com/shahenlibrary/Trimmer/Trimmer.java#L267

isAlmogK commented 6 years ago

Was this ever done or fixed on Andriod?

shahen94 commented 6 years ago

No - this wasn't done yet

gvillenave commented 6 years ago

@shahen94 can you reopen this issue? I'm going to try making a PR.

halilb commented 6 years ago

I used -crf flag to get better quality out of ffmpeg compression. This may cause worse compression performance on some low end devices but it works perfect otherwise.

Here is my commit if anyone is interested: https://github.com/halilb/react-native-video-processing/commit/20f2fafcf135b13eb0c2c1ac3e6b0b361bdcf7ef

huent-1493 commented 5 years ago

@narychen Do you compress video use function compress video of react-native-video-processing?