[Live-devel] Creating a RTSP stream from DVB-T hardware card

Ryan Walklin ryanwalklin at gmail.com
Fri Jul 11 19:16:04 PDT 2008


>
Hi Ross, thanks for your quick reply.
> >I'm using an Elgato DVB-T USB tuner (EyeTV for DTT) in combination
> >with the livemedia library to stream a MPEG2-TS stream containing
> >h264 video and AAC audio (LATM encapsulation) via RTSP over my LAN.
> >I've based my streaming server on the testMPEG2TransportStreamer
> >sample.
>
> Does the unchanged "testMPEG3TransportStreamer" demo application work
> correctly when you stream a Transport Stream *file* that you
> previously recorded from your capture device?  It should, but if -
> for some reason - it doesn't, then do not proceed to step 2 :-)
It does indeed.
>
>
> >The EyeTV plugin SDK provides a callback which is activated when
> >~100 or so packets have arrived, and sends the raw TS data via a
> >pipe to the server code, running in another thread. I've modified
> >the code to read from the other end of the pipe I created. I've also
> >removed the MPEG2Framer from the chain as I presumed the packet
> >stream was already in this format.
>
> No, the "MPEG2TransportStreamFramer" also has the job of (1)
> accumulates the incoming Transport Stream packets into groups of 7,
> so that they end up getting packed into outgoing RTP packets
> efficiently, and (2) computing the presentation time and duration of
> each Transport Packet, so that the outgoing RTP packets get
> transmitted with appropriate spacing between them.  You should
> continue to use the MPEG2TransportStreamFramer" object.
> --  
OK, I understand that now, and have re-enabled the framer object. This  
solves the buffer errors I was getting, and both openRTSP and  
libnemesi (another RTSP client) show the stream has been successfully  
created. However, VLC is still unable to play the stream. Things look  
ok in the message log though:

main debug: CPU has capabilities 486 586 MMX 3DNow! MMXEXT SSE SSE2 FPU
main debug: looking for memcpy module: 4 candidates
main debug: using memcpy module "memcpymmxext"
main debug: waiting for thread completion
main debug: thread 2953318400 (playlist) created at priority -47  
(playlist/playlist.c:184)
main debug: waiting for thread completion
main debug: thread 2953850880 (preparser) created at priority -47  
(playlist/playlist.c:210)
main debug: looking for interface module: 1 candidate
main debug: using interface module "hotkeys"
main debug: thread 2954383360 (interface) created at priority -47  
(interface/interface.c:198)
main debug: looking for interface module: 3 candidates
main debug: using interface module "macosx"
main debug: thread 2955448320 (manage) created at priority -47  
(interface/interface.c:164)
main debug: adding playlist item `testStream' ( rtsp://192.168.1.5:8554/testStream 
  )
main debug: creating new input thread
main debug: waiting for thread completion
main debug: thread 2957705216 (input) created at priority 37 (input/ 
input.c:265)
main debug: creating statistics handler
main debug: `rtsp://192.168.1.5:8554/testStream' gives access `rtsp'  
demux `' path `192.168.1.5:8554/testStream'
main debug: creating demux: access='rtsp' demux=''  
path='192.168.1.5:8554/testStream'
main debug: looking for access_demux module: 1 candidate
macosx debug: input has changed, refreshing interface
live555 debug: RTP subsession 'video/MP2T'
main debug: creating demux: access='' demux='ts' path=''
main debug: thread 2958237696 (stream out) created at priority 37  
(input/demux.c:341)
main debug: using access_demux module "live555"
main debug: `rtsp://192.168.1.5:8554/testStream' successfully opened

Here is openRTSP's output (sorry for the long paste..)

Sending request: OPTIONS rtsp://192.168.1.5:8554/testStream RTSP/1.0
CSeq: 1
User-Agent: ./openRTSP (LIVE555 Streaming Media v2008.07.05)


Received OPTIONS response: RTSP/1.0 200 OK
CSeq: 1
Date: Sat, Jul 12 2008 02:13:17 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE


Sending request: DESCRIBE rtsp://192.168.1.5:8554/testStream RTSP/1.0
CSeq: 2
Accept: application/sdp
User-Agent: ./openRTSP (LIVE555 Streaming Media v2008.07.05)


Received DESCRIBE response: RTSP/1.0 200 OK
CSeq: 2
Date: Sat, Jul 12 2008 02:13:17 GMT
Content-Base: rtsp://192.168.1.5:8554/testStream/
Content-Type: application/sdp
Content-Length: 405


Need to read 405 extra bytes
Read 405 extra bytes: v=0
o=- 1215828411688060 1 IN IP4 192.168.1.5
s=Session streamed by "testMPEG2TransportStreamer"
i=LIVE555 Streaming Media v
t=0 0
a=tool:LIVE555 Streaming Media v2008.07.05
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:Session streamed by "testMPEG2TransportStreamer"
a=x-qt-text-inf:LIVE555 Streaming Media v
m=video 1234 RTP/AVP 33
c=IN IP4 239.255.42.42/7
a=control:track1

Opened URL "rtsp://192.168.1.5:8554/testStream", returning a SDP  
description:
v=0
o=- 1215828411688060 1 IN IP4 192.168.1.5
s=Session streamed by "testMPEG2TransportStreamer"
i=LIVE555 Streaming Media v
t=0 0
a=tool:LIVE555 Streaming Media v2008.07.05
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:Session streamed by "testMPEG2TransportStreamer"
a=x-qt-text-inf:LIVE555 Streaming Media v
m=video 1234 RTP/AVP 33
c=IN IP4 239.255.42.42/7
a=control:track1

Created receiver for "video/MP2T" subsession (client ports 1234-1235)
Sending request: SETUP rtsp://192.168.1.5:8554/testStream/track1 RTSP/ 
1.0
CSeq: 3
Transport: RTP/AVP;multicast;client_port=1234-1235
User-Agent: ./openRTSP (LIVE555 Streaming Media v2008.07.05)


Received SETUP response: RTSP/1.0 200 OK
CSeq: 3
Date: Sat, Jul 12 2008 02:13:17 GMT
Transport: RTP/ 
AVP 
;multicast 
;destination=239.255.42.42;source=192.168.1.5;port=1234-1235;ttl=7
Session: 4


Setup "video/MP2T" subsession (client ports 1234-1235)
Created output file: "video-MP2T-1"
Sending request: PLAY rtsp://192.168.1.5:8554/testStream/ RTSP/1.0
CSeq: 4
Session: 4
Range: npt=0.000-
User-Agent: ./openRTSP (LIVE555 Streaming Media v2008.07.05)


Received PLAY response: RTSP/1.0 200 OK
CSeq: 4
Date: Sat, Jul 12 2008 02:13:17 GMT
Range: npt=0.000-
Session: 4
RTP-Info: url=rtsp://192.168.1.5:8554/testStream/track1;seq=60417;rtptime=2653845066


Started playing session
Receiving streamed data (signal with "kill -HUP 23285" or "kill -USR1  
23285" to terminate)...


Again this all looks ok. Thanks for your help so far, I'm sure it's  
just something silly I haven't done.

Regards.

Ryan

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


More information about the live-devel mailing list