I’m trying to concatenate N videos in one video.
I already tried many libraries, but without any success. The libraries I tried are:
None of them are working in the way I need, and can’t find any specific commands to merge videos without the need of audio.
I also tried these commands:
`-i ${videoPaths.join(' -i ')} -filter_complex concat=n=${videoPaths.length}:v=1:a=0 [v] -map [v] -vf "scale=w=720:h=trunc(ow/a/2)*2,setsar=1:1" -c:v libx264 -c:a none -shortest -y ${outputVideoPath}`;
`-i ${videoPaths.join(' -i ')} -filter_complex concat=n=${videoPaths.length}:v=1:a=0 -strict -2 ${outputVideoPath}`;
But nothing is working in the way I need.
2
Answers
Finally, I ended up with the sample code on the React Native Android end
By using the below NPM
As it looks like, you want to merge videos that don’t have audio.
As said on this issue on the react-native-video-editor, you can edit some lines of code on the library, so it does not process audio while merging the video, so it would fit your needs.
The files and lines you need to comment (or remove) are:
File
node_modules/react-native-video-editor/ios/RNVideoEditor.m
, lines 42 and 43:File
node_modules/react-native-video-editor/ios/RNVideoEditor.m
, lines 60 to 63:You can fork the react-native-video-editor repository, make these changes and save it, so you can install from your repository instead of the official repository (if you have a GitHub account, of course). If you don’t do this, you will need to edit these files on your
node_modules
every time you install the package.If you need to do it on Android too, I suppose you need to comment/remove these lines (I can’t test this, but as I read on the code, this should work):
File
react-native-video-editor/android/src/main/java/com/reactlibrary/RNVideoEditorModule.java
, lines 53, lines 57 to 59, lines 78 to 75: