[FFmpeg-devel] avf_sdp_create problem
Luca Abeni
lucabe72
Mon Jul 19 20:38:34 CEST 2010
Hi,
On 19/07/10 17:15, Dominik Tomczak wrote:
> Hello
>
> In FFmpeg libavformat I open the url by
> url_fopen(&m_fmtCtx->pb, "rtp://localhost:7777", URL_WRONLY );
>
> then I want to generate SDP from this URL context. I call.
> avf_sdp_create
How do you call avf_sdp_create()? I suspect there is some issue in your
code, because ffmpeg.c works fine:
[luca at dhcp047 ffmpeg]$ ./ffmpeg -re -i
~/src/Devel/SOCCER_352x288_30_orig_02.avi -an -vcodec mpeg4 -f rtp
rtp://localhost:7777
FFmpeg version SVN-r24332, Copyright (c) 2000-2010 the FFmpeg developers
built on Jul 19 2010 20:29:37 with gcc 4.4.4 20100630 (Red Hat 4.4.4-10)
configuration:
libavutil 50.22. 0 / 50.22. 0
libavcodec 52.84. 0 / 52.84. 0
libavformat 52.75. 0 / 52.75. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.25. 1 / 1.25. 1
libswscale 0.11. 0 / 0.11. 0
Input #0, avi, from '/home/luca/src/Devel/SOCCER_352x288_30_orig_02.avi':
Metadata:
ISFT : Lavf1d.51.10.0
Duration: 00:00:12.00, start: 0.000000, bitrate: 278 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 352x288 [PAR 1:1 DAR 11:9], 25
tbr, 25 tbn, 25 tbc
Output #0, rtp, to 'rtp://localhost:7777':
Metadata:
encoder : Lavf52.75.0
Stream #0.0: Video: mpeg4, yuv420p, 352x288 [PAR 1:1 DAR 11:9],
q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
Stream #0.0 -> #0.0
SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 127.0.0.1
t=0 0
a=tool:libavformat 52.75.0
m=video 7777 RTP/AVP 96
b=AS:200
a=rtpmap:96 MP4V-ES/90000
a=fmtp:96 profile-level-id=1
[...]
Here, the SDP is correct, and it is generated by calling avf_sdp_create().
> the generated SDP file does not include port number. It should be 7777 but
> is always 0. I looked into sdp.c code, function sdp_get_address and it
> always returns 0 for port if the protocol is RTP.
It seems to work fine here... Are you correctly setting the "filename"
field in the AVFormatContext?
> How can I generate SDP file for RTP (video codec h264) so that VLC can
> correctly play the stream?
See ffmpeg.c:print_sdp() and its usage...
Luca
More information about the ffmpeg-devel
mailing list