Restreaming a live stream

Disclaimer: Please excuse me if this post is in the wrong place. I took my best guess at the correct sub-forum.

I have a Raspberry Pi set up with a camera module live streaming with VLC. I have an OS X machine running a Wowza instance connected to the same local network as the Pi. I want to have Wowza ingest the stream from the Pi and then make that stream available to other clients which are also on the same local network. The idea is that eventually the server running Wowza will be externally accessible, while the Pi will not be. The Wowza server may also need to serve several clients concurrently, and the Pi is unlikely to be able to handle this. Ultimately I’d like to put the Pi, the Wowza server and the clients on different networks. So, to review:

Step One

Pi -> (local network) -> Wowza -> (local network) -> Client

Step Two

Pi -> (internet) -> Wowza -> (internet) -> Multiple clients

At the moment I’m only really concerned with step one. I’ll worry about step two later. I’ve gone around in circles for a while now and I’ve read a pile of Wowza help articles and tutorials, as well as various posts on the net, without getting very far. I’d really appreciate some hints (or simple instructions) which assume that I know very little about Wowza (specifying a command for setting up the live stream with VLC would also be handy). I have no specific requirements for a streaming protocol at the moment, but RTSP and/or RTMP would be preferable. The live stream is encoded with h264. Here’s an example of a command I’ve used to stream with VLC:

raspivid -o - -t 0 -hf -vf -w 1280 -h 720 -fps 25 |cvlc -vvv stream:///dev/stdin --sout '#rtp{dst=172.16.214.45,sdp=rtsp://:1935/live, mux=ts, name="Pi Cam"}' :demux=h264

All help will be much appreciated!

Hi,

There are a few example vlc commands give in the VLC encoder guide here.

VLC is really best used with rtp/rtsp for sending in streams to Wowza.

These two guides detail how to setup Wowza Streaming Engine to receive and RTSP stream and How to receive an MPEG-TS stream.

Both articles also explain how to playback resulting streams.

Daren

Hi,

I’m not clear if you got the fisrt command to work or not?

The commands in the vlc examples in the guide are for mpeg-ts delivery.

For that the destination just needs to be the IP address of the Wowza Server, so

rtp{dst=[my_wowza_ip],port=10000,mux=ts}

will send a stream into the Wowza server on port 10000

On the Wowza Streaming Engine side you’ll need to create a stream file with

the following : udp://10.10.10:10000

Then start the stream.

Did that work?

Daren

Hi,

Thanks for updates. Glad you have something working now.

It is best if we troubleshoot this further, as there could be an issue with regards to the test players.

I would be great if you would email support@wowza.com and provide the following information:

  • A ZIP file containing your conf/, logs/ and manager/logs folders from the install-dir.

  • The URL of this thread for reference.

Daren

Hi,

There are a few example vlc commands give in the VLC encoder guide here.

VLC is really best used with rtp/rtsp for sending in streams to Wowza.

These two guides detail how to setup Wowza Streaming Engine to receive and RTSP stream and How to receive an MPEG-TS stream.

Both articles also explain how to playback resulting streams.

Daren

Thanks for your reply! I’ve actually already read (and re-read) all three of the guides you linked to. I wasn’t able to get the system I described in my original post working. I note that the “How to use VLC as a live stream encoder with Wowza” guide describes a situation in which VLC and Wowza are running on the same machine, and has VLC streaming from a static source file, not from a live camera stream. I’m happy to admit that I don’t know what the implications of those differences would be with my situation, but I wondered if they could cause some problems.

And yes, I have been focussing mainly on RTSP.

After following those guides my end result is usually that the incoming stream from VLC will not play back in the Wowza test players (it shows a black screen, while claiming to be playing). The stream is certainly functioning however as I’m able to access and play it with VLC running on another machine on the local network (and with VLC on the same machine that Wowza is running on, too).

I’ll try running through those guides again, but this will make for the fourth or fifth such repetition. I’ll take some screenshots/notes and report back with a more complete description of the problems I encounter.

Thanks again!

In the first guide you linked (“How to use VLC as a live stream encoder with Wowza”) I note that the VLC command (reproduced below) sets the RTP destination to localhost.

vlc -vvv "%WMSAPP_HOME%/content/sample.mp4" --sout "#transcode{venc=x264{keyint=60,profile=baseline,level=3.0,nocabac},vcodec=x264,vb=150,scale=0.5,acodec=mp4a,ab=96,channels=2,samplerate=48000}:rtp{dst=127.0.0.1,port=10000,mux=ts}

As my Wowza instance is running on a different machine (to VLC) on the same network I tried changing this IP to the address of the machine on which Wowza is running. So far so good. However, in the guide “Publish Live Streams using a RTSP/RTP encoder” I am told to enter the following settings into my encoder:

Server URL: rtsp://[wowza-ip-address]:1935/live
Stream Name: myStream
User: publisherName
password: [password]

Note that the server URL includes a /live at the end. I’m not sure of the correct way to format my VLC command for this URL. Where does the /live go? From my first post you’ll see that I took at stab in the dark at it and put it in the ‘sdp=’ section. Should this fragment of the command look more like this?

rtp{dst=[my_wowza_ip]/live,port=10000,mux=ts}

I’ll post back with more specifics as I go.

Thanks!

EDIT: I’m also a little confused about how to add a stream when live streaming. In the guide “How to set up live streaming using an RTSP/RTP-based encoder” it seems that it is not necessary to add a stream via the ‘Applications>Stream Files’ section of the Wowza Streaming Engine Manager (WSEM). But in the guide “How to publish and play a live stream (MPEG-TS based encoder)” this is necessary. No matter which approach I take I’m not able to get the stream to play in one of the Wowza test players.

I should also add that I’ve set up a new live application in the WSEM and disabled all authentication while I’m testing.

Running the command below to stream from the Pi and creating a stream file with the address udp://10.10.10.10:10000 (note that there was a minor typo in your post above, you missed one “.10”) I was able to connect to the stream! The trick was that Wowza was auto populating the test player with the wrong IP address. It seemed to be using an old address for my system, and manually updating it to a current one fixed the issue. I also had to make sure to update the stream name in the test player to match the name of my stream file (Wowza auto populates it with “myStream”).

raspivid -o - -t 0 -hf -vf -w 1920 -h 1080 -fps 30 |cvlc -vvv stream:///dev/stdin --sout '#rtp{dst=172.16.214.45, port=10000, mux=ts}' :demux=h264

This issue is now resolved, but I’ll be sure to come back with any other issues I’m not able to solve on my own. Thanks very much for your help!

Hmm. Actually, it seems there is a problem. The stream seems to be disconnected very soon after viewing it. The player window turns black, and stopping and starting the test players shows errors (reproduced below). Resetting the stream doesn’t help. Waiting for some amount of time (it’s variable) seems to restore the stream for a few seconds, but again, the stream goes down shortly after viewing it. WSEM displays the stream as “Active” at all times while this is occurring. After the stream goes down it states that there is 0 throughput from the stream, but my own network manager shows a Java process (which can only be Wowza) pulling down ~800KBps, so it appears that there is still some sort of connection. The encoder shows no errors or disruption.

Errors shown by test players.

HLS: The video could not be loaded, either because the server or network failed or because the format is not supported.

Adobe HDS: Source stream or file could not be found or access was denied.

Adobe RTMP: Playing (but the video is blacked out)

EDIT: It appears to be a problem with the test players. I’m able to take one of the URIs from the test player popup and open it in a different player with no issues.