tanersener / react-native-ffmpeg

FFmpeg for react-native. Not maintained anymore. Superseded by FFmpegKit.
GNU General Public License v3.0
400 stars 51 forks source link

executeWithArguments gets exexcuted multile times #136

Closed iamadityaaz closed 4 years ago

iamadityaaz commented 4 years ago

Description When i am trying to trim a video in multiple parts by using for loop to loop over it, it gets repeated execution of same commands multiple time (3 times) look at the image of the console. my code : Screenshot from 2020-02-23 14 58 05

Expected behavior The log should be printed once only.

Current behavior but gets printed multiple times (3)

Screenshots Screenshot from 2020-02-23 14 58 37

Logs

index.js:177 Console was cleared
index.js:92 Loading react-native-ffmpeg.
infoLog.js:16 Running "svs" with {"rootTag":11}
index.js:99 Loaded react-native-ffmpeg-android-arm64-v8a.
App.js:59 Response =  {path: "/storage/emulated/0/VidMate/download/Lewis_Capaldi____Someone_you_loved__abudy_cover_.mp4", uri: "content://com.google.android.apps.photos.contentpr…dia%2F247313/ORIGINAL/NONE/video%2Fmp4/2038095314"}
index.js:81 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/VidMate/download/Lewis_Capaldi____Someone_you_loved__abudy_cover_.mp4':

index.js:81   Metadata:

index.js:81     major_brand     : 
index.js:81 isom
index.js:81 

index.js:81     minor_version   : 
index.js:81 512
index.js:81 

index.js:81     compatible_brands: 
index.js:81 isomiso2avc1mp41
index.js:81 

index.js:81     title           : 
index.js:81 513949139257045
index.js:81 

index.js:81     encoder         : 
index.js:81 Lavf57.25.100
index.js:81 

index.js:81   Duration: 
index.js:81 00:00:51.99
index.js:81 , start: 
index.js:81 0.000000
index.js:81 , bitrate: 
index.js:81 568 kb/s
index.js:81 

index.js:81     Stream #0:0
index.js:81 (eng)
index.js:81 : Video: h264 (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1080x1080, 499 kb/s
index.js:81 , 
index.js:81 30 fps, 
index.js:81 30 tbr, 
index.js:81 15360 tbn, 
index.js:81 60 tbc
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 VideoHandler
index.js:81 

index.js:81     Stream #0:1
index.js:81 (eng)
index.js:81 : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 SoundHandler
index.js:81 

App.js:106 Result:  {streams: Array(2), metadata: {…}, rawInformation: "Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/…  Metadata:↵      handler_name    : SoundHandler↵", bitrate: 568, duration: 51990, …}
App.js:116 parts :  1
index.js:81 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/VidMate/download/Lewis_Capaldi____Someone_you_loved__abudy_cover_.mp4':

index.js:81   Metadata:

index.js:81     major_brand     : 
index.js:81 isom
index.js:81 

index.js:81     minor_version   : 
index.js:81 512
index.js:81 

index.js:81     compatible_brands: 
index.js:81 isomiso2avc1mp41
index.js:81 

index.js:81     title           : 
index.js:81 513949139257045
index.js:81 

index.js:81     encoder         : 
index.js:81 Lavf57.25.100
index.js:81 

index.js:81   Duration: 
index.js:81 00:00:51.99
index.js:81 , start: 
index.js:81 0.000000
index.js:81 , bitrate: 
index.js:81 568 kb/s
index.js:81 

index.js:81     Stream #0:0
index.js:81 (eng)
index.js:81 : Video: h264 (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1080x1080, 499 kb/s
index.js:81 , 
index.js:81 30 fps, 
index.js:81 30 tbr, 
index.js:81 15360 tbn, 
index.js:81 60 tbc
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 VideoHandler
index.js:81 

index.js:81     Stream #0:1
index.js:81 (eng)
index.js:81 : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 SoundHandler
index.js:81 

index.js:81 Output #0, mp4, to '/storage/emulated/0/VidMate/download/Lewis_Capaldi____Someone_you_loved__abudy_cover_.mp4-split-0.mp4':

index.js:81   Metadata:

index.js:81     major_brand     : 
index.js:81 isom
index.js:81 

index.js:81     minor_version   : 
index.js:81 512
index.js:81 

index.js:81     compatible_brands: 
index.js:81 isomiso2avc1mp41
index.js:81 

index.js:81     title           : 
index.js:81 513949139257045
index.js:81 

index.js:81     encoder         : 
index.js:81 Lavf58.35.101
index.js:81 

index.js:81     Stream #0:0
index.js:81 (eng)
index.js:81 : Video: h264 (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1080x1080, q=2-31, 499 kb/s
index.js:81 , 
index.js:81 30 fps, 
index.js:81 30 tbr, 
index.js:81 15360 tbn, 
index.js:81 15360 tbc
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 VideoHandler
index.js:81 

index.js:81     Stream #0:1
index.js:81 (eng)
index.js:81 : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 SoundHandler
index.js:81 

index.js:81 Stream mapping:

App.js:141 Splitted succesfiully 0
index.js:81   Stream #0:0 -> #0:0
index.js:81  (copy)
index.js:81 

index.js:81   Stream #0:1 -> #0:1
index.js:81  (copy)
index.js:81 

index.js:81 Press [q] to stop, [?] for help

index.js:81 
index.js:81 frame=  842 fps=0.0 q=-1.0 Lsize=    1918kB time=00:00:29.97 bitrate= 524.0kbits/s speed= 815x    

index.js:81 video:1660kB audio:236kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 
index.js:81 1.155786%
index.js:81 

index.js:81 
index.js:81 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/VidMate/download/Lewis_Capaldi____Someone_you_loved__abudy_cover_.mp4':

index.js:81   Metadata:

index.js:81     major_brand     : 
index.js:81 isom
index.js:81 

index.js:81     minor_version   : 
index.js:81 512
index.js:81 

index.js:81     compatible_brands: 
index.js:81 isomiso2avc1mp41
index.js:81 

index.js:81     title           : 
index.js:81 513949139257045
index.js:81 

index.js:81     encoder         : 
index.js:81 Lavf57.25.100
index.js:81 

index.js:81   Duration: 
index.js:81 00:00:51.99
index.js:81 , start: 
index.js:81 0.000000
index.js:81 , bitrate: 
index.js:81 568 kb/s
index.js:81 

index.js:81     Stream #0:0
index.js:81 (eng)
index.js:81 : Video: h264 (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1080x1080, 499 kb/s
index.js:81 , 
index.js:81 30 fps, 
index.js:81 30 tbr, 
index.js:81 15360 tbn, 
index.js:81 60 tbc
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 VideoHandler
index.js:81 

index.js:81     Stream #0:1
App.js:106 Result:  {streams: Array(2), metadata: {…}, rawInformation: "Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/…  Metadata:↵      handler_name    : SoundHandler↵", bitrate: 568, duration: 51990, …}
App.js:116 parts :  1
index.js:81 (eng)
index.js:81 : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 SoundHandler
index.js:81 

index.js:81 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/VidMate/download/Lewis_Capaldi____Someone_you_loved__abudy_cover_.mp4':

index.js:81   Metadata:

index.js:81     major_brand     : 
index.js:81 isom
index.js:81 

index.js:81     minor_version   : 
index.js:81 512
index.js:81 

index.js:81     compatible_brands: 
index.js:81 isomiso2avc1mp41
index.js:81 

index.js:81     title           : 
index.js:81 513949139257045
index.js:81 

index.js:81     encoder         : 
index.js:81 Lavf57.25.100
index.js:81 

index.js:81   Duration: 
index.js:81 00:00:51.99
index.js:81 , start: 
index.js:81 0.000000
index.js:81 , bitrate: 
index.js:81 568 kb/s
index.js:81 

index.js:81     Stream #0:0
index.js:81 (eng)
index.js:81 : Video: h264 (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1080x1080, 499 kb/s
index.js:81 , 
index.js:81 30 fps, 
index.js:81 30 tbr, 
index.js:81 15360 tbn, 
index.js:81 60 tbc
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 VideoHandler
index.js:81 

index.js:81     Stream #0:1
index.js:81 (eng)
index.js:81 : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 SoundHandler
index.js:81 

index.js:81 Output #0, mp4, to '/storage/emulated/0/VidMate/download/Lewis_Capaldi____Someone_you_loved__abudy_cover_.mp4-split-0.mp4':

index.js:81   Metadata:

index.js:81     major_brand     : 
index.js:81 isom
index.js:81 

index.js:81     minor_version   : 
index.js:81 512
index.js:81 

index.js:81     compatible_brands: 
index.js:81 isomiso2avc1mp41
index.js:81 

index.js:81     title           : 
index.js:81 513949139257045
index.js:81 

index.js:81     encoder         : 
index.js:81 Lavf58.35.101
index.js:81 

index.js:81     Stream #0:0
index.js:81 (eng)
index.js:81 : Video: h264 (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1080x1080, q=2-31, 499 kb/s
index.js:81 , 
index.js:81 30 fps, 
index.js:81 30 tbr, 
index.js:81 15360 tbn, 
index.js:81 15360 tbc
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 VideoHandler
index.js:81 

index.js:81     Stream #0:1
index.js:81 (eng)
index.js:81 : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 SoundHandler
index.js:81 

index.js:81 Stream mapping:

index.js:81   Stream #0:0 -> #0:0
index.js:81  (copy)
index.js:81 

index.js:81   Stream #0:1 -> #0:1
index.js:81  (copy)
App.js:141 Splitted succesfiully 0
index.js:81 

index.js:81 Press [q] to stop, [?] for help

index.js:81 
index.js:81 frame=  842 fps=0.0 q=-1.0 Lsize=    1918kB time=00:00:29.97 bitrate= 524.0kbits/s speed= 865x    

index.js:81 video:1660kB audio:236kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 
index.js:81 1.155786%
index.js:81 

index.js:81 
index.js:81 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/VidMate/download/Lewis_Capaldi____Someone_you_loved__abudy_cover_.mp4':

index.js:81   Metadata:

index.js:81     major_brand     : 
index.js:81 isom
index.js:81 

index.js:81     minor_version   : 
index.js:81 512
index.js:81 

index.js:81     compatible_brands: 
index.js:81 isomiso2avc1mp41
index.js:81 

index.js:81     title           : 
index.js:81 513949139257045
index.js:81 

index.js:81     encoder         : 
index.js:81 Lavf57.25.100
index.js:81 

index.js:81   Duration: 
index.js:81 00:00:51.99
index.js:81 , start: 
index.js:81 0.000000
index.js:81 , bitrate: 
index.js:81 568 kb/s
index.js:81 

index.js:81     Stream #0:0
index.js:81 (eng)
index.js:81 : Video: h264 (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1080x1080, 499 kb/s
index.js:81 , 
App.js:106 Result:  {streams: Array(2), metadata: {…}, rawInformation: "Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/…  Metadata:↵      handler_name    : SoundHandler↵", bitrate: 568, duration: 51990, …}
App.js:116 parts :  1
index.js:81 30 fps, 
index.js:81 30 tbr, 
index.js:81 15360 tbn, 
index.js:81 60 tbc
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 VideoHandler
index.js:81 

index.js:81     Stream #0:1
index.js:81 (eng)
index.js:81 : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 SoundHandler
index.js:81 

index.js:81 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/VidMate/download/Lewis_Capaldi____Someone_you_loved__abudy_cover_.mp4':

index.js:81   Metadata:

index.js:81     major_brand     : 
index.js:81 isom
index.js:81 

index.js:81     minor_version   : 
index.js:81 512
index.js:81 

index.js:81     compatible_brands: 
index.js:81 isomiso2avc1mp41
index.js:81 

index.js:81     title           : 
index.js:81 513949139257045
index.js:81 

index.js:81     encoder         : 
index.js:81 Lavf57.25.100
index.js:81 

index.js:81   Duration: 
index.js:81 00:00:51.99
index.js:81 , start: 
index.js:81 0.000000
index.js:81 , bitrate: 
index.js:81 568 kb/s
index.js:81 

index.js:81     Stream #0:0
index.js:81 (eng)
index.js:81 : Video: h264 (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1080x1080, 499 kb/s
index.js:81 , 
index.js:81 30 fps, 
index.js:81 30 tbr, 
index.js:81 15360 tbn, 
index.js:81 60 tbc
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 VideoHandler
index.js:81 

index.js:81     Stream #0:1
index.js:81 (eng)
index.js:81 : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 SoundHandler
index.js:81 

index.js:81 Output #0, mp4, to '/storage/emulated/0/VidMate/download/Lewis_Capaldi____Someone_you_loved__abudy_cover_.mp4-split-0.mp4':

index.js:81   Metadata:

index.js:81     major_brand     : 
index.js:81 isom
index.js:81 

index.js:81     minor_version   : 
index.js:81 512
index.js:81 

index.js:81     compatible_brands: 
index.js:81 isomiso2avc1mp41
index.js:81 

index.js:81     title           : 
index.js:81 513949139257045
index.js:81 

index.js:81     encoder         : 
index.js:81 Lavf58.35.101
index.js:81 

index.js:81     Stream #0:0
index.js:81 (eng)
index.js:81 : Video: h264 (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1080x1080, q=2-31, 499 kb/s
index.js:81 , 
index.js:81 30 fps, 
index.js:81 30 tbr, 
index.js:81 15360 tbn, 
index.js:81 15360 tbc
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 VideoHandler
index.js:81 

index.js:81     Stream #0:1
index.js:81 (eng)
index.js:81 : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s
App.js:141 Splitted succesfiully 0
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 SoundHandler
index.js:81 

index.js:81 Stream mapping:

index.js:81   Stream #0:0 -> #0:0
index.js:81  (copy)
index.js:81 

index.js:81   Stream #0:1 -> #0:1
index.js:81  (copy)
index.js:81 

index.js:81 Press [q] to stop, [?] for help

index.js:81 frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
index.js:81 
index.js:81 frame=  842 fps=0.0 q=-1.0 Lsize=    1918kB time=00:00:29.97 bitrate= 524.0kbits/s speed= 813x    

index.js:81 video:1660kB audio:236kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 
index.js:81 1.155786%
index.js:81 

index.js:81 
index.js:81 ffmpeg version git-2020-01-25-fd11dd500
index.js:81  Copyright (c) 2000-2020 the FFmpeg developers
index.js:81 

index.js:81   built with Android (5220042 based on r346389c) clang version 8.0.7 (https://android.googlesource.com/toolchain/clang b55f2d4ebfd35bf643d27dbca1bb228957008617) (https://android.googlesource.com/toolchain/llvm 3c393fe7a7e13b0fba4ac75a01aa683d7a5b11cd) (based on LLVM 8.0.7svn)

index.js:81   configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/taner/Projects/mobile-ffmpeg/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang++ --target-os=android --enable-neon --enable-asm --enable-inline-asm --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --enable-shared --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --enable-small --disable-openssl --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disa
index.js:81   libavutil      56. 38.100 / 56. 38.100

index.js:81   libavcodec     58. 65.102 / 58. 65.102

index.js:81   libavformat    58. 35.101 / 58. 35.101

index.js:81   libavdevice    58.  9.103 / 58.  9.103

index.js:81   libavfilter     7. 70.101 /  7. 70.101

index.js:81   libswscale      5.  6.100 /  5.  6.100

index.js:81   libswresample   3.  6.100 /  3.  6.100

index.js:81 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/VidMate/download/Lewis_Capaldi____Someone_you_loved__abudy_cover_.mp4':

index.js:81   Metadata:

index.js:81     major_brand     : 
index.js:81 isom
index.js:81 

index.js:81     minor_version   : 
index.js:81 512
index.js:81 

index.js:81     compatible_brands: 
index.js:81 isomiso2avc1mp41
index.js:81 

index.js:81     title           : 
index.js:81 513949139257045
index.js:81 

index.js:81     encoder         : 
index.js:81 Lavf57.25.100
index.js:81 

index.js:81   Duration: 
index.js:81 00:00:51.99
index.js:81 , start: 
index.js:81 0.000000
index.js:81 , bitrate: 
index.js:81 568 kb/s
index.js:81 

index.js:81     Stream #0:0
index.js:81 (eng)
index.js:81 : Video: h264 (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1080x1080, 499 kb/s
index.js:81 , 
index.js:81 30 fps, 
index.js:81 30 tbr, 
index.js:81 15360 tbn, 
index.js:81 60 tbc
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 VideoHandler
index.js:81 

index.js:81     Stream #0:1
index.js:81 (eng)
index.js:81 : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 SoundHandler
index.js:81 

index.js:81 Output #0, mp4, to '/storage/emulated/0/VidMate/download/Lewis_Capaldi____Someone_you_loved__abudy_cover_.mp4-split-1.mp4':

index.js:81   Metadata:

index.js:81     major_brand     : 
index.js:81 isom
index.js:81 

index.js:81     minor_version   : 
index.js:81 512
index.js:81 

index.js:81     compatible_brands: 
index.js:81 isomiso2avc1mp41
index.js:81 

index.js:81     title           : 
index.js:81 513949139257045
index.js:81 

index.js:81     encoder         : 
index.js:81 Lavf58.35.101
index.js:81 

index.js:81     Stream #0:0
index.js:81 (eng)
index.js:81 : Video: h264 (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1080x1080, q=2-31, 499 kb/s
index.js:81 , 
index.js:81 30 fps, 
index.js:81 30 tbr, 
index.js:81 15360 tbn, 
index.js:81 15360 tbc
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 VideoHandler
index.js:81 

index.js:81     Stream #0:1
index.js:81 (eng)
index.js:81 : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 SoundHandler
index.js:81 

index.js:81 Stream mapping:

index.js:81   Stream #0:0 -> #0:0
index.js:81  (copy)
index.js:81 

index.js:81   Stream #0:1 -> #0:1
index.js:81  (copy)
index.js:81 

index.js:81 Press [q] to stop, [?] for help

index.js:81 frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
index.js:81 
index.js:81 frame=  598 fps=0.0 q=-1.0 Lsize=    1469kB time=00:00:21.94 bitrate= 548.3kbits/s speed= 461x    

App.js:141 Splitted succesfiully 1
index.js:81 video:1281kB audio:171kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 
index.js:81 1.108781%
index.js:81 

index.js:81 
index.js:81 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/VidMate/download/Lewis_Capaldi____Someone_you_loved__abudy_cover_.mp4':

index.js:81   Metadata:

index.js:81     major_brand     : 
index.js:81 isom
index.js:81 

index.js:81     minor_version   : 
index.js:81 512
index.js:81 

index.js:81     compatible_brands: 
index.js:81 isomiso2avc1mp41
index.js:81 

index.js:81     title           : 
index.js:81 513949139257045
index.js:81 

index.js:81     encoder         : 
index.js:81 Lavf57.25.100
index.js:81 

index.js:81   Duration: 
index.js:81 00:00:51.99
index.js:81 , start: 
index.js:81 0.000000
index.js:81 , bitrate: 
index.js:81 568 kb/s
index.js:81 

index.js:81     Stream #0:0
index.js:81 (eng)
index.js:81 : Video: h264 (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1080x1080, 499 kb/s
index.js:81 , 
index.js:81 30 fps, 
index.js:81 30 tbr, 
index.js:81 15360 tbn, 
index.js:81 60 tbc
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 VideoHandler
index.js:81 

index.js:81     Stream #0:1
index.js:81 (eng)
index.js:81 : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 SoundHandler
index.js:81 

index.js:81 Output #0, mp4, to '/storage/emulated/0/VidMate/download/Lewis_Capaldi____Someone_you_loved__abudy_cover_.mp4-split-1.mp4':

index.js:81   Metadata:

index.js:81     major_brand     : 
index.js:81 isom
index.js:81 

index.js:81     minor_version   : 
index.js:81 512
index.js:81 

index.js:81     compatible_brands: 
index.js:81 isomiso2avc1mp41
index.js:81 

index.js:81     title           : 
index.js:81 513949139257045
index.js:81 

index.js:81     encoder         : 
index.js:81 Lavf58.35.101
index.js:81 

index.js:81     Stream #0:0
index.js:81 (eng)
index.js:81 : Video: h264 (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1080x1080, q=2-31, 499 kb/s
index.js:81 , 
index.js:81 30 fps, 
index.js:81 30 tbr, 
index.js:81 15360 tbn, 
index.js:81 15360 tbc
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 VideoHandler
index.js:81 

index.js:81     Stream #0:1
index.js:81 (eng)
index.js:81 : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 SoundHandler
index.js:81 

index.js:81 Stream mapping:

index.js:81   Stream #0:0 -> #0:0
index.js:81  (copy)
index.js:81 

index.js:81   Stream #0:1 -> #0:1
index.js:81  (copy)
index.js:81 

index.js:81 Press [q] to stop, [?] for help

index.js:81 frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
index.js:81 
index.js:81 frame=  598 fps=0.0 q=-1.0 Lsize=    1469kB time=00:00:21.94 bitrate= 548.3kbits/s speed= 469x    

App.js:141 Splitted succesfiully 1
index.js:81 video:1281kB audio:171kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 
index.js:81 1.108781%
index.js:81 

index.js:81 
index.js:81 ffmpeg version git-2020-01-25-fd11dd500
index.js:81  Copyright (c) 2000-2020 the FFmpeg developers
index.js:81 

index.js:81   built with Android (5220042 based on r346389c) clang version 8.0.7 (https://android.googlesource.com/toolchain/clang b55f2d4ebfd35bf643d27dbca1bb228957008617) (https://android.googlesource.com/toolchain/llvm 3c393fe7a7e13b0fba4ac75a01aa683d7a5b11cd) (based on LLVM 8.0.7svn)

index.js:81   configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/taner/Projects/mobile-ffmpeg/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang++ --target-os=android --enable-neon --enable-asm --enable-inline-asm --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --enable-shared --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --enable-small --disable-openssl --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disa
index.js:81   libavutil      56. 38.100 / 56. 38.100

index.js:81   libavcodec     58. 65.102 / 58. 65.102

index.js:81   libavformat    58. 35.101 / 58. 35.101

index.js:81   libavdevice    58.  9.103 / 58.  9.103

index.js:81   libavfilter     7. 70.101 /  7. 70.101

index.js:81   libswscale      5.  6.100 /  5.  6.100

index.js:81   libswresample   3.  6.100 /  3.  6.100

index.js:81 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/VidMate/download/Lewis_Capaldi____Someone_you_loved__abudy_cover_.mp4':

index.js:81   Metadata:

index.js:81     major_brand     : 
index.js:81 isom
index.js:81 

index.js:81     minor_version   : 
index.js:81 512
index.js:81 

index.js:81     compatible_brands: 
index.js:81 isomiso2avc1mp41
index.js:81 

index.js:81     title           : 
index.js:81 513949139257045
index.js:81 

index.js:81     encoder         : 
index.js:81 Lavf57.25.100
index.js:81 

index.js:81   Duration: 
index.js:81 00:00:51.99
index.js:81 , start: 
index.js:81 0.000000
index.js:81 , bitrate: 
index.js:81 568 kb/s
index.js:81 

index.js:81     Stream #0:0
index.js:81 (eng)
index.js:81 : Video: h264 (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1080x1080, 499 kb/s
index.js:81 , 
index.js:81 30 fps, 
index.js:81 30 tbr, 
index.js:81 15360 tbn, 
index.js:81 60 tbc
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 VideoHandler
index.js:81 

index.js:81     Stream #0:1
index.js:81 (eng)
index.js:81 : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 SoundHandler
index.js:81 

index.js:81 Output #0, mp4, to '/storage/emulated/0/VidMate/download/Lewis_Capaldi____Someone_you_loved__abudy_cover_.mp4-split-1.mp4':

index.js:81   Metadata:

index.js:81     major_brand     : 
index.js:81 isom
index.js:81 

index.js:81     minor_version   : 
index.js:81 512
index.js:81 

index.js:81     compatible_brands: 
index.js:81 isomiso2avc1mp41
index.js:81 

index.js:81     title           : 
index.js:81 513949139257045
index.js:81 

index.js:81     encoder         : 
index.js:81 Lavf58.35.101
index.js:81 

index.js:81     Stream #0:0
index.js:81 (eng)
index.js:81 : Video: h264 (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1080x1080, q=2-31, 499 kb/s
index.js:81 , 
index.js:81 30 fps, 
index.js:81 30 tbr, 
index.js:81 15360 tbn, 
index.js:81 15360 tbc
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 VideoHandler
index.js:81 

index.js:81     Stream #0:1
index.js:81 (eng)
index.js:81 : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s
index.js:81  (default)
index.js:81 

index.js:81     Metadata:

index.js:81       handler_name    : 
index.js:81 SoundHandler
index.js:81 

index.js:81 Stream mapping:

index.js:81   Stream #0:0 -> #0:0
index.js:81  (copy)
index.js:81 

index.js:81   Stream #0:1 -> #0:1
index.js:81  (copy)
index.js:81 

index.js:81 Press [q] to stop, [?] for help

index.js:81 frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
index.js:81 
index.js:81 frame=  598 fps=0.0 q=-1.0 Lsize=    1469kB time=00:00:21.94 bitrate= 548.3kbits/s speed= 485x    

App.js:141 Splitted succesfiully 1
index.js:81 video:1281kB audio:171kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 
index.js:81 1.108781%
index.js:81 

index.js:81 Environment

tanersener commented 4 years ago

What is the meaning of App.js:106 Result: line in the logs? Are you printing that in your app? It is printed three times and shows that that section of code is called three times.

iamadityaaz commented 4 years ago

I am attaching here the App.js 106 Screenshot from 2020-02-23 15 41 44

iamadityaaz commented 4 years ago

What is the meaning of App.js:106 Result: line in the logs? Are you printing that in your app? It is printed three times and shows that that section of code is called three times.

The issue is the code getting executed 3 times, even if I am trying to do it outside of loop.

tanersener commented 4 years ago

When I look at the console output, I see that RNFFmpeg.executeWithArguments for loop is executed just after printing App.js:106 Result:. I'm asking why it is printed three times? Can I get an answer for that?

If you look at carefully to the console output, you can see that 2nd and 3rd executions start just after printing App.js:106 Result:.

Also, those 2nd and 3rd executions start while 1st execution is still being executed. For me, this clearly shows that there are multiple threads running that section of code.

iamadityaaz commented 4 years ago

When I look at the console output, I see that RNFFmpeg.executeWithArguments for loop is executed just after printing App.js:106 Result:. I'm asking why it is printed three times? Can I get an answer for that?

If you look at carefully to the console output, you can see that 2nd and 3rd executions start just after printing App.js:106 Result:.

Also, those 2nd and 3rd executions start while 1st execution is still being executed. For me, this clearly shows that there are multiple threads running that section of code.

I am using

 RNFFprobe.getMediaInformation(this.state.path).then(result => {
      console.log('Result: ', result);

      var seconds = result.duration / 1000;
      let parts = parseInt(seconds / 30);

      this.setState(
        {
          parts: parts,
        },
        () => {
          console.log('parts : ', parts);
        },
      );
    });

to get the information of the media, which is outside the loop then also this prints Result: 3 times ( This is the issue i am having) and the same

 const result = await RNFFmpeg.executeWithArguments([
        '-i',
        this.state.path,
        '-ss',
        `${startTime}`,
        '-t',
        `${stopTime}`,
        '-y',
        '-c',
        'copy',
        `${this.state.path}-split-${index}.mp4`,
      ]);

      if (!result.rc) {
        console.log('Splitted succesfiully', index);
      } else {
        Alert.alert('Error', 'task failed');
      }

this also gets printed 3 times.

tanersener commented 4 years ago

... outside the loop then also this prints Result: 3 times ( This is the issue i am having)

If a log line (App.js:106 Result:), which is outside of the RNFFmpeg.executeWithArguments block is executed multiple times, then you shouldn't be blaming react-native-ffmpeg for that, right?

iamadityaaz commented 4 years ago

... outside the loop then also this prints Result: 3 times ( This is the issue i am having)

If a log line (App.js:106 Result:), which is outside of the RNFFmpeg.executeWithArguments block is executed multiple times, then you shouldn't be blaming react-native-ffmpeg for that, right?

The log line App.js:106 Result: is inside RNFFprobe.getMediaInformation .

RNFFprobe.getMediaInformation(this.state.path).then(result => {
      console.log('Result: ', result);

      var seconds = result.duration / 1000;
      let parts = parseInt(seconds / 30);

      this.setState(
        {
          parts: parts,
        },
        () => {
          console.log('parts : ', parts);
        },
      );
    });
tanersener commented 4 years ago

What happens when you add a console.log printing this.state.path before RNFFprobe.getMediaInformation? How many times that console.log is executed?

iamadityaaz commented 4 years ago

What happens when you add a console.log printing this.state.path before RNFFprobe.getMediaInformation? How many times that console.log is executed?

Sorry, actually i was calling trim function inside render function also, that was the reason it was getting called again and again.

Thank you