[Libav-user] Accessing basic video parameters

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[Libav-user] Accessing basic video parameters

rohit khali
Very surprsing, Can't we get basic details about stream without decoding using libavcodec APIs like width,height.?
It's all part of sps/pps. I am using  av_parser_parse2() API, which forms an AVC frame.
Please help.

{profile=100 level=31 width=0 height=0 codedwidth=0 codedheight=0 pix_fmt=(null) aspectRatio=0:1         frameRate=0:1 slices=0 } 

Code: /*In my case there is no Input File, I get H264-ES in "data" as below*/
AVCodec* codec = avcodec_find_decoder(AV_CODEC_ID_H264);
AVCodecParserContext* parser = av_parser_init(codec->id);
AVCodecContext* dec_ctx;
dec_ctx = avcodec_alloc_context3(codec);
av_parser_parse2(parser, dec_ctx, &pkt->data, &pkt->size,
                                   data, data_size, AV_NOPTS_VALUE, AV_NOPTS_VALUE, 0);
if (pkt->size)
        printf("{profile=%d level=%d width=%d height=%d codedwidth=%d codedheight=%d pix_fmt=%s aspectRatio=%d:%d 
        frameRate=%d:%d slices=%d }\n",

Libav-user mailing list
[hidden email]

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".