Click here to Skip to main content
15,879,326 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Greetings,
I'm using FFmpegs libavcodec (c/c++) to receive video streams.
Code:
C#
av_register_all();

     avcodec_register_all(); //-X777 not needed if av_register_all() called

     ///////////////////////////////////////////////////-[Network]
     avformat_network_init();

     ///////////////////////////////////////////////////-[Devices]
     avdevice_register_all();


C#
//-zz open file or rtsp or udp
     if ( avformat_open_input( &ifcx, sFileInput, NULL, NULL) != 0 )
     {
       printf( "[A012] Cannot open input %s\n", sFileInput );

       return 1;
     }

Question: when the above method runs "avformat_open_input", I see, console output:
CSS
[rtsp @ 005816a0] SDP:
v=0
o=- 1389961517857208 1389961517857219 IN IP4 10.156.13.244
s=Media Presentation
e=NONE
c=IN IP4 0.0.0.0
b=AS:1500
t=0 0
a=control:*
a=range:npt=now-
a=mpeg4-iod: "data:application/mpeg4-iod;base64,AoDUAE8BAf/3AQOAbwABQFBkYXRhOmFwcGxpY2F0aW9uL21wZWc0LW9kLWF1O2
Jhc2U2NCxBUjBCR3dVZkF4Y0F5U1FBWlFRTklCRUVrK0FBRnVOZ0FCYmpZQVlCQkE9PQQNAQUABAAAAAAAAAAAAAYJAQAAAAAAAAAAAzoAAkA2
ZGF0YTphcHBsaWNhdGlvbi9tcGVnNC1iaWZzLWF1O2Jhc2U2NCx3QkFTWVFTSVVFVUZQd0E9BBICDQAAAgAAAAAAAAAABQMAAEAGCQEAAAAAAA
AAAA=="
a=isma-compliance:1,1.0,1
m=video 0 RTP/AVP 96
b=AS:1500
a=framerate:30.0


Notice that that last line I've posted reads "a=framerate:30.0 and that's what I'd like to capture. Although there are other methods in the libavcodec and libavformat that retrieves the frame rate, it is wrong (ex. 100 fps)
I need to get the above console output "a-framerate:30.0

Any ideas ? Thanks ahead !
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900