[Live-devel] "no frame!"

Jeff Shanab jshanab at smartwire.com
Wed Jan 11 15:35:44 PST 2012


I have been working with the avcode_decode_video2    for a bit.

If [7] is SPS, [8] is PPS, [5] is a keyframe slice, and [1]'a are the difference frames.

I have found it needs a stream like this

00 00 01 [7]00 00 01[8]00 00 01[5]00 00 01[1]00 00 01[1]....

If you are calling it in a loop it will have no error and no frame until it has enough info.
This often means you get the output frame with a delay of 1 frame and must call until it is done outputting frames.

I personally aggregate the 7,8,5's into a keyframe and pass the whole thing to avcoded_decode_video2.
It can survive without the 7 and 8's after it has got them at least once, but bad packet here or there and it disrupts the video for a while, so I cache them and insert them if the stream does not have them. It is a small price to pay in bandwidth that gives me faster first frame out in VLC or our own player.

So Assuming the [n] means "prefix each "n" with 00 00 01...

This will work [7][8][5][1][1][1][1][1][5][1][1][1][1].....
But I prefer  [7][8][5][1][1][1][1][1][7][8][5][1][1][1][1].....

Also note on high resolution, it may be [7][8][5][5][5][1][1][1][1][1]... Multiple slices to make up huge keyframes, these you may have to call the decoder multiple times before you get a frame.  This does not touch on one more reason to call the decode in a loop until it says it is done. Frames may arrive in a different order than display on high resolution advanced H264 profiles (and even MPEG4) The "bi-directional predictive frames must arrive out of order so the decode order differes from the display order.


From: live-devel-bounces at ns.live555.com [mailto:live-devel-bounces at ns.live555.com] On Behalf Of Menne, Neil
Sent: Wednesday, January 11, 2012 4:54 PM
To: live-devel at lists.live555.com
Subject: [Live-devel] "no frame!"

I'm working on my Live555/FFmpeg video player, and I ran into an interesting problem that has kept me stumped for several days. I am taking the buffer that is delivered to my MediaSink (like the example in testRTSPClient), and I am passing the buffer and the size to FFmpeg to decode. It says that there is "no frame!" I'm stumped as to why that is the case when I'm taking the buffer after the "afterGettingFrame" function is called. I was wondering if there was something else that must be done to that buffer for it to be a true frame that can be decoded.

My first guess is that the decoder needs more information which brings me to my next question: the SDP description that I'm pulling down doesn't contain the width/height, so I'm guessing I need to pull that out of the sprop_parameter_sets; is this the case?

My second guess is that there is no frame separator; I noticed that in one particular file: H264VideoFileSink they prepend a 0x00000001 along with the sprop_parameters. Is this a potential problem?

Video is not my expertise, so I'm spending most days reading anything/everything on these problems, but this one's got me stuck.

-Neil

P.S. My video is an H.264 video stream



________________________________
No virus found in this message.
Checked by AVG - www.avg.com<http://www.avg.com>
Version: 2012.0.1901 / Virus Database: 2109/4736 - Release Date: 01/11/12
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120111/ec27f8be/attachment.html>


More information about the live-devel mailing list