使用FFMPEG在Android上转码Mp4视频 [英] Transcoding Mp4 video on Android with FFMPEG
问题描述
我已经从 Bambuser工程编译了FFMPEG二进制文件(请参阅问题),并将二进制文件和.so文件压缩到应用程序目录。
I've compiled FFMPEG binary from Bambuser project (refer question) and have pushed binary and .so files to application directory.
但是,当我尝试使用输入文件运行FFMPEG时,它总是抱怨找不到文件。
But when I try running FFMPEG with input file, it always complains file not found.
1|root@android:/data/data/com.bambuser.broadcaster # ls
cache libavcodec.so libavfilter.so libswscale.so
ffmpeg libavcore.so libavformat.so tutorial.mp4
lib libavdevice.so libavutil.so
1|root@android:/data/data/com.bambuser.broadcaster # ./ffmpeg -i tutorial.mp4 out.mp4
FFmpeg version UNKNOWN, Copyright (c) 2000-2010 the FFmpeg developers
built on May 8 2012 10:11:37 with gcc 4.4.3
configuration: --target-os=linux --cross-prefix=arm-linux-androideabi- --arch=arm --sysroot=/home/tarandeep/tools/android-ndk/platforms/android-3/arch-arm --soname-prefix=/data/data/com.bambuser.broadcaster/lib/ --enable-shared --disable-symver --enable-small --optimization-flags=-O2 --disable-everything --enable-encoder=mpeg2video --enable-encoder=nellymoser --prefix=../build/ffmpeg/armeabi-v7a --extra-cflags='-march=armv7-a -mfloat-abi=softfp' --extra-ldflags=
libavutil 50.34. 0 / 50.34. 0
libavcore 0.16. 0 / 0.16. 0
libavcodec 52.99. 1 / 52.99. 1
libavformat 52.88. 0 / 52.88. 0
libavdevice 52. 2. 2 / 52. 2. 2
libavfilter 1.69. 0 / 1.69. 0
libswscale 0.12. 0 / 0.12. 0
tutorial.mp4: No such file or directory
我已经尝试放置文件/ sdcard和其他位置,我总是得到相同的输出
I've tried placing file in /sdcard and other locations, I always get same output
推荐答案
我下载了代码存档为客户端版本1.3.7到1.6 0.0。我发现在build.sh文件中有一行 FLAGS =$ FLAGS --disable-everything
,禁用所有加载文件的协议(文件,http,等等。)。评论这一行或启用所需的协议允许您正确加载文件。
i downloaded the code 'Archive for client versions 1.3.7 to 1.6.0.'. I found that in the build.sh file there's the line FLAGS="$FLAGS --disable-everything"
that disable all the protocols for loading a file (file, http, etc.). commenting this line or enable the protocols that you need allow you to load correctly the file.
这篇关于使用FFMPEG在Android上转码Mp4视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!