[Live-devel] using stdin for live555MediaServer
Ross Finlayson
finlayson at live555.com
Fri Aug 21 09:33:31 PDT 2020
> On Aug 22, 2020, at 2:11 AM, Simon Brown <sbrown at microvideo.co.uk> wrote:
>
> Hi,
>
> I'm trying to send a live transport stream over RTSP. I initially tested with testMPEG2TransportStreamer having modified it to pull from stdin and got results, though there was significant picture break up/dropped frames because it was using UDP.
The main difference between “testMPEG2TransportStreamer” and the “LIVE555 Media Server” (and “testOnDemandRTSPServer”; see below) is that the former streams RTP over UDP multicast, whereas the latter streams (by default) RTP over UDP unicast. It sounds like the bitrate of your encoded transport stream is approaching (if not exceeding) the capacity of your network. This is something that you should fix (e.g., by reducing the resolution and/or frame rate of your encoder). (Note that you CANNOT fix this by trying to stream RTP-over-TCP; you need to reduce the bitrate of your stream.)
> So instead I've started using live555MediaServer because that can do the same thing. I've gratuitously modified MPEG2TransportFileServerMediaSubsession::createNewStreamSource to change liveStream.ts to "stdin" on the filename.
Instead of modifying the LIVE555 library code, which is not recommended (and will get you no support here), you should instead work from the “testOnDemandRTSPServer” demo application, in the “testProgs” directory.
At line 239 of “testOnDemandRTSPServer.cpp", change
char const* inputFileName = "test.ts”;
char const* indexFileName = "test.tsx";
to
char const* inputFileName = “stdin”;
char const* indexFileName = NULL;
> If I now run the server with cat test.ts | live555MediaServer and then go to "rtsp://192.168.1.14/liveStream.ts" on VLC on a different machine I can view that ts. However, if I then connect my encoder to stdin (via "C" pipes, as worked for testMPEG2TransportStreamer) then VLC complains that it can't open the file. Is there any accepted technique for this?
>
> Any other clues as to what I might be doing wrong?
I suggest doing the following, in order (making sure that each step works OK before moving to the next step):
1/ Capture ‘stdin’ into a “.ts” file - e.g., running
cat < your-encoder-source > source.ts
2/ Make sure that that the “source.ts” file plays normally (e.g., using VLC)
3/ Try streaming the “source.ts” file (e.g., using the LIVE555 Media Server), and receiving it (over the network), using “openRTSP”, rather than VLC
See http://www.live555.com/openRTSP
4/ Rename the resulting "VIDEO-*” file to “received.ts”, and try playing that file using VLC
5/ Use VLC (instead of “openRTSP”) as a RTSP client, to play the stream from the “rtsp://“ URL
6/ Connect your encoder source to “testOnDemandRTSPServer” (modified as noted above), by running
your-modified-testOnDemandRTSPServer < your-encoder-source
7/ Try receiving the stream remotely using “openRTSP”
8/ Rename the resulting "VIDEO-*” file to “received.ts”, and try playing that file using VLC
9/ Use VLC (instead of “openRTSP”) as a RTSP client, to play the stream from the “rtsp://“ URL
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
More information about the live-devel
mailing list