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 327 forks source link

MP4s written on trim, but 1062 bytes and error when attempting to play #178

Closed BenBrostoff closed 6 years ago

BenBrostoff commented 6 years ago

Hello - great library first off, and thanks for building this.

Current Behavior

I can use VideoPlayer with a valid source and Trimmer renders as expected. When I invoke trim on the source with startTime and endTime options, I get an .mp4 back.

I can see these .mp4s in my Android Emulator (Samsung 8, API 26, Android 8.0 on Genymotion) via adb shell ls -l -t /storage/emulated/0/DCIM/Camera.

adb shell ls -l -t /storage/emulated/0/DCIM/Camera
total 308
-rw-rw---- 1 root sdcard_rw   1062 2018-07-07 20:47 MP4_20180707_204716_2650.mp4
-rw-rw---- 1 root sdcard_rw   1062 2018-07-07 20:47 MP4_20180707_204716_3530.mp4
-rw-rw---- 1 root sdcard_rw   1062 2018-07-07 20:47 MP4_20180707_204716_5110.mp4
-rw-rw---- 1 root sdcard_rw   1062 2018-07-07 20:47 MP4_20180707_204716_5620.mp4
-rw-rw---- 1 root sdcard_rw   1062 2018-07-07 20:47 MP4_20180707_204716_7920.mp4

However, all of the generated ones have 1,062 bytes and error out if I try to play them in QuickTime on my local machine (via adb pull) or through VideoPlayer.

Expected Behavior

Generated .mp4s are usable and of variable length.

I’m sure I’m doing something wrong here and any advice would be awesome. Thanks again.

Environment

software version
react-native-video-processing 1.7.1
react-native 0.55.4
node 8.9
shahen94 commented 6 years ago

Hi @BenBrostoff ! Can you please try on real device ?

BenBrostoff commented 6 years ago

Thanks for the quick response @shahen94 - this works on a real device (NS-P08A7100 / Android 6.0.1 - I know, it's several years old). Glad to add this as a PR if you think it's worth it - I think it makes sense to mention in the README or somewhere that this issue may happen on emulators.

shahen94 commented 6 years ago

@BenBrostoff Yes you're right. Just I don't have much time to work on this project.

I'll be happy to see improvements in this project.

BenBrostoff commented 6 years ago

Awesome, thanks again for the advice here.