Closed Bug 1026933 Opened 7 years ago Closed 3 years ago

[Dolphin] H264 OMX Encoder only supports variable bitrate (WebrtcOMXH264VideoEncoder wants constant with skipframes)

Categories

(Firefox OS Graveyard :: General, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: pehrsons, Unassigned)

References

Details

(Whiteboard: [sprd332076 ])

The Dolphin H264 hardware encoder only supports OMX_Video_ControlRateVariable. Here from vendor/sprd/open-source/libs/omx_components/video/avc_sprd/sc8830/enc/SPRDAVCEncoder.cpp:
 903     case OMX_IndexParamVideoBitrate:
 904     {
 905         OMX_VIDEO_PARAM_BITRATETYPE *bitRate =
 906             (OMX_VIDEO_PARAM_BITRATETYPE *) params;
 907                                                                                                                                                          
 908         if (bitRate->nPortIndex != 1 ||
 909                 bitRate->eControlRate != OMX_Video_ControlRateVariable) {
 910             return OMX_ErrorUndefined;
 911         }   
 912     
 913         mVideoBitRate = bitRate->nTargetBitrate;
 914         return OMX_ErrorNone;
 915     }   

While Gecko requests OMX_Video_ControlRateConstantSkipFrames for WebRTC: http://dxr.mozilla.org/mozilla-central/source/media/webrtc/signaling/src/media-conduit/WebrtcOMXH264VideoCodec.cpp#789

Result: codec cannot be configured.

One of the two will have to adapt to the other here.
John, FYI similarly to bug 1023125, Dolphin also does not support the bitrate mode you request in Gecko.
Flags: needinfo?(jolin)
Randell,
 Bad news. Another missing feature in SPRD H.264 encoder. :(

Kai-Zhen,
 What would be the proper way to ask for SPRD's help to support constant bitrate encoding?
Flags: needinfo?(jolin) → needinfo?(kli)
(In reply to John Lin[:jolin][:jhlin] from comment #2)
> Randell,
>  Bad news. Another missing feature in SPRD H.264 encoder. :(
> 
> Kai-Zhen,
>  What would be the proper way to ask for SPRD's help to support constant
> bitrate encoding?

Can you have any comment on this? Thanks.
Flags: needinfo?(james.zhang)
Ming, please track it.
Assignee: nobody → ming.li
Flags: needinfo?(james.zhang)
Hi John -- What chipset does the Dolphin use?   Are we (or is someone) trying to get H.264 WebRTC calls working on a Dolphin?  Thanks.
Flags: needinfo?(jolin)
(In reply to Maire Reavy [:mreavy] (Please needinfo me) from comment #5)
> Hi John -- What chipset does the Dolphin use?   Are we (or is someone)
> trying to get H.264 WebRTC calls working on a Dolphin?  Thanks.

Spreadtrum 7715 chipset with ARM CortexA7@1.2G
Hi Andreas, our codec owner said we don't support this feature now and I found QC 8x10 don't support it too.
Can you give us your detail requirement, such as codec resolution, the constant value of bitrate? Our codec owner will try to evaluate it.
Flags: needinfo?(pehrsons)
jesup can answer this better. Remember that H264 over WebRTC is not a 1.4 feature so there is no rush to get this fixed.

Maire: I've been experimenting with getting WebRTC working decently on lower-end phones like the single core dolphin. Both with H261 and now the H264 hardware codec. It works pretty well if you lower the audio sampling frequency and run the browser in the main process.
Flags: needinfo?(rjesup)
Flags: needinfo?(pehrsons)
Flags: needinfo?(jolin)
8x10 supports constant-skip-frames mode, and variable (default).  For interactive communication, we typically want some variety of constant, and control the bitrate manually based on network congestion.  Variable will work, but will cause a number of problems depending on the rate controller implementation.  Without trying it, it's hard to see how bad the problems will be.

You can try the patches from http://hg.mozilla.org/users/rjesup_wgate.com/h264_omx up through "graphing tool", and capture adb logcat, and feed it to tools/performance/graph_timestamp_deltas.py (see the file for info on how to run it).  That should generate various graphs of decode delay and bitrate.
Flags: needinfo?(rjesup)
James is on this bug, clear ni.
Flags: needinfo?(kli)
Assignee: ming.li → nobody
Whiteboard: [sprd332076 ]
Firefox OS is not being worked on
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.