ffmpeg porting on Andriod using libstagefright

1,442 views
Skip to first unread message

kri CH

unread,
Mar 16, 2011, 10:21:29 AM3/16/11
to android-ndk
Hi ,

currently porting the FFMPEG(MPEG1 And MPEG2 support) in Android
libstagefright for OMAP ZOOM3 .

i see for adding the new codec new extractor need to write...it's
necessary ?
i am planning to add the FFMPEG library as the part of the
libstagefright software codec .

can any one please provide the help ,how to go forward.

Regards,
Krushnakumar Chaudhary

kiran

unread,
Mar 21, 2011, 5:23:53 AM3/21/11
to andro...@googlegroups.com, kri CH
Hi
  Adding the ffmpeg support to stagefright can be spilt into two parts
1. Adding Demuxer support to stagefright.
2. Adding decoder support to stagefright through OMX Codecs.

Adding Demuxer support to stagefright, 
we need to write a extractor based on the ffmpeg api which can demux the audio and video and pass the buffer to stagefright.

 Adding decoder support to stagefright through OMX Codecs.

   This can easily done with the support of the libomxil-belliago which provides the openmax interface layer using the ffmpeg decoder.
 i could decode mp4 format files through ffmpeg based on this support.but i am trying to write a demuxer based on the ffmpeg for stagefright.

Regards
Kiran


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.




--
Regards
 Kiran

kri CH

unread,
Mar 21, 2011, 9:49:47 AM3/21/11
to android-ndk
Hi Kiran,

Thanks for your replay.

Even i am able to decode the MPEG4(mp4) stream data with the support
of the libomxil-belliago which
provides the openmax interface layer using the ffmpeg decoder...

i have used the default MPEG4 Extractor which is Available in Android.

But i am not sure ...how to Write the extractor for each of codec
supported in the FFMPEG lib (like MPEG1,MPEG2,VP7,VP8)...

can you please provide some more information on the Extractor...
you have any idea of any open source Available for Extractor .. or
some sample example which can be directly used for Android ?



Best Regards,
Krushnakumar Chaudhary

kiran

unread,
Mar 22, 2011, 12:28:11 AM3/22/11
to andro...@googlegroups.com, kri CH
Hi
 1. write now i am still not able to write the  complete demuxer, But i use the following procedure
1. Write ffmpeg-wrapper extractor class which uses the ffmpeg demuxer api's' to demux the audio and video buffer and pass the buffer back to stagefright.
2. Add more ffmpeg decode support to libomx-belliago.

i did not find any extractor ready available for stagefright. 

Regards
Kiram

kri CH

unread,
Mar 22, 2011, 1:26:44 AM3/22/11
to android-ndk
Hi Kiran,

Thanks for replay again.

i have question regarding method you have provided below:
-> have you included(integrated) ffmpeg-wrapper Exctractor class as
part of libstagefright ?
-> if not as part of libstagefright then where you have
included(integrated) and how you are using those class API ?

can you please provide me that ffmpeg-wrapper Exctractor class..
which you have developed using the ffmpeg demux API. that will be easy
for me to go forward.

one more issue i have observed with the MPEG4(mp4) decoded video is,
decode video color are not set.but thumbnail color set correctly.have
you observed this issue ?


Rest Regards,
krushnakumar Chaudhary

kiran

unread,
Mar 22, 2011, 1:36:46 AM3/22/11
to andro...@googlegroups.com, kri CH
Hi
i have included in the libstagefright ,the same place where MPEG4Extractor.cpp is present and regarding the ffmpeg api's'  i am using the ffmpeg api  provided in the ffmpeg tutorial, as i said earlier it is still very much development stage,i will definitely provide the ffmpeg extractor class once it reaches some stable  development state.
what is the issue you are facing in the decoder video normally omx decodes the video in YUV420 format and stagefright software renderer should convert from yuv420 to rgb format.

But if you provide little more information on this issue i can help you.

Regards
Kiran

kri CH

unread,
May 10, 2011, 3:00:22 AM5/10/11
to android-ndk
Hi kiran,

The issue is on the display video decoding working fine but without
any colour.
yes,ffmpeg provide the YUV420P pixel format as output format.
can you please tell me actually where in stagefright software
renderer the changes for yuv420 to rgb conversion need to done.
you have observerd issue before while porting the ffmpeg on Android
libstagefright.

On Mar 22, 10:36 am, kiran <kiranbhat2...@gmail.com> wrote:
> Hi
>  Kiran- Hide quoted text -
>
> - Show quoted text -

kiran

unread,
May 10, 2011, 3:13:12 AM5/10/11
to andro...@googlegroups.com
  if the decoder gives outptut YUV420 format then the conversion is done in the stagefright in frameworks/base/media/libstagefright/colorconversion/ 
 
if the issue is in the conversion then the it might in the stagefright itself.
i am using the beagle board where i convert it into YUV422 in ffmpeg and pass it directly to the YUV plane of beagle board, i am not using softwarerender of stagefright.

which board are you  using,  try to find out wheather  frames are getting dropped in AwesomePlayer.cpp. (if the decoded frame arrives later 40ms  Awesome player is dropping the frame and displaying the blank screen)

Regards
Kiran

kri CH

unread,
May 10, 2011, 5:16:41 AM5/10/11
to android-ndk
ya..decoded frame are arrives frame are late then 40ms in
AwesomePlayer.cpp.
how you are calculating the extractor video meta data "kKeyTime"
value.can you please provide the calculation method.
i think that will solved my issue.
Message has been deleted

templogin templog

unread,
Feb 11, 2012, 4:47:36 AM2/11/12
to andro...@googlegroups.com, kri CH
Hi kiran,
    I have successfully compiled ffmpeg-0.10 for android with libstagefight enabled, but wont have any application to use it. How do i test whether it do hardware acceleration or not. Do u have any example, tried it with mplayer but soent help much.
   thanks in advance. 

Bill Zhong

unread,
Mar 8, 2012, 1:29:50 AM3/8/12
to andro...@googlegroups.com, kri CH
Hi,
  How did you do ? Could you gime me some guides.

在 2012年2月11日星期六UTC+8下午5时47分36秒,templogin templog写道:
Reply all
Reply to author
Forward
0 new messages