我在使用FFmpeg剪切部分视频时遇到错误
以下是我的代码
String[] cmd = {"ffmpeg -ss 0 -i "+mPath+" -t 30 -c copy "+ (Environment.getExternalStorageDirectory().getabsolutePath()+"/sample.mp4")};executeCommand(cmd);
函数executeCommand
voID executeCommand(String[] cmd) { try { fFmpeg.execute(cmd, new FFmpegExecuteResponseHandler() { @OverrIDe public voID onSuccess(String message) { Toast.makeText(VIDeoFullScreen.this, "finished :" + message, Toast.LENGTH_SHORT).show(); } @OverrIDe public voID onProgress(String message) { } @OverrIDe public voID onFailure(String message) { Log.e("Error",message); } @OverrIDe public voID onStart() { } @OverrIDe public voID onFinish() { } }); } catch (FFmpegCommandAlreadyRunningException e) { e.printstacktrace(); }}
错误
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
Output #0, mp4, to ‘ffmpeg -ss 0 -i /storage/emulated/0/VIDeo/Demo.mp4 -t 30 -c copy /storage/emulated/0/sample.mp4’:
Output file #0 does not contain any stream
解决方法:
This is an answer to my own question
我的问题出在我传递的命令字符串数组中
This answer is to the people who all are facing the similar kind of issues with
ffmpeg
使用ffmpeg时应该遵循的重要事项
>确保在正确的String Array中传递命令
String[] cmd = {"-ss", "0", "-i" ,input_vIDeo_path, "-t" ,"30", "-c", "copy",output_vIDeo_path};
>不要在传递的参数和标志中添加任何额外空格
{“ – c”错了}
>不要在cmd数组中传递ffmpeg
{“ffmpeg”错了}
希望这会对某人有所帮助
总结以上是内存溢出为你收集整理的android – FFmpeg错误输出文件#0不包含任何流全部内容,希望文章能够帮你解决android – FFmpeg错误输出文件#0不包含任何流所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)