[Libav-user] ffmpeg on android - cannot write output file

Cen-bi Liu cenbiliu at gmail.com
Fri Feb 13 17:08:29 CET 2015


Hi all,

I'm new to ffmpeg and trying to use ffmpeg as a shared library in Android
to convert PCM to an .mp4 file by following tutorials.

I hit a snag in my openOutputFile function, I have the following which has
given me an error (passing in "/sdcard/a.mp4" for filename):

if ((error = avio_open(&output_io_context, filename,
                       AVIO_FLAG_WRITE)) < 0) {
    __android_log_print(ANDROID_LOG_ERROR, "encoder","couldn't open
output file");
    exit(1);}

My configure for ffmpeg compilation is as follows:

./configure \--prefix=$PREFIX \--enable-demuxer=mov
\--enable-muxer=mov \--enable-libvpx \--enable-libvorbis
\--enable-protocol=file \--enable-shared \--disable-static
\--disable-doc \--disable-ffmpeg \--disable-ffplay \--disable-ffprobe
\--disable-ffserver \--disable-avdevice \--disable-symver
\--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi-
\--target-os=linux \--arch=arm \--enable-cross-compile
\--sysroot=$SYSROOT \--extra-cflags="-Os -fpic $ADDI_CFLAGS"
\--extra-ldflags="$ADDI_LDFLAGS" \

When searching, I have come across others' experiencing similar issues and
added the --enable-protocol=file and --enable-muxer=mov when compiling
ffmpeg. I did add the permissions to external storage in the manifest.xml
file. Please let me know what you think.

Cheers,

Cen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20150213/72a04dc4/attachment.html>


More information about the Libav-user mailing list