Steffen Ebersbach escribió:
Am 12.11.2010 08:08, schrieb Sergio Arroutbi:
Hello.
I am trying to decode images coming from a H264 Axis camera.
This camera is sending H.264 stream based on some information provided
in SDP (sent via 200 Ok responses to RTSP DESCRIBE messages).
After sending RTSP requests, I start receiving the stream.
Once the stream is received, I dont know how to parse the RTP messages
in order to be able to decode the
What i have is basically a socket that reads the RTP packets, get RTP
payload and calls:
avcodec_decode_video(*context, *decoded_image, &got_picture, frame,
frame_size)), where "frame" and "frame_size" are the RTP payload and RTP
payload length. I continously get the error:
[h264 @ 0x99b7a20]no frame!
After investigating the issue, I guess that I have to parse RTP payload
in order to get "raw H264 frames". I discovered RFC3984 (that talks
about this topic), but I believe ffmpeg library does already perform
"RFC3984 performance", as it has some methods to parse the sdp, RTP, etc.
Which is the best method to decode the frames by calling
avcodec_decode_video?
I guess I have to pass SDP information to AVContext*, but do not know
how to do so.
Anyone could perform decoding of frames in a H.264 stream encapsulated
in RTP?
Which is the best method to use?
Thanks a lot.
Sergio.
Hi,
you're right, ffmpeg can receive RTP streams. It also parse the
informations from rtsp / sdp.
The function you should use is av_open_input_file() with the address of
the stream , for example rtsp://www.****.com/*** .
Then ffmpeg parses the information to AVContext*. with
av_find_stream_info(). After that you can initialize the decoder , based
on the stream informations.
The rtp-payload can then read by av_read_frame() and pass do
av_decode_video.
Steffen
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
Hi Steffen,
Thanks a lot for your comments.
I tried to perform the connection with av_find_stream_info () but
function blocks and dumps:
[sdp @ 0x8d14060] Could not find codec parameters (Video: h264)
[sdp @ 0x8d14060] Estimating duration from bitrate, this may be inaccurate
I am using the SDP that the camera I am trying to connect to is
responding in 200 OK RTSP of DESCRIBE message. The sdp file looks like this:
v=0
o=- 1012156932815950 1012156932815950 IN IP4 10.0.0.10
s=Media Presentation
e=NONE
c=IN IP4 0.0.0.0
b=AS:50000
t=0 0
a=control:rtsp://10.0.0.10:554/axis-media/media.amp?videocodec=h264&resolution=VGA&videobitrate=5000&videobitratepriority=frame
rate&fps=30&duration=0
a=range:npt=0.000000-
m=video 0 RTP/AVP 96
b=AS:50000
a=framerate:30.0
a=control:rtsp://10.0.0.10:554/axis-media/media.amp/trackID=1?videocodec=h264&resolution=VGA&videobitrate=5000&videobitrateprio
rity=framerate&fps=30&duration=0
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1; profile-level-id=420029;
sprop-parameter-sets=Z0IAKeKQFAe2AtwEBAaQeJEV,aM48gA==
--
Sergio Arroutbi Braojos
Ingeniero de Desarrollo Software
Grupo GMIS
SEPSA
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user