You may be doing a bit more work than is necessary. Most H264 streams have the 
SPS and PPS embedded periodically.

Here is my setup, note the extradata is set to NULL and size set to 0. This you 
need to do then on decode of the first frame liavcode fills in the rest of the 
context.

pCodec_ = avcodec_find_decoder(CODEC_ID_H264);
                           if (!pCodecCtx_) {
                                  throw std::exception("[CH264Filter]: Can't 
allocate pCodecCtx_!");
                           }
                           pCodecCtx_ = avcodec_alloc_context();


                           pCodecCtx_->skip_frame            = 
AVDISCARD_DEFAULT;
                           pCodecCtx_->skip_idct             = 
AVDISCARD_DEFAULT;
                           pCodecCtx_->skip_loop_filter    = AVDISCARD_DEFAULT;

                           pCodecCtx_->error_concealment   = FF_EC_GUESS_MVS | 
FF_EC_DEBLOCK ;


                           pCodecCtx_->workaround_bugs     = FF_BUG_AUTODETECT 
| FF_BUG_MS;
                           pCodecCtx_->strict_std_compliance = 
FF_COMPLIANCE_NORMAL | FF_COMPLIANCE_UNOFFICIAL;
                           pCodecCtx_->error_recognition   = FF_ER_CAREFUL;
                           pCodecCtx_->codec_type            = CODEC_TYPE_VIDEO;
                           pCodecCtx_->codec_id            = CODEC_ID_H264;
                           pCodecCtx_->codec_tag             =  MKTAG('H', '2', 
'6', '4');


                           pCodecCtx_->extradata             = NULL;
                           pCodecCtx_->extradata_size        = 0;


                           res = avcodec_open(pCodecCtx_, pCodec_);
                           if(res < 0)
                                  throw std::exception("Can't open video 
codec!");

I actually create the SPS and PPS from the spprops and insert them into the 
stream if the encoder does not do already do that for me. (Like VLC does when 
capturing)


From: live-devel-boun...@ns.live555.com 
[mailto:live-devel-boun...@ns.live555.com] On Behalf Of Jer Morrill
Sent: Wednesday, January 11, 2012 6:51 PM
To: LIVE555 Streaming Media - development & use
Subject: Re: [Live-devel] "no frame!"

I just implemented an custom H264 source and decoder with FFMPEG.  Here's how I 
did it (in concept):


1.)    Get the subsession->fmtp_configuration() string

2.)    Do something like this with H264VideoRTPSource.hh included - "auto 
records = parseSPropParameters(fmtp_configuration, recordCount);"

3.)    Each of the returned records from step 2, prepend a 0x00000001

4.)    Each sample you send to FFMPEG, prepend each of your records from step 3 
to your sample buffer

I'm not sure if I'm telling you incorrect information, but this worked for me!

-Jer

From: 
live-devel-boun...@ns.live555.com<mailto:live-devel-boun...@ns.live555.com> 
[mailto:live-devel-boun...@ns.live555.com]<mailto:[mailto:live-devel-boun...@ns.live555.com]>
 On Behalf Of Menne, Neil
Sent: Wednesday, January 11, 2012 2:54 PM
To: live-devel@lists.live555.com<mailto:live-devel@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/4737 - Release Date: 01/11/12
_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to