i.MX6 VPU encoding API and sample code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX6 VPU encoding API and sample code

10,497 Views
li-chen
Contributor II

Hi,

We are developing an application to stream video from I.MX6Q Sabre board. We looking for APIs and sample code to utilize the VPU to do hardware encoding. Any pointer will be really appreciated.

Note: our application is a native Android app so we will need C/C++ api.  Many Thanks.


-- Li

Labels (2)
Tags (1)
13 Replies

4,386 Views
mghasan
Contributor I

Hi Li,

If you want to use VPU encoding from your application with raw video stream, then check this sample program at Freescale Android source code

external/linux-test/test/mxc_vpu_test/

0 Kudos
Reply

4,386 Views
justin_jiang
NXP Employee
NXP Employee

You can find the VPU API document from our Linux release.

"i.MX5x_Linux_VPU_API.pdf"

For i.MX6 we use the same API as i.MX5x.

I also attached the API document.

For the sample code you can refer to our Linux VPU unit test code,

it will call the VPU API directly.

4,386 Views
li-chen
Contributor II

Let me clarify the question:

We would like to use i.MX hardware encoding capabilities from a user-space program, compiled with the NDK. Do you have any API (public or private) for using i.MX hardware video encoder from the user-space? The VPU API described in the above document requires physical addresses, does not provide any way to convert from virtual to physical addresses, and thus cannot be used from a normal NDK app.

0 Kudos
Reply

4,386 Views
justin_jiang
NXP Employee
NXP Employee

We use this API with Gstreamer plug-in in Linux and there is no specific API for user-space.

Do you use Android?

4,386 Views
li-chen
Contributor II

Yes, we are building an native Android app using Android NDK. Any suggestion on how we can utilize the VPU to do hardware encoding on Android?  Many thanks.

0 Kudos
Reply

4,386 Views
justin_jiang
NXP Employee
NXP Employee

Under Android, Freescale already did it on our Android release BSP.

You can choose Google default decoder or Freescale VPU decoder by the config files.

More details you can refer to our Android release document.

4,386 Views
li-chen
Contributor II

We want to do "encoding" on VPU, not decoding. Does Freescale's Android BSP include an encoding API? Thanks again.

0 Kudos
Reply

4,386 Views
justin_jiang
NXP Employee
NXP Employee

Yes, we have both decoding and encoding VPU API. But in our Android release, we already packaged all the API calling to a wrapper layer.

Under Android, the media service will call our OMXPlayer and then OMXPlayer will call the wrapper.

If you develop you application base on our Android release, it will call the VPU.

4,386 Views
erickang
Contributor II

Hi Qingrong Jiang,

I'm finding how to use VPU API in Android.

I could see your comments for the API callng to a wrapper layer using OMXPlaher.

Could you inform me how to use VPU API in Android in details?

It's very helpful if you give me the reference documents for this.

Best Regards,

Eric.

0 Kudos
Reply

4,386 Views
justin_jiang
NXP Employee
NXP Employee

Under Android, you no need call VPU API directly. You only need call the Android media service, it will call VPU in HAL layer.

0 Kudos
Reply

4,386 Views
erickang
Contributor II

Hi Hi Qingrong Jiang,

Thanks for your response.

Actually I didn't family with Android.

Could you tell me how to call the Android media service for details?

Please give me any guidance if you have.

It's very helpful to me.

Best Regards,

Eric.

0 Kudos
Reply

4,386 Views
justin_jiang
NXP Employee
NXP Employee

You can find it from google document. This is application level API. I'm also not familiar about it.

0 Kudos
Reply

4,386 Views
erickang
Contributor II

Hi Qingrong Jiang,

Thanks for your response.

I could find the Android standard API like as Media Framework.

http://developer.android.com/reference/android/media/package-summary.html


We will use this Media Framework to make the Android MediaPlayer/MediaRecorder.

I think it's helpful to me.

Best Regards,

Eric.

0 Kudos
Reply