Partly solution to RTSP -> VLC -> Wowza and some Questions

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:

  1. 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.

  1. 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.

  2. I need to reduce the initial waiting when connecting to the stream. Takes up to 60 seconds, wich is way to long.

  3. Can anybody provide me a link to the full list of params for VLC for gods sake? Still wondering what the -vvv does :smiley:

If you guys could help a Linux bOOn, that would be much apreciated :smiley:

regards

  • Alex

VLC can be rough to get right and stable. Going with a native H.264 camera seems like a great idea. I know this camera works:

http://www.axis.com/products/cam_p3301/index.htm

Charlie

Hi,

I’m working in a similar scenario (my sources are hw encoders instead of ip cams, but the access is similar, vía RTSP URL).

Why are you using a fifo? I’ve tried this streaming and transcoding directly and works almost fine (I’m under ubuntu server on a quad-core xenon computer). The fifo increases the delay between source and flash visor.

I will try to give you some answers :P:

  1. Are you gettin a static image from camera in this situation? in my case, if the source is freezen, VLC doesn’t work fine and similar error ocurrs.

  2. I can onlye check if VLC has been launched correctly vía PID. I also publish the generated stream vía RTSP from VLC, to manually check later with another instance of VLC with gui if it’s working correctly. I think yo could do some similar, and analise the log from the vlc client to see if the stream is correctly working.

  3. Revise your settings. I’m working wiht a delay around 15-20secons max. You can change the sync method to try in XML stream configuration file of Wowza.

4.vvv is to much verbose :P. Read VLC manuals and forum to find exactly the command and parameters you need in your scenario.

I have only a problem. In some cases, wowza sends a zero size frame to flash visor and nothing is displayed. I check with my VLC client and VLC transcoding process is working ok. I think the issue is related with how wowza read SDP file and connects to VLC… I will post a new thread with more explanations, looking for help.

Regards.

Hi there,

sorry for late response, forgot to subscribe to this thread :slight_smile:

However,

@boothosting: Those informations could be found in the vlc output.

Since I start my VLC instances via script called capture1.sh and stream1.sh using the nohup prefix, all logging will be saved in the nohup-output file.

@kenzo1982: Thanks for your reply. The problem is, I was not able to find a Dokumentation of all params of VLC. If you could give me a link to it, it would be greatly appreciated :smiley:

I’m using fifo because without I haven’t had any success at all. Running on quad-core Xeon as well, 4GB of RAM, only job is transcode/stream. Nothing else. Should be doing the trick but obviously does not :frowning:

Regarding the sync settings in XML: I have played around with that couple of times. Do you have a suggestion for me here? Maybe you could provide me with your settings to compare.

I’m thinking of switching to another Cam (with native h264) due to the instablility of transcoding…

Best regards

  • Alex

Hi netzwerkstudio,

How did you logged the live.sdp file content ? I mean this part:

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

Regards

Read here the VLC parameters :

http://wiki.videolan.org/VLC_command-line_help