Android FFmpeg日志显示“找不到File://协议”

时间:2018-06-25 12:37:39

标签: android ffmpeg video-processing android-ffmpeg

我正在尝试在视频上叠加图片,但显示FFmpeg日志

  

File://storage/emulated/0/whatsappCamera/wc1529921459336.jpg:协议不存在   找到

我也查看了下面的线程,但是对我没有帮助 我被卡住了,请帮助我!

Android FFmpeg reports “file protocol not found”

这是命令

String[] commandImage =  new String[]{"-ss", "00:00:30.0", "-t", "00:00:10.0", "-i",path,
"i","File://storage/emulated/0/whatsappCamera/wc1529921459336.jpg", "-filter_complex",
"[0]crop=400:400:0:0[a];[a][1]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2",
"-preset", "ultrafast", "-codec:a", "copy",folder.getAbsolutePath()+"/final_video.mp4"};

完整日志

 ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
 built with gcc 4.8 (GCC)
 configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --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/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
 libavutil      55. 17.103 / 55. 17.103
 libavcodec     57. 24.102 / 57. 24.102
 libavformat    57. 25.100 / 57. 25.100
 libavdevice    57.  0.101 / 57.  0.101
 libavfilter     6. 31.100 /  6. 31.100
 libswscale      4.  0.100 /  4.  0.100
 libswresample   2.  0.101 /  2.  0.101
 libpostproc    54.  0.100 / 54.  0.100
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/whatsappCamera/wc_vid_1529929340679.mp4':
 Metadata:
 major_brand     : mp42
 minor_version   : 0
 compatible_brands: isommp42
 creation_time   : 2018-06-25 12:22:26
 com.android.version: 6.0.1
 Duration: 00:00:05.02, start: 0.000000, bitrate: 17312 kb/s
 Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 16947 kb/s, SAR 1:1 DAR 16:9, 30.07 fps, 30 tbr, 90k tbn, 180k tbc (default)
 Metadata:
 rotate          : 90
 creation_time   : 2018-06-25 12:22:26
 handler_name    : VideoHandle
 encoder         : MOTO
 Side data:
 displaymatrix: rotation of -90.00 degrees
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
 Metadata:
 creation_time   : 2018-06-25 12:22:26
 handler_name    : SoundHandle
 File://storage/emulated/0/whatsappCamera/wc1529921459336.jpg: Protocol not found

1 个答案:

答案 0 :(得分:0)

我通过用 file:///data/user/0/yourPackage/cache/yourFileName.ext 替换文件路径解决了这个问题 要么 将文件更改为文件