I cannot give you the sample application/apk for now, because it contains confidential information.Hope you understand. By the mean time I will try to simulate this use cases by excluding those information.
Here is an update. When I tested with skype video call from Jetson device to PC, the delay is less than 80 milliseconds. I am not sure what encoder they are using.
Here are few other questions I have.
what are all the hardware and software video encoders supported by TK1?
what are all the hardware and software video decoders supported by TK1?
No, it should not be the reason. H264 hw encoder and decoder are separate units and work independently on tk1. However, I am not able to explain where the delay comes from as I don’t have the detail of the video call application. But it looks like you can run h264 hw decoder and h264 sw google encoder to get better performance in the usecase.
We just started to home in on where the issue is occurring.
Whn I adjusted the timeout value of MediaCodec.dequeueOutputBuffer()method in our application, inconsistently I can see there is no latency.
(at first the value is (1000000 / 30) microseconds , ie 33ms tuned to 30 frames per second and by reducing(to 7 ms) this will results in avoiding latency, but not consistent.)
It seems timing/signalling flaw in the way that the Synchronous MediaCodec API works.
My understanding is the same application code works fine with software encoder where as in case of hw encoder I am getting this inconsistent and synchronous issue. Do I need to handle any thing specific in my application to make hw encoder works fine?
Thanks for these test results. To be more specific,my results includes network delay since our application is transmitting the encoded video over internet. I guess that may be the case. I will check that too and tell you the results.
Here is an important update. It seems we have found out the root cause of this issue as below.
Jetson hw encoder is outputting a LevelID of 50 (5.0), where as other devices I have tested uses encoder with LevelID 13 (1.3). To determine if this was causing the delay, the LevelID in the Sequence Header was altered in a test sequence from 50 to 13, the delay disappeared.
So my question now is, where this LevelID of encoders are mentioned in Jetson. I have checked with media_profiles.xml in Jeston and it is something like below.
The VideoEditor Export codec profile and level values
correspond to the values in OMX_Video.h.
E.g. for h264, profile value 1 means OMX_VIDEO_AVCProfileBaseline
and level 512 means OMX_VIDEO_AVCLevel31.
Please note that the values are in decimal.
These values are for video encoder.
Codec = h.264, Baseline profile, level 4
<ExportVideoProfile name="h264" profile="1"
In the above code what is level=2048 means? But I didn’t get much information about changing this level ID. Can you help me on this?
Please check if configuring the following setting to hw h264 encoder helps:
int width = 352;
int height = 288;