VLC Stream Settings

Hey.

I just got a Wowza EC2 subscription for live streaming.

I am getting the stream from my dreambox (set top box), and can play it on VLC, so I can also stream it.

There are a few ways to stream out from VLC, but I can’t seem to find (from the Articles) section which one I’m supposed to send to my EC2 instance.

The available options for protocol are File, HTTP, MS-WMSP (MMSH), RTSP, RTP / MPEG Transport Stream, RTP Audio/Video Profile, UDP (Legacy), and IceCast.

The available options for encoding format are MP4 (H.264), TS (H.264), WebM, OGG (Theora), TS (MPEG2).

The format I’m getting from the source is a satellite DVB MPEG2-TS stream, and I’m encoding because the video size/framerate/bitrate are excessive for my application, and my connectino will possible not endure a reduced stream, rather than the original non-transcoded one.

The end user should recieve any (FLV ?) stream that will work on something like JWPlayer for most desktop computers.

If there are readily available tested and proved stream output strings that have been used, I think I could build off of that changing only the source, destination, size, bitrate, etc …

The premilnary stream output I get from VLC is

:sout=#transcode{vcodec=h264,vb=400,fps=25,scale=1,width=640,height=480,acodec=mp4a,ab=64,channels=2,samplerate=44100}:rtp{[COLOR="red"]sdp=rtsp://DESTINATION:5544/[/COLOR]} :no-sout-rtp-sap :no-sout-standard-sap :sout-keep

Thanks in advance.

Update : Would it be better to use something like ffmpeg and ffserver for this ? I’m quite comfortable with VLC.

vlc is fine for sending a stream to Wowza but you are missing a few bits in your command line in the rtp section.

You need as a minimum,

rtp{dst=[wowza-ip],port=[wowza-udp-port],sdp=[sdp-location]}

It will start broadcasting to wowza using rtp over 4 udp ports starting at wowza-udp-port. You need to make sure that you have a range of udp ports open in your security group.

If you want to use sdp=rtsp://ip:port/ etc then vlc will listen for rtsp requests on the local port that you define so you need to make sure that wowza can access that port on your local computer. This usually means that you need to allow access to that port from the internet and also forward it in your router.

If you use sdp=file:/// then you need to manually copy the sdp file to your Wowza server content folder.

Yes, vlc will create the file locally at the location that you give in sdp=file:/// This is a local location. If you copy the file to your ec2 instance, Wowza will look for it in the content folder.

You can use any port range that you want. Wowza defaults to 6970-9999 for rtp streaming out and responses to rtsp announce request but it will not check that these are not already in use. I generally use a range above 10000 with vlc so that it doesn’t interfere with Wowza. You can use a range format in the security groups setting.

Yes, the i=IN ip4 127.0.0.1 should be the only thing you need to change. If you set dst=[ec2-public-ip] in the command line then that should automatically be filled in.

Mpeg/TS is easier to set up as you don’t have the sdp file to worry about. I think it uses a larger packet size than straight RTP so will run out of bandwidth sooner.

Thanks for the fast response.

rtp{dst=[wowza-ip],port=[wowza-udp-port],sdp=[sdp-location]}

Correct me if I’m wrong. VLC will create the SDP which I will then need to transfer to my instance files. sdp-location will point to the address of my sdp file in the instance.

wowza-udp-port will refer to which of 4 ports that I will need to add to my security group ? or should I put it in in range format x-y. If you know the ports, I’d appreciate it if you could just give them to me.

Thanks again.

Hi.

I tried a number of example on a couple of computers and I can’t get VLC to issue an sdp file which I can transfer. Do you have any ideas of why this is the case ? I’ve looked around here and the VLC forums and there doesn’t seem to be a clear reason for why this happens. Only solutions, which all didn’t work for me.

Could I substitute this with any other way to broadcast to EC2 that would work on a flash live stream ?

Cheers.

Update : I mean anything apart from RTP. I made some more tests on my local Wowza before going to EC2, and I managed to get RTP going with the RTP://127.0.0.1:5004 address, but VLC still failed to create an *.sdp file. I tried it on multiple computers and with older versions of VLC to no avail. All the tests I’ve run are on Windows 7, and I have no way to eliminate the file not being written due to permissions, but I will give Ubuntu a quick run and see what I get there.

Got it to work :wink:

Instead of getting VLC to publish an sdp, I set it up to do this instead [.sdp=http://127.0.0.1/stream.sdp]. It’s 8 in the morning, so I will sync it up tomorrow to EC2 and see if it works there.

Thank you rogerlittin, I’ll let you know if I need any more help.

Ok. This is the sdp file contents that I get.

v=0
o=- 15024256833801561762 15024256833801561762 IN IP4 TI3GIB-NOTEBOOK
s=Unnamed
i=N/A
c=IN IP4 127.0.0.1
t=0 0
a=tool:vlc 1.1.4
a=recvonly
a=type:broadcast
a=charset:UTF-8
m=audio 5004 RTP/AVP 96
b=AS:32
b=RR:0
a=rtpmap:96 mpeg4-generic/8000
a=fmtp:96 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=1588; SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;
m=video 5006 RTP/AVP 97
b=AS:96
b=RR:0
a=rtpmap:97 H264/90000
a=fmtp:97 packetization-mode=1;profile-level-id=64000d;sprop-parameter-sets=Z2QADazZQ8R4jwEQAAADABAAAAMBiPFCmWA=,aOvssiw=;

I should change the 127.0.0.1 to my Instance’s public dns name. Can I just make this change in the sdp file that I have and upload it to the content folder ?

TI3GIB-NOTEBOOK is the name of my computer. Is this essential to the working of the sdp ?

If I can just simple make hard edits to the sdp file, what else should I change ?

Cheers.

Brilliant. I got it working.

Instead of going through the hassle of setting port mapping and all that I tried one Windows machine and it issue and sdp file nicely.

Now it’s just a matter of tweaking. I was wondering if anyone can tell me which is the better protocol in VLC.

RTP (Audio/Video Profile) or

RTP / MPEG transport stream

Thanks, Roger :slight_smile: