Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
419 views
in Technique[技术] by (71.8m points)

android - how to use ffmpeg/libavcodec/libstagefright

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 set codec->id as CODEC_ID_H264,codec->name as libstagefright_h264,that means I will open AVCodec ff_libstagefright_h264_decoder.

but when Stagefright_init->OMXCodec::Create->configureCodec-> initOutputFormat(meta), the process just Quit ! It is a bazinga !

I knew that meta is Metadata, its data comes from codec->extradata, and in here, it means sps and pps, am I right?

How can I use libstagefright sucessfully in ffmpeg? Can somebody give me an example?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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");

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...