[FFmpeg-devel] RTP input stream blocks ffmpeg

Yohann Martineau yohann.martineau
Thu Sep 20 12:34:11 CEST 2007


Thank you for your answer, thank you for helping ffmpeg-newbies like me...

Luca Abeni a ?crit :
> Hi,
> I believe this question belongs to ffmpeg-users, anyway:
> Yohann Martineau wrote:
>> I'm trying to transcode a video stream sent over RTP from h263 to 
>> mpeg2video, and to forward this transcoded stream over RTP.
> AFAIK, ffmpeg does not support receiving h.263 in RTP (support for the 
> h.263 payload is not implemented).

Yes, it seems that it's not possible directly. But I made a capture of 
my stream with wireshark, dumped the h263 payload in a raw file and 
opened this raw file successfully with ffmpeg (and with ffplay), giving 
the appropriated format/codec info:

$ ffmpeg.exe -f h263 -vcodec h263 -i h263.raw

Thus, I thought it was possible to open this raw stream from network 
instead of file. I wrote a small application in java that takes my 
RTP/H263 stream as input and dumps the raw payload on another port. But 
I don't know if it's possible to specify ffmpeg a port on which it 
should listen for incoming packets...

>> The following command gets stuck:
>> $ ffmpeg.exe -i rtp://
> I suspect this command line is wrong. You need to use an rtsp:// url, or 
> to provide an SDP file.

You're right, I just discovered that it was possible to give a .sdp text 
file as input to ffmpeg...

So I tried several commands to stream my video and receive it with ffmpeg.

Here is the first command I used to stream my video:

$ ffmpeg.exe -f h263 -vcodec h263 -i h263.raw -f rtp 

This command gives me a session description:

o=- 0 0 IN IPV4
t=0 0
s=No Name
c=IN IP4
m=video 10002 RTP/AVP 34

I put this in a text file called test.sdp.

Then I provide this file as input for ffmpeg:

$ ffmpeg.exe -i test.sdp

And I launch my previous streaming command. ffmpeg then finds the video 
stream and ask me for an output file. great.

But when I try to transcode and stream with the following command:

$ ffmpeg.exe -f h263 -vcodec h263 -i h263.raw -f rtp -vcodec mpeg2video 

The ffmpeg instance that receives packets says nothing.

Diving into SDP, i saw that the media attribute of the sdp generated 
without '-vcodec mpeg2video' gives a payload type of 35, which 
corresponds to H263. This is ok. When I launch the command with '-vcodec 
mpeg2video', the payload type is 96, which is a dynamic payload type. 
But there is no a=rtpmap:96 ... in the sdp generated.
If I launch the command with '-vcodec mpeg4', here is the end of the SDP:

m=video 10002 RTP/AVP 96
a=rtpmap:96 MP4V-ES/90000
a=fmtp:96 profile-level-id=1

This one is ok. The dynamic payload type is described in an attribute.

>> I try to get codec information from this command line. But I have 
>> nothing on my console.
> Maybe you even wrote the wrong IP:port. Note that you likely need to 
> specify "?local_port=..." in the url.

Once again: thank you.

Asterisk was "the future of telephony", but ffmpeg is "the future of 
television" !


> 				Luca
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel

More information about the ffmpeg-devel mailing list