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

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


I will give it a try. Thanks for the hint.

On Fri, Feb 13, 2015 at 10:27 AM, wm4 <nfxjfg at googlemail.com> wrote:

> On Fri, 13 Feb 2015 10:22:46 -0600
> Cen-bi Liu <cenbiliu at gmail.com> wrote:
>
> > yes.
> >
>
> How about open(filename, O_CREAT | O_WRONLY | O_CLOEXEC, 0666)? This is
> approximately what libavformat calls. You can also check strace output.
>
> > On Fri, Feb 13, 2015 at 10:19 AM, wm4 <nfxjfg at googlemail.com> wrote:
> >
> > > On Fri, 13 Feb 2015 10:08:29 -0600
> > > Cen-bi Liu <cenbiliu at gmail.com> wrote:
> > >
> > > > 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
> > >
> > > Does fopen() work?
> > > _______________________________________________
> > > Libav-user mailing list
> > > Libav-user at ffmpeg.org
> > > http://ffmpeg.org/mailman/listinfo/libav-user
> > >
> >
> >
> >
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>



-- 
===============================

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


More information about the Libav-user mailing list