Hi there,
this forum has been most helpful and I want to contribute my experiences here.
The Goal is to get the stream from several IP Cams grabbed by VLC, stream it to Wowza and display it on a website using JP Flash Player. Starting up unattendet and automatically in runlevel 3 (I have some trouble with that, though), No GUI and stuff. Environment is a Quad Core 2.8 with 4GB of RAM and SuSE 11.0 Distribution. Versions are up-to-date as of now.
Since the Cam transmits MPEG4-TS and Flash-Players do not understand that format, I had to transcode the stream (thanks to this posting I was able to get a clue on how to do that: https://www.wowza.com/docs/how-to-use-vlc-as-a-live-stream-encoder-with-wowza-media-server-mpeg-ts).
Now, here is, what I’ve done so far:
Transcoding and streaming with a single instance of VLC does not work very well, so we had to create a pipe for each stream, we want to grab.
Making the Pipe:
mkfifo /tmp/vpipe1
Getting the first RTSP stream, sending it to the pipe (notice the cvlc instead of vlc for starting it GUI-less):
cvlc -vvv rtsp://ip.of.the.cam:554/live.sdp --no-sout-audio --sout-udp-caching 10 --sout "#std{mux=ts,access=file,dst=/tmp/vpipe1}"
Reading the Pipe, transcode to .h264 and stream to Wowza:
cvlc -vvv /tmp/vpipe1 --no-sout-audio --sout-udp-caching 10 --sout "#transcode{venc=x264,vcodec=x264,vb=500,scale=1}:rtp{dst=127.0.0.1,port-video=10010,sdp=file:///usr/local/WowzaMediaServerPro/content/cam1.sdp}"
Display the stream on the website using JP Player:
[HTML][/HTML]
Repeat all steps for each Cam you wanna use. Use vpipe2, vpipe3,…, vpipe100 depending on the ammount of cams (keep in mind, that this might consume a lot of CPU Power though!)
That’s about it.
Threre are some Questions left:
- I have 3 streams running fine so far, unfortunately I’m getting an error sometimes: live555 demux error: no data received in 10s, aborting
followed by Nothing to play. The cam is working fine, the stream should be available.
Full log:
Received DESCRIBE response: RTSP/1.0 200 OK
CSeq: 7
Date: Mon, 29 Sep 2008 16:15:57 GMT
Content-base: rtsp://192.168.2.103:3554/live.sdp/
Content-Type: application/sdp
Content-Length: 341
Need to read 341 extra bytes
Read 341 extra bytes: v=0
o=RTSP 815315 15 IN IP4 0.0.0.0
s=RTSP server
c=IN IP4 0.0.0.0
t=0 0
a=charset:Shift_JIS
a=range:npt=0-
a=control:*
a=etag:1234567890
m=video 0 RTP/AVP 96
b=AS:1200
a=rtpmap:96 MP4V-ES/30000
a=control:trackID=1
a=fmtp:96 profile-level-id=3;config=000001B003000001B509000001000000012000C48881F4514043C1463F;decode_buf=76800
[00000413] live555 demux debug: RTP subsession 'video/MP4V-ES'
Sending request: SETUP rtsp://192.168.2.103:3554/live.sdp/trackID=1 RTSP/1.0
CSeq: 8
Transport: RTP/AVP/TCP;unicast;interleaved=0-1
User-Agent: VLC media player (LIVE555 Streaming Media v2008.07.24)
Received SETUP response: RTSP/1.0 200 OK
CSeq: 8
Date: Mon, 29 Sep 2008 16:15:57 GMT
Session: 29229861;timeout=80
Transport: RTP/AVP/TCP;interleaved=0-1;unicast;mode=play
[00000436] main packetizer debug: looking for packetizer module: 17 candidates
[00000436] packetizer_mpeg4video packetizer debug: opening with vol size: 30
[00000436] main packetizer debug: using packetizer module "packetizer_mpeg4video"
[00000436] main packetizer debug: TIMER module_Need() : 0,169 ms - Total 0,169 ms / 1 intvls (Avg 0,169 ms)
[00000436] main packetizer debug: thread 2990517136 (decoder) created at priority 0 (input/decoder.c:217)
[00000413] live555 demux debug: setup start: 0 stop:0
Sending request: PLAY rtsp://192.168.2.103:3554/live.sdp RTSP/1.0
CSeq: 9
Session: 29229861
Range: npt=0,000-
User-Agent: VLC media player (LIVE555 Streaming Media v2008.07.24)
[00000436] main packetizer debug: thread started
Received PLAY response: RTSP/1.0 200 OK
CSeq: 9
Date: Mon, 29 Sep 2008 16:15:57 GMT
Session: 29229861;timeout=80
RTP-Info: url=rtsp://192.168.2.103:3554/live.sdp/trackID=1;seq=0;rtptime=0
Range: npt=0-
RTCP-Interval: 250
[00000413] live555 demux debug: play start: 0 stop:0
[00000413] live555 demux error: no data received in 10s, aborting
[00000405] main input debug: EOF reached
[00000362] main playlist debug: finished input
[00000362] main playlist debug: dying input
[00000362] main playlist debug: dying input
Sending request: TEARDOWN rtsp://192.168.2.103:3554/live.sdp RTSP/1.0
CSeq: 10
Session: 29229861
User-Agent: VLC media player (LIVE555 Streaming Media v2008.07.24)
[00000413] main demux debug: removing module "live555"
[00000436] main packetizer debug: removing module "packetizer_mpeg4video"
[00000436] main packetizer debug: thread ended
[00000436] main packetizer debug: thread 2990517136 joined (input/decoder.c:248)
[00000436] main packetizer debug: killing decoder fourcc `mp4v', 0 PES in FIFO
[00000405] main input debug: thread ended
[00000362] main playlist debug: dead input
[00000405] main input debug: thread 3003014032 joined (playlist/engine.c:244)
[00000405] main input debug: TIMER input launching for 'rtsp://192.168.2.103:3554/live.sdp' : 5131,293 ms - Total 5131,293 ms / 1 intvls (Avg 5131,293 ms)
[00000407] main stream out debug: destroying chain... (name=std)
[00000411] main mux debug: removing module "mux_ts"
[00000409] access_output_file access out debug: file access output closed
[00000409] main access out debug: removing module "access_output_file"
[00000407] main stream out debug: removing module "stream_out_standard"
[00000407] main stream out debug: destroying chain done
[00000362] main playlist debug: starting new item
[00000362] main playlist debug: changing item without a request (current 0/1)
[00000362] main playlist debug: nothing to play
As I said, this is not always the case. Usually the streaming starts.
-
I really would love to know, how to start the streams automatically after booting the Server. Since the stream sometimes doesn’t start on the first hit, I would need some script to check, wether the stream is already running. If not, start it automatically.
-
I need to reduce the initial waiting when connecting to the stream. Takes up to 60 seconds, wich is way to long.
-
Can anybody provide me a link to the full list of params for VLC for gods sake? Still wondering what the -vvv does
If you guys could help a Linux bOOn, that would be much apreciated
regards
- Alex