[Libav-user] SPS/PPS parameters generation

Dmitry Kosei sendnewmailmessage at gmail.com
Fri May 25 10:53:53 CEST 2012


Hi! I'm using such code for initialization:

    avcodec_register_all();
    av_register_all();
    avformat_network_init();

    const char *filename="rtp://192.168.0.101:10202";

    AVOutputFormat *formatRTP = av_guess_format("rtp", filename, NULL);
    pFormatRTP = avformat_alloc_context();
    pFormatRTP->oformat = formatRTP;

    video_st = av_new_stream(pFormatRTP, AVMEDIA_TYPE_VIDEO);
    avcodec_get_context_defaults3(video_st->codec,
avcodec_find_encoder(CODEC_ID_H264));
    H264Context = video_st->codec;
    H264Context->codec_id = CODEC_ID_H264;
    H264Context->codec_type = AVMEDIA_TYPE_VIDEO;
    H264Context->width = VideoWidth;
    H264Context->height = VideoHeight;
    H264Context->time_base.den = VideoFps;
    H264Context->time_base.num = 1;
    H264Context->pix_fmt = PIX_FMT_YUV420P;
    H264Context->flags |= CODEC_FLAG_GLOBAL_HEADER;

    if (avio_open(&pFormatRTP->pb, filename, 2) != 0) {
                return S_FALSE;
    }

    if(avformat_write_header(pFormatRTP, NULL)!=0)
    {
            return S_FALSE;
    }

But when I call av_sdp_create after that, it neither returns
sprop-parameter-sets for sdp nor profile-level-id.
Can somebody help?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120525/76263bcf/attachment.html>


More information about the Libav-user mailing list