Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
415 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 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...