[libav-api] Question on H264 decoder behavior

wl2776 wl2776 at gmail.com
Wed Oct 26 16:26:31 CEST 2011


Ronald S. Bultje wrote:
> 
> Hi,
> 
> On Wed, Oct 26, 2011 at 4:08 AM, wl2776 <wl2776@> wrote:
>> Hi all.
>> Can h264 decoder return a frame which it has already returned some time
>> ago,
>> if it can't work with the current frame?
> 
> No.
> 
>> I'm writing a player, playing a live RTP video stream, and sometimes,
>> when
>> the incoming bitrate is high, I observe image flickering, like if the
>> player
>> displays one of previous frames (the moving car or human jumps back and
>> forth).
>>
>> One more thing - I'm using my own demuxer, whose code was adopted from
>> libav, from file rtpdec_h264.c
>>
>> However, when the incoming bitrate is low, everything works just fine,
>> nothing jumps.
>>
>> So, if the h264 decoder simply returns previous frame, how can I change
>> this
>> behavior?
> 
> Do you get any messages on stdout?
> 
> Ronald
> 
Yes, I see a lot of messages like the following
[h264 @ hex_address] no frame!
[h264 @ hex_address] no picture
[h264 @ hex_address] Frame num gap 1 65534

Looks like I've found the problem, but not very sure, so I'd like to see
your comments.
Here is my decoding function: http://pastebin.com/TvuVkijd

I pushed decoded picture to the rendering with PTS, came from the RTP
timestamp.
Then I added the following code



Artifacts with jumping cars and people seems to be gone.

Debug output also show that there are cases, when decode->pkt_pts differs
from sample_m_pts and decode->pkt_dts and decode->best_effort_timestamp


--
View this message in context: http://libav-api.1054858.n5.nabble.com/Question-on-H264-decoder-behavior-tp4939415p4939917.html
Sent from the libav-api mailing list archive at Nabble.com.


More information about the libav-api mailing list