簡體   English   中英

Android ffmpeg庫使用

[英]Android ffmpeg library use

我對使用ffmpeg庫很陌生。 我使用此http://writingminds.github.io/ffmpeg-android-java/將庫添加到我的android studio項目中。 當我運行命令-version-devices時,它運行良好。但是,當我嘗試以-i開頭的任何命令(例如-i video.avi ,出現錯誤:

onFailure:ffmpeg版本n3.0.1版權所有(c)2000-2016使用gcc 4.8(GCC)配置構建的FFmpeg開發人員:--target-os = linux --cross-prefix = / home / vagrant / SourceCode / ffmpeg-android /工具鏈-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 /主頁/無用/ SourceCode / ffmpeg-android / toolchain-android / include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE = 2 -fno-strict-overflow -fstack-protector- 全部'--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無法識別的選項'i /storage/emulated/0/Movies/test4.avi'。 拆分參數列表時出錯:找不到選項

難道我做錯了什么? 誰知道為什么像“ -i”這樣的基本命令不起作用?

這樣寫你的命令

String[] command = new String[]{

                    "-i", "video.avi"};

根據錯誤,我認為您的視頻已經是.avi格式。 請嘗試.mp4格式並檢查是否存在問題。

我來晚了一點,但是它是這樣的:

 String cmd = "Complete command you want to execute";
String[] myArr = cmd.split(" ");
ffmpeg.execute(myArr, new ExecuteBinaryResponseHandler(){
 });

此代碼的問題在於,整個命令被視為一個選項,因此請使用提供的代碼將每個選項和每個選項的值分開。 希望它可以幫助某人。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM