Does the h264 hardware encoder in Smart Controller Enterprise only support encoding video in "high" profile?
已完成Hello,
I'm using Mobile SDK to make an app that streams the drone video feed to another device in real time. The app is running on Smart Controller Enterprise. M300 sends the video feed in h264 high profile, but I need the video format to be h264 baseline profile instead. When I use MediaCodec in my Android app to transcode the feed (using the OMX.rk.video_encoder.avc hardware encoder), the encoder outputs video in high profile format even when I set the PROFILE_KEY in the MediaFormat object to be something else. The encoder seems to respect all the other MediaFormat settings except the profile. Is this expected behavior?
-
Which video feed you are passing into Android CodecManager? You are using getPrimaryVideoFeed or provideTranscodedVideoFeed. M300's getPrimaryVideoFeed does not have SPS,PPS,IDR. Only provideTranscodedVideoFeed will give out standard H.264 video stream. The Android CodecManager is out of our experise, we can only suggest you use DJICodecManager to decode the video stream. -
I'm passing the transcoded feed. The other option sends h264 in GDR mode, so it only sends one I-frame at the beginning of the stream. It also has some SEI and AUD NAL units in the stream. I can use DJICodecManager to decode the stream, but I also need to re-encode it with specific settings, which DJICodecManager doesn't seem to support.
If I look at the logs produced by Android logcat when the Android app loads, I find things such as:
D/FPVController: try to load libdjivideo.so
I/mali_so: [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c;This would suggest that the Rockchip SoC inside Smart Controller Enterprise is perhaps RK3288. According to its datasheet, it should:
Support video encoder for H.264 (BP@level4.0, MP@level4.0, HP@level4.0), MVC
and VP8.So both the Android SDK Java API (for Android 7.1.2) and the Smart Controller Enterprise hardware should in theory support encoding in different h264 profiles. In the middle is the custom Android image that DJI has built. I'm wondering if the encoding options have been limited by design, or if it's caused by a bug.
-
Yes, you need tp send transcoded feed. It should give you a standard H.264 video stream. Yes you are correct, DJICodecManager cannot encode back. I am sure that the video stream can be encoded back. This is how our LiveStreamManager works, we encoded the video stream again and send them out. But how it works in theory and in deep, I don't know. It is very out of the SDK scope, I am very sorry. -
I can encode the stream using MediaCodec and I can choose what resolution, bitrate etc. the stream is. What I cannot do is choose which h264 profile the encoded stream is. So encoding works as long as I don't have specific requirements about what kind of h264 video the hardware encoder outputs. Unfortunately I have such requirements.
请先登录再写评论。
评论
5 条评论