I have things working, but I thought I would change this first post in the thread to be more of a How-To instead of making people read my entire thread as that is not fair. I thought it would be a good idea to just start at the top. =)
Before I start.. I got all my information from the following locations:
The VLC Forums:
http://forum.videolan.org/ *Remember, the search function is your friend!*
The VLC Wiki Page:
http://wiki.videolan.org/Main_Page
The VLC Wiki Command line Page:
http://wiki.videolan.org/VLC_command-line_help
Here is some back ground.
I co-run a website that uses Shoutcast for streaming our user uploaded content, and to allow our DJs to do live audio only shows.
We wanted to expand the idea, and allow our live DJs to use Web Cams to stream an audio and video feed to our servers, then restream the audio back out to our shoutcast server, and stream the audio and video to a flash based player. The idea of using a simple webcam and a cheap internet connection to continue to connect with our listener bases sounded really exciting.
When our DJs were not live, we'd like to stream our prerecorded content playing via our shoutcast server back over to our flash based player. The idea behind it was; lots of people don't like shout cast, but everyone can use flash. So why not?
Before I go any further.. You need to know something about Windows, Linux, ShoutCast and VLC. I'm giving you all the information you need in this post. All the commands except for the Windows side of things are all handle with scripts run via cron or perl on my server side.
Here is my setup:
Server side im running Cenos5, VLC.0.9.9a Grishenko
Phase One: Allow my Flash based Video player to connect to my shoutcast server and stream my prerecorded audio only content.
vlc
http://mywebsite.com:8666 --sout-mux-caching 1000 --sout "#transcode{vcodec=FLV1,acodec=mp3,vb=32
,ab=64,width=328,height=200}:std{access=http,dst=mywebsite.com:8081/stream.flv}" --daemon
I use JW player embeded in my webpage to view my stream.. you can find JW player here:
http://www.longtailvideo.com/ <-- just mod the example it comes with to make it work with the above information.Please note, I plan on switching to the VLC webplug in in the very near future. =)
The only issue with this is my video player just displays a black screen, but you atleast hear the audio. I'm working on slaving in a video input, but I can't get it to work right. When I do, i'll up date this post.
Phase Two: Allow my Live DJs to stream Audio and Video using VLC client on the windows based machine. My live DJs mostly use Windows, and they could be located in a club, a house, apartment.. where ever. These steps would work for MAC vlc, but I haven't tested it.
Here are the steps I have them use:
Install VLC 1.0.1 For Windows.
1. Get into VLC
2. Click On Media
3. Click on Streaming
4. Click on Capture Device
5. Select your webcam from the Video Device
6. Select you Line-In Input for your audio device.
7. Click Stream
8. Click Next
9. Click Next
10. In the Large Box that says "Generated Stream output string" Paste the command below into it.
:sout=#transcode{vcodec=h264,vb=160,fps=24,height=250,width=300,acodec=mp3,ab=96,channels=2,samplerate=44100,audio-sync,venc=x264{keyint=15,vbv-maxrate=80k,vbv-bufsize=128k,qcomp=0.8,qpmin=10,qpmax=41}}:std{access=udp,mux=ts,dst=mywebsite.com:8777} --daemon
11. Click stream
12. The VLC window will go small and will become a small box.
13. In the left corner, it should say "Streaming", and over to the right it should be counting up.
At this point, linux server side, I start VLC into listen mode.
This command listens for my Windows Based DJs live incoming stream, and then turns it around so my other VLC services can manipulate it.
cvlc udp://@:8777 --sout-mux-caching 45000 --sout '#standard{access=http,mux=ts,dst=127.0.0.1:9070}' --daemon
This command connects back to port 127.0.0.1:9070 and turns that stream into something a Shout Cast Server will understand:
cvlc
http://127.0.0.1:9070 --no-sout-video --sout '#transcode{acodec=mp3, ab=96, channels=2, samplerate=44100, aenc=ffmpeg}:std{access=shout{mp3=1,bitrate=96, samplerate=44100, channels=2,name='Mywebsite.com',genre='dnb'}, mux=raw, dst=admin:
mypasswordhere@mywebsite.com:8666//}' --daemon "
*Note* Port 8666 is the listening port of my shoutcast server.
You *need* that --no-sout-video.. other wise vlc will send the video part of the stream over to the Shoutcast server. if you do that, the out going stream from shoutcast will be all garbled.
In this command, I connect back to 127.0.0.1:9070 and turn it into something that a Flash Based Video player can understand and stream to my website.
vlc --freetype-font=/usr/share/vlc/skins2/fonts/FreeSans.ttf --sub-filter=marq --marq-size=20 --marq-position=9 --marq-marquee="Live: $showname"
http://localhost:9070 --sout-mux-caching 45000 --sout-ffmpeg-qmin=10 --sout-ffmpeg-rc-buffer-size=20000 --sout-ffmpeg-qmax=30 --sout-ffmpeg-qscale=1 --sout-ffmpeg-luma-elim-threshold=-4 --sout-ffmpeg-chroma-elim-threshold=7 --sout "#transcode{vcodec=FLV1,acodec=mp3,vb=100,ab=64,sfilter=marq}:std{access=http,mux=ffmpeg{mux=flv},dst=everydayjunglist.org:8081/stream.flv}" --daemon
If you noticed the DJ's incoming VB rate is 160, and the mp3 rate is 96k. In the above example, I resample the VB rate down to 100, and the Audio to 64k. I do this to save bandwidth. The output still looks and sounds really good.
My Live DJs wanted a way to do server side recordings, again I use VLC.
In this command, I connect back to 127.0.0.1:9070 and turn it into something that a Flash Based Video player can understand and save the in coming audio and video to file.
vlc --freetype-font=/usr/share/vlc/skins2/fonts/FreeSans.ttf --sub-filter=marq --marq-size=20 --marq-position=9 --marq-marquee="Prerecorded: $showname"
http://localhost:9070 --sout-mux-caching 45000 --sout-ffmpeg-qmin=10 --sout-ffmpeg-rc-buffer-size=20000 --sout-ffmpeg-qmax=30 --sout-ffmpeg-qscale=1 --sout-ffmpeg-luma-elim-threshold=-4 --sout-ffmpeg-chroma-elim-threshold=7 --sout "#transcode{vcodec=FLV1,acodec=mp3,vb=160,ab=96,sfilter=marq}:std{access=file,mux=ffmpeg{mux=flv},dst=./myrecording.flv --daemon
If you noticed in this command, I don't do anything special with the incoming rates, I save them at the incoming VB and audio size.
Here is an example from this morning of the end results. Not bad huh?
http://radio.everydayjunglist.org/recor ... 9.2009.flv <-- do a right click and save as to get it to your desktop.
In this command, I connect back to my shoutcast server and turn it into something that an MP3 based media player can understand.
vlc
http://mywebsite.com:8666 --no-sout-video --sout-mux-caching 1000 --sout "#transcode{acodec=mp3,ab=96,channels=2,samplerate=44100}:std{access=file,mux=raw,dst=./myrecording.mp3 --daemon "
If you'd like to see all of this in action, please see my website.
http://www.everydayjunglist.org
You can see the video stuff in action here:
http://www.everydayjunglist.org/edjtv.v2.html
If there is no video in the video link, then it is an audio only stream. =)
my profile can be found here:
http://www.everydayjunglist.org/kdh
Last Update: 9/9/2009