Discussion:
Can live555 read RTP data from ffmpeg?
Lan Zang
2013-01-11 14:30:15 UTC
Permalink
Hi, 

I am sending MPEG TS data over RTP by ffmpeg, like "ffmpeg -i file.ts -c copy -f mpegts rtp://localhost:1234". I want live555 can get these RTP data. I modified the testOnDemandRTSPServer.cpp to use unicast address for the mpeg2TransportStreamFromUDPSourceTest item. I then run testOnDemandRTSPServer. But it seems that my video player(VLC player) got nothing from testOnDemandRTSPServer while playing URL like "rtsp://192.168.133.195:8554/mpeg2TransportStreamFromUDPSourceTest". 
Is there anything more need to be done to make this thing work? Shall I change SimpleRTPSource in MPEG2TransportUDPServerMediaSubsession::createNewStreamSource() to other RTPSource?

Regards,
Lan Zang(Sander)
Ross Finlayson
2013-01-12 06:08:59 UTC
Permalink
Post by Lan Zang
I am sending MPEG TS data over RTP by ffmpeg, like "ffmpeg -i file.ts -c copy -f mpegts rtp://localhost:1234". I want live555 can get these RTP data.
If your only source of MPEG TS data is from files, then you don't need to use "ffmpeg" at all. Instead, you can stream your "file.ts" directly from our server. (If you are using "testOnDemandRTSPServer", then you rename "file.ts" as "test.ts". If you are using "live555MediaServer", then you don't need to rename your file, as long as its name ends with ".ts".)
Post by Lan Zang
I modified the testOnDemandRTSPServer.cpp to use unicast address for the mpeg2TransportStreamFromUDPSourceTest item.
By this I presume that you changed the definition of "inputAddressStr" to:
char const* inputAddressStr = NULL;
Post by Lan Zang
I then run testOnDemandRTSPServer. But it seems that my video player(VLC player) got nothing from testOnDemandRTSPServer while playing URL like "rtsp://192.168.133.195:8554/mpeg2TransportStreamFromUDPSourceTest".
I suggest first using "testRTSPClient" as your RTSP client application, instead of VLC.
Post by Lan Zang
Is there anything more need to be done to make this thing work?
No, I don't think so, assuming that your "ffmpeg" command generates RTP-encapsulated MPEG Transport Stream packets (with the correct RTP payload format code: 33). However, I don't know enough about "ffmpeg" to say for sure whether it's doing what you intend.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
Lan Zang
2013-01-12 14:00:52 UTC
Permalink
Ross,

Thanks for quick reply. I am trying to simplify my question, so, there might be some errors in my description. 
I am not actually using a plain media file. I get video from camera and encode them by "ffmpeg". The weird thing about ffmpeg is that although the ffmpeg command options say that the output is RTP. Through the captured udp packets, it is not. The output are mpeg ts data over UDP directly, and one group fo UDP data have been fragmented into several UDP packets. So, in this case, shall I use BasicUDPSource instead of SimpleRTPSource as source? Can BasicUDPSource handle fragmented UDP data?

Regards,
Lan Zang(Sander)


________________________________
From: Ross Finlayson <***@live555.com>
To: LIVE555 Streaming Media - development & use <live-***@ns.live555.com>
Sent: Saturday, January 12, 2013 2:08 PM
Subject: Re: [Live-devel] Can live555 read RTP data from ffmpeg?


I am sending MPEG TS data over RTP by ffmpeg, like "ffmpeg -i file.ts -c copy -f mpegts rtp://localhost:1234". I want live555 can get these RTP data.
If your only source of MPEG TS data is from files, then you don't need to use "ffmpeg" at all.  Instead, you can stream your "file.ts" directly from our server.  (If you are using "testOnDemandRTSPServer", then you rename "file.ts" as "test.ts".  If you are using "live555MediaServer", then you don't need to rename your file, as long as its name ends with ".ts".)



I modified the testOnDemandRTSPServer.cpp to use unicast address for the mpeg2TransportStreamFromUDPSourceTest item.
By this I presume that you changed the definition of "inputAddressStr" to:
char const* inputAddressStr = NULL;


I then run testOnDemandRTSPServer. But it seems that my video player(VLC player) got nothing from testOnDemandRTSPServer while playing URL like "rtsp://192.168.133.195:8554/mpeg2TransportStreamFromUDPSourceTest". 
I suggest first using "testRTSPClient" as your RTSP client application, instead of VLC.



Is there anything more need to be done to make this thing work?
No, I don't think so, assuming that your "ffmpeg" command generates RTP-encapsulated MPEG Transport Stream packets (with the correct RTP payload format code: 33).  However, I don't know enough about "ffmpeg" to say for sure whether it's doing what you intend.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
Ross Finlayson
2013-01-12 14:51:17 UTC
Permalink
I am not actually using a plain media file. I get video from camera and encode them by "ffmpeg". The weird thing about ffmpeg is that although the ffmpeg command options say that the output is RTP. Through the captured udp packets, it is not. The output are mpeg ts data over UDP directly, and one group fo UDP data have been fragmented into several UDP packets. So, in this case, shall I use BasicUDPSource instead of SimpleRTPSource as source?
Yes, but the way to do this is to change the "testOnDemandRTSPServer" code to set the constant "inputStreamIsRawUDP" to True. (See "testProgs/testOnDemandRTSPServer.cpp", line 338.)


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

Loading...