tanersener / react-native-ffmpeg

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

[iOS] No such file or directory #75

Closed vsyw closed 5 years ago

vsyw commented 5 years ago

Description Hi, I'm trying to add watermark to video on iOS simulator, I use ExpoKit, Firstly, I download the video remotely then save it to local cache directory by using Expo's FileSystem API, the URI path looks like:

file:///Users/aaabb/Library/Developer/CoreSimulator/Devices/312534F2-0BBF-4B36-8DBD-E8708296D9FB/data/Containers/Data/Application/E8ABA6DB-EE01-40C8-949B-27B4EA56398E/Library/Caches/ExponentExperienceData/%2540vvan9%252FReact-Nearer/1Fkk6vGxHF3tYx6hqScR.mp4

and I have double checked the URI do exist by opening the URI on browser, but when I called library with the following code I got "No such file or directory"

RNFFmpeg.executeWithArguments([ "-i", uri, "-vf", "drawtext=text='Place text here':x=10:y=H-th-10:fontsize=12:fontcolor=white:shadowcolor=black:shadowx=5:shadowy=5", ${FileSystem.cacheDirectory}${id}-watermark${fileExtension}]).then(result => { console.log("FFmpeg process exited with rc " + result.rc) });

Expected behavior Get the output properly

Current behavior Got an error: file:///Users/aaabb/Library/Developer/CoreSimulator/Devices/312534F2-0BBF-4B36-8DBD-E8708296D9FB/data/Containers/Data/Application/E8ABA6DB-EE01-40C8-949B-27B4EA56398E/Library/Caches/ExponentExperienceData/%2540vvan9%252FReact-Nearer/1Fkk6vGxHF3tYx6hqScR.mp4: No such file or directory

Screenshots If applicable, add screenshots to help explain your problem.

Logs `Package name: full-gpl ffmpeg version v4.2-dev-1156 Copyright (c) 2000-2019 the FFmpeg developers

built with Apple LLVM version 10.0.1 (clang-1001.0.46.3)

configuration: --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk --prefix=/Users/taner/Projects/mobile-ffmpeg/prebuilt/ios-x86_64-ios-darwin/ffmpeg --enable-version3 --arch=x86_64 --cpu=x86_64 --target-os=darwin --ar=ar --cc=clang --cxx=clang++ --as='clang -arch x86_64 -target x86_64-ios-darwin -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel -DMOBILE_FFMPEG_X86_64 -Wno-unused-function -Wno-deprecated-declarations -fstrict-aliasing -DIOS -DMOBILE_FFMPEG_BUILD_DATE=20190402 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk -O2 -mios-simulator-version-min=12.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include' --ranlib=ranlib --strip=strip --disable-neon --enable-cross-compile --enable-pic --enable-asm --enable-inline-asm --enable-optimizations --enable-swscale --enable-static --disable-shared --enable-small --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --disable-openssl --disable-xmm-clobber-test --disable-debug --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gmp --enable-gnutls --enable-libmp3lame --enable-libass --enable-iconv --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libshine --enable-libspeex --enable-libwavpack --enable-libkvazaar --enable-libx264 --enable-gpl --enable-libxvid --enable-gpl --enable-libx265 --enable-gpl --enable-libvidstab --enable-gpl --enable-libilbc --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libaom --enable-libtwolame --disable-sdl2 --enable-zlib --enable-audiotoolbox --enable-coreimage --enable-bzlib --enable-videotoolbox --enable-avfoundation

libavutil 56. 26.100 / 56. 26.100

libavcodec 58. 47.106 / 58. 47.106

libavformat 58. 26.101 / 58. 26.101

libavdevice 58. 7.100 / 58. 7.100

libavfilter 7. 48.100 / 7. 48.100

libswscale 5. 4.100 / 5. 4.100

libswresample 3. 4.100 / 3. 4.100

file:///Users/aaabb/Library/Developer/CoreSimulator/Devices/312534F2-0BBF-4B36-8DBD-E8708296D9FB/data/Containers/Data/Application/E8ABA6DB-EE01-40C8-949B-27B4EA56398E/Library/Caches/ExponentExperienceData/%2540vvan9%252FReact-Nearer/1Fkk6vGxHF3tYx6hqScR.mp4: No such file or directory

FFmpeg process exited with rc 1`

Environment "react": "16.5.0", "react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz", "react-native-ffmpeg": "^0.3.2",

Other Add any other context about the problem here.

tanersener commented 5 years ago

Your video file URI is encoded. Currently, it points to a directory named %2540vvan9%252FReact-Nearer under the ExponentExperienceData directory. Can you try by decoding it?

vsyw commented 5 years ago

@tanersener Thanks for the prompt reply, it works like a charm after decoding, thanks.