[Ffmpeg-devel] Initialize h.264 decoding from SDP

Engin Kurutepe kurutepe
Thu Feb 8 10:31:50 CET 2007


Hello All,

I am trying to stream H.264. Live555 library handles RTSP/RTP/SDP.

I am new to ffmpeg API. I would really appreciate if you could provide 
me with some pointers on how to decode received NALU's. I have created 
classes to pass the received NALU's to avcodec_decode_video(), however 
it never sets got_frame. I'm sure this is because I am not initializing 
my AVCodecContext instance properly. Below is what I do to initialize my 
AVCodecContext instantce, which obviously not complete:

     codecContext = NULL;

     codec = avcodec_find_decoder(CODEC_ID_H264);

     if (!codec) {
             fprintf(stderr, "codec not found\n");
             exit(1);
         }

     codecContext = avcodec_alloc_context();
         picture= avcodec_alloc_frame();

     if(codec->capabilities&CODEC_CAP_TRUNCATED)
             codecContext->flags|= CODEC_FLAG_TRUNCATED;

      /* open it */
     if (avcodec_open(codecContext, codec) < 0) {
             fprintf(stderr, "could not open codec\n");
             exit(1);
         }


There is a function called sdp_parse() inside rtsp.c which might do the 
job, but it is not declared in a header file, and therefore not 
accessible for me.

Any hints, anyone?

Thanks a lot in advance,
Engin Kurutepe






More information about the ffmpeg-devel mailing list