how to use ffmpeg/libavcodec/libstagefright

前端 未结 2 1497
栀梦
栀梦 2020-12-14 10:35

I just have a question about how to use ffmpeg/libavcodec/libstagfright.cpp: I try to avcodec_open2(st->codec, codec) when I have use ffmpeg to

相关标签:
2条回答
  • 2020-12-14 11:20

    Im actually working on providing stagefright to my ffmpeg library on Android. I made some changes to original libstagefright.cpp from ffmpeg/libav but it is still not stable. After stabilizing it I will create pull request for ffmpeg/libav team. You can look around on my project: in "hwaccel" branch.

    It is available at AndroidFFmpeg/FFmpegLibrary/jni/ffstagefright.cpp directory.

    To use this library you have call standard ffmpeg methods and open insteed of standard h264 codec libstagefright_h264 codec:

    AVCodec *codec = avcodec_find_decoder_by_name("libstagefright_h264");
    
    0 讨论(0)
  • 2020-12-14 11:33

    It works at ICS4.0.3 ,Moto XT910,FFmpeg 0.7

    I use extradata for store MediaFileName,then get metadata from codes:

    DataSource::RegisterDefaultSniffers();
    sp<MediaSource> source ;
    source = createSource((char*)MeidaFileName);
    if(source==NULL){
        return -1 ;
    }
    meta = source->getFormat();
    if(!meta->findData(kKeyAVCC, &type, &data, &data_size))
    {
        return -1 ;
    }
    meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_VIDEO_AVC);
    

    then you can OMX::create(there are some difference for Android 2.3 and ICS)

    0 讨论(0)
提交回复
热议问题