ffmpeg using MediaCodec, avcodec_open2 says error code:-1 (0xffffffff) text: “Operation not permitted”

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ffmpeg using MediaCodec, avcodec_open2 says error code:-1 (0xffffffff) text: “Operation not permitted”

Miguel del Amor


Qt version: 5.7.1

ffmpeg version: n3.3

Android version: 5.1.1 ( but I've tried on some different devices )

I'm trying to use the Android API MediaCoded that have been supported by ffmpeg but while I try to open the codec I got "Operation not permitted" all times, I've tried some changes and I've tried to find examples without not luck.

This is what I'm doing

av_jni_set_java_vm(QAndroidJniEnvironment::javaVM(), NULL);

av_register_all();
avcodec_register_all();

AVCodec *_codec(nullptr);
AVCodecContext *_codecContext(nullptr);

if (_codec == nullptr)
    _codec = avcodec_find_decoder_by_name("h264_mediacodec");

if (_codecContext == nullptr)
    _codecContext = avcodec_alloc_context3(_codec);

int ret = 0;
if( (ret = avcodec_open2(_codecContext, _codec, NULL)) < 0 ) {

    char str[AV_ERROR_MAX_STRING_SIZE];
    memset(str, 0, sizeof(str));
    av_strerror(ret, str, sizeof(str));

    qDebug("avcodec_open2 \"%s\" error[code:%d text:\"%s\"]",_codec->long_name, ret, str);
}


And I'm getting this output

avcodec_open2 "H.264 Android MediaCodec decoder" error[code:-1 text:"Operation not permitted"]


What I'm doing wrong?

reply<https://forum.qt.io/topic/79172/ffmpeg-using-mediacodec-avcodec_open2-says-error-code-1-0xffffffff-text-operation-not-permitted/2#>




--


Miguel del Amor Herrera

Engineering Manager

[1477648663875_image001.png]

T: +34 868076105/868074570

Traperia 19 3º D Murcia

www.displaynote.com<http://www.displaynote.com/>

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

OutlookEmoji-1477648663875_image001.png.png (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg using MediaCodec, avcodec_open2 says error code:-1 (0xffffffff) text: “Operation not permitted”

Moritz Barsnick
On Thu, May 11, 2017 at 13:18:48 +0000, Miguel del Amor wrote:
> This is what I'm doing
>
> av_jni_set_java_vm(QAndroidJniEnvironment::javaVM(), NULL);

In your mail to ffmpeg-devel, you were asked to pose this question on
the list libav-user, which handles programming with the ffmpeg
libav* libraries.

This list here, ffmpeg-user, handles the command line tools.

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".