I'm trying to use ffmpeg as a shared library in Android to convert PCM to an .mp4 file. Before going further, 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. Thanks.
Aucun commentaire:
Enregistrer un commentaire