我得到了视频修剪的No such file or directory异常。
视频路径: /storage/emulated/0/Pictures/Instagram/Fast & Furious 7 - Get Low Extended Version Video.mp4
文件名: Fast & Furious 7 - Get Low Extended Version Video.mp4
和ffmpeg在/storage/emulated/0/Pictures/Instagram/Fast: No such file or directory中只搜索Fast
我发现了这个问题,因为文件名在它们之间有空格,所以您可以签入上面提到的路径和异常。
在更改文件名后,它的工作状态,但从设备中更改每个文件的名称,这不是正确的方法,所以我如何解决这个异常
FAILED with output : WARNING: linker: /data/user/0/com.example.SeekBarActivity/files/ffmpeg
has text relocations. This is wasting memory and prevents security hardening.
Please fix. FFmpeg version n2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
built on Oct 7 2014 15:08:46 with gcc 4.8 (GCC)
configuration: --target-os=linux --cross-prefix=/home/sb/Source-Code/ffmpeg-
android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --
cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/sb/Source-
Code/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264
--enable-libass --enable-libfreetype --enable-libfribidi --enable-fontconfig
--enable-pthreads --disable-debug --disable-ffserver --enable-version3 --
enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --
enable-yasm --disable-doc --disable-shared --enable-static --pkg-
config=/home/sb/Source-Code/ffmpeg-android/ffmpeg-pkg-config --
prefix=/home/sb/Source-Code/ffmpeg-android/build/armeabi-v7a-neon --extra-
cflags='-I/home/sb/Source-Code/ffmpeg-android/toolchain-android/include -
U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-
all -mfpu=neon' --extra-ldflags='-L/home/sb/Source-Code/ffmpeg-
android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-
lpng -lexpat -lm' --extra-cxxflags=
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 1.100 / 56. 1.100
libavformat 56. 4.101 / 56. 4.101
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 1.100 / 5. 1.100
libswscale 3. 0.100 / 3. 0.100
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 0.100 / 53. 0.100
/storage/emulated/0/Pictures/Instagram/Fast: No such file or directory发布于 2018-02-07 10:00:09
试着取代
execFFmpegBinary("-i " + path + " -ss " + startMs / 1000 +
" -to " + endMs / 1000 + " -c copy " + destPath);使用
execFFmpegBinary(new String[] {"-i", path, "-ss", "" + startMs / 1000,
"-to", "" + endMs / 1000, "-c", "copy", destPath});ffmpeg-android-java的修复可以追溯到2015年。
发布于 2018-02-07 10:47:58
试着用.
execFFmpegBinary("-i '/storage/emulated/0/Pictures/Instagram/Fast\ &\ Furious\ 7\ -\ Get\ Low\ Extended\ Version\ Video.mp4'" + "-ss " + startMs / 1000 +
" -to " + endMs / 1000 + " -c copy " + destPath);发布于 2018-05-26 20:12:56
很晚才回答这个问题,但我还是想补充一下..我就是这样执行命令的:
String[] s = {"-i" ,sourcePath,"-crf","18","-c:v","libx264","-preset","ultrafast",directoryToStore+"/"+outputName};
s.execFFmpegBinary();我已经测试过使用带有名称空间的文件,它运行得很好。
https://stackoverflow.com/questions/48642873
复制相似问题