Welcome to the CasterClub Forums.
Header

CasterClub Forums » Tutorials » Webcasting HOW-TO's » Streaming Video with NSV SHOUTcast

Webcasting HOW-TO's Learn how broadcast from a pc, tips n tricks on how to maximize your existing station. Some tutorials will cover everything from sam broadcaster to the windows media encoder.

Reply
Thread Tools vBmenu Seperating Image Display Modes vBmenu Seperating Image
Streaming Video with NSV SHOUTcast
Old 07-31-2006, 02:05 AM   #1
davestj
 
davestj's Avatar
 
Status: shutdown -h now
Join Date: Jan 2003
Location: PLANET EARTH
Posts: 3,466
davestj has disabled reputation
Streaming Video with NSV SHOUTcast

[FONT=verdana, arial, helvetica][SIZE=2][SIZE=5][B][U] Streaming Video with NSV SHOUTcast[/U][/B][/SIZE]
by Sawg
[I]Last Edited: 08-01-2003[/I]

WARNING: [B]The NSV Format and associated NSV Tools is [U]beta software[/U][/B]. Therefore streaming video is not currently recommended for the novice computer user or novice SHOUTcast DJ. This tutorial assumes knowledge of how to use command line tools in the Windows environment. The tutorials also assume basic knowledge of setting up the SHOUTcast DNAS. Refer to the streaming audio tutorials for information on the SHOUTcast DNAS, these tutorials use the default configuration, though. Both the command line tools and GUI tools are explained (excluding FLASK currently). [B]NSV SHOUTcast is not currently meant for general end-user use[/B], so if you are not willing to put some effort into this stop reading now. If you want to stream video and are willing for a challenge then keep reading.


Required Software:
- [URL="http://www.nullsoft.com/nsv/"]NSVTools - April 19, 2003[/URL]
- [URL="http://www.shoutcast.com/download/serve.phtml"] SHOUTcast DNAS 1.9.2[/URL]



[SIZE=4][B]Encoding NSV Video Files (NSVenc CLI)[/B][/SIZE]
This is for encoding .nsv video files. Pre-encoded files then can be served on a web-server or streamed using [I]nsvscsrc[/I] (detailed later).


[SIZE=3]1. Setup[/SIZE]
Open the command prompt an change the directory to the NSVtool folder (Default: [I]C:\\Program Files\\NSVenc[/I]).

First the encoder must be configured. At the command prompt type "nsvenc /config" (no quotes). This brings up the "NSVenc configuration." These options are the more advanced control options, which aren't covered, but feel free to play around with them. To set up the encoders click the "[I]NSV Encoder Options[/I]" button to bring up the "[I]NSV Encoder Options[/I]" box. Select the audio and video you want. If audio is included use "MP3 (Lame) encoder" and pick the desired encoding options (not discussed). For video choose "VP3 3.1 (proper)." Select a bit-rate to aim for (it won't be constant and may not even be near it). Hit "OK" then "OK" again to exit.

NOTE: The VP3 video format is variable-bitrate in nature, so the bit-rate won't be constant. Plus if you have a frame rate and resolution that is high and a bitrate that is lower then the actual bitrate may be much, much larger then the entered bitrate. If you need to lower the frame rate or the resolution try the option in the previous configuration window. (These settings will increase CPU usage).


[SIZE=3]2. Encoding.[/SIZE]
Any DirectShow decodable file (AVI, MPEG, etc..) can be encoded into into NSV assuming the system has the proper DirectShow filters (if it can play in WiMP, you should be able to encode it). Also, QuickTime is supported if you have QuickTime installed.

Encoding is then straightforward:
[I]nsvenc input.ext output.nsv[/I]

If you have any encoding problems you can force some video properties using the "[I]source settings[/I]" and "[I]directshow settings[/I]" switches from the command line. Just type [I]nsvenc[/I] with no parameters for a full switch listing.



[SIZE=4][B]Encoding NSV Video Files (NSV Batch Encoder GUI)[/B][/SIZE]
WARNING: The NSV Batch Encoder seems to be a little buggy and likes to crash sometimes. If you have problems with it use the command line encoder.

Start the NSV Batch Encoder (hereby referred to as NSVate) from the Start Menu.


[SIZE=3]1. Creating Profiles[/SIZE]
First a profile to encode the video to needs to be set-up. Open the Profile Manager [I]Tools[/I] > [I]Profile Manager[/I] (Ctrl-M). Select the "(default)" profile or to make a new profile click the "[I]Add New[/I]" button. Once a profile is selected hit the edit button to set the encoder settings. This brings up the "NSVate Profile Configuration." These options are the more advanced control options, which aren't covered, but feel free to play around with them. To set up the encoders click the "[I]NSV Encoder Options[/I]" button to bring up the "[I]NSV Encoder Options[/I]" box. Select the audio and video you want. If audio is included use "MP3 (Lame) encoder" and pick the desired encoding options (not discussed). For video choose "VP3 3.1 (proper)." Select a bit-rate to aim for (it won't be constant and may not even be near it). Hit "OK" then "Exit" from the Profile Manager to exit.

NOTE: The VP3 video format is variable-bitrate in nature, so the bit-rate won't be constant. Plus if you have a frame rate and resolution that is high and a bitrate that is lower then the actual bitrate may be much, much larger then the entered bitrate. If you need to lower the frame rate or the resolution try the option in the previous configuration window. (These settings will increase CPU usage).


[SIZE=3]2. Encoding[/SIZE]
First select the files to encode. Go to [I]File[/I] > [I]Add source file(s)[/I] (Shortcut: Ctrl-O) and select the files to add. Also select a profile. Repeat if necessary.

Once all the files are added to the batch choose [I]Selection[/I] > [I]Encode selected[/I] to encode the files to .nsv format.



[SIZE=4][B]Streaming Pre-encoded Videos (nsvscsrc CLI)[/B][/SIZE]

[SIZE=3]1. headers.txt[/SIZE]
For streaming to the SHOUTcast servers the headers to use needs to be manually specified within a text file. Create a new text file and save it into the NSVenc folder. Any name should work, like headers.txt. The standard file includes:

[/SIZE][/FONT][INDENT] [FONT=verdana, arial, helvetica][SIZE=1]code:[/SIZE][/FONT] [SIZE=2]changeme content-type:video/nsv icy-metadata:0 icy-name:My NSV Stream icy-genre:Video icy-pub:0 icy-br:128 icy-url:[URL="http://www.shoutcast.com/"]http://www.shoutcast.com[/URL] icy-irc:#chan icy-icq:1234567 icy-aim:SomeUser icy-reset:1 [/SIZE] [/INDENT][FONT=verdana, arial, helvetica][SIZE=2]

The first line ([I]changeme[/I]) is the password to connect to the server. If it was changed in the server configuration make sure headers.txt reflects that change. Leave lines two and three alone. The forth line down is all information about the stream. The same that would be entered in the SHOUTcast DSP. The "[I]icy-pub[/I]" header signifies if it is a public stream, listed on [URL="http://www.shoutcast.com/"]SHOUTcast.com[/URL] (1 for public, 0 for not public). The next header "[I]icy-br[/I]" signifies the stream's bit-rate, guess. [I]icy-url[/I], [I]icy-irc[/I], [I]icy-aim[/I] and [I] icy-aim[/I] are the basic steam VJ's information. [I]icy-metadata[/I] tells the sever to keep getting title information. Do not change [I]icy-reset[/I].

Save the file.


[SIZE=3]2. The Set-Up[/SIZE]
Videos to stream need to be pre-encoded using [I]nsvenc[/I] (NSV Command Line Encoder) or [I]nsvate[/I] (NSV Batch Encoder) as described above. All videos must be encoded using the same encoder setup for the program to work correctly. Once done make sure the videos are in the same folder (preferably one with an easy to type path).


[SIZE=3]3. Using [I]nsvscsrc[/I][/SIZE]
Open the command prompt an change the directory to the NSVtool folder (Default: [I]C:\\Program Files\\NSVenc[/I]).

The basic parameters for nsvscsrc are:
[I]nsvscsrc host:port:headers.txt directory [interm.nsv][/I]

- [I]host[/I] is the host (IP / DNS) that the SHOUTcast server is running on.
- [I]port[/I] is the port to send the data to. Note this is PortBase+1. The PortBase set in the SHOUTcast server configuration (8000 by default, so 8001 to send to. Using the SHOUTcast DSP it would add the one for you).
- [I]headers.txt[/I] specifies what text file headers are in. This should be the earlier created document in the same folder.
- [I]directory[/I] is the directory that the files are stored in. Single files are not accepted.
- [I]interm.nsv[/I] is I don't know.

An example setup is:
[I]nsvscsrc 127.0.0.1:8001:headers.txt test[/I]
Where the DNAS is on the local machine with the default [I]PortBase[/I] and the files are in the /test/ sub-directory of the NSVenc folder.

and

[I]nsvscsrc localhost:8001:headers.txt C:\\NSVFun[/I]
Where the DNAS is on the local machine with the default [I]PortBase[/I] and the files are in [I]C:\\NSVFun[/I].


NOTE: [I]nsvscsrc[/I] currently is random and there is no way to switch it off. A work around to get the files to play sequentially is to zip the .nsv files with [B]no compression[/B] and rename the .zip file to .nsv. Make sure that is the only file in the folder then.



[SIZE=4][B]Streaming Live Video (nsvenc CLI)[/B][/SIZE]
Requires a hardware capture device to be attached to the computer.

[SIZE=3]Setup[/SIZE]
Open the command prompt an change the directory to the NSVtool folder (Default: [I]C:\\Program Files\\NSVenc[/I]).

First the encoder must be configured. At the command prompt type "nsvenc /config" (no quotes). This brings up the "NSVenc configuration." These options are the more advanced control options, which aren't covered, but feel free to playa round with them. To set up the encoders click the "[I]NSV Encoder Options[/I]" button to bring up the "[I]NSV Encoder Options[/I]" box. Select the audio and video you want. If audio is included use "MP3 (Lame) encoder" and pick the desired encoding options (not discussed). For video choose "VP3 3.1 (proper)." Select a bit-rate to aim for (it won't be constant and may not even be near it). Hit "OK" then "OK" again to exit.

NOTE: The VP3 video format is variable-bitrate in nature, so the bit-rate won't be constant. Plus if you have a frame rate and resolution that is high and a bitrate that is low then the actual bitrate may be much, much larger then the entered bitrate. If you need to lower the frame rate or the resolution try the option in the previous configuration window. (These settings will increase CPU usage).

Plug-in the video capture device you wish to use. (Web cam, video cam, video capture card, etc...). Audio, if used, can be set up using Windows Recording Control.

Start up the server; make sure it is waiting for a connection.


[SIZE=3]2. headers.txt[/SIZE]
For streaming to the SHOUTcast servers the headers to use needs to be manually specified within a text file. Create a new text file and save it into the NSVenc folder. Any name should work, like headers.txt. The standard file includes:

[/SIZE][/FONT][INDENT] [FONT=verdana, arial, helvetica][SIZE=1]code:[/SIZE][/FONT] [SIZE=2]changeme content-type:video/nsv icy-metadata:0 icy-name:My NSV Stream icy-genre:Video icy-pub:0 icy-br:128 icy-url:[URL="http://www.shoutcast.com/"]http://www.shoutcast.com[/URL] icy-irc:#chan icy-icq:1234567 icy-aim:SomeUser icy-reset:1 [/SIZE] [/INDENT][FONT=verdana, arial, helvetica][SIZE=2]

The first line ([I]changeme[/I]) is the password to connect to the server. If it was changed in the server configuration make sure headers.txt reflects that change. Leave lines two and three alone. The forth line down is all information about the stream, the same that would be entered in the SHOUTcast DSP. The "[I]icy-pub[/I]" header signifies if it is a public stream, listed on [URL="http://www.shoutcast.com/"]SHOUTcast.com[/URL] (1 for public, 0 for not public). The next header "[I]icy-br[/I]" signifies the stream's bit-rate, guess. [I]icy-url[/I], [I]icy-irc[/I], [I]icy-aim[/I] and [I] icy-aim[/I] are the basic steam VJ's information. [I]icy-metadata[/I] tells the sever to keep getting title information. Do not change [I]icy-reset[/I].

Save the file.


[SIZE=3]3. Encoder Startup[/SIZE]
Once everything is configured and plugged in it is time to start the encoder. Use the following line (or a variation based on your needs.):
[I]nsvenc /cfgcap cap:0,N sc:127.0.0.1:8001:headers.txt[/I]

- [I]/cfgcap[/I] brings up the capture configuration
- [I]cap:0,N[/I] says to capture from the first video capture source and capture no audio. Use cap:0,0 for first device video and audio. Use cap: to list all available capture devices, and use the number of the device in subsequent runs to automate. Use audio device 'I' for MiniDV source audio (interleaved)
- [I]sc:[/I] says to send the data to a SHOUTcast server
- [I]127.0.0.1[/I] is the IP address of the server. The IP of 127.0.0.1 is for the server being on the same system as NSVenc.
- [I]8001[/I] is the port to send the data to. Note this is PortBase+1. The PortBase set in the SHOUTcast server configuration (8000 by default, so 8001 to send to. Using the SHOUTcast DSP it would add the one for you).
- [I]headers.txt[/I] specifies what text file headers are in. This should be the earlier created document in the same folder.

Up next should be the "[I]Capture Configuration[/I]" box (also know as "[I]Poopie Properties[/I]"). Select a capture frame rate and resolution. Start kind of low. The encoding takes a lot of CPU power.


[SIZE=3]4. Connection[/SIZE]
The encoder should start encoding the video and sending it to the server. If it connects the encoding output will look something like what follows:

[/SIZE][/FONT][INDENT] [FONT=verdana, arial, helvetica][SIZE=1]code:[/SIZE][/FONT] [SIZE=2]from: cap:0,N video=320x240@20.00000000fps to : sc:127.0.0.1:8001:headers.txt video=VP31 (hit ESC to abort) 0:59:10 @ 19.8fps 95kbps (d=0,vinq=0,ainq=0) [/SIZE] [/INDENT][FONT=verdana, arial, helvetica][SIZE=2]

Also the SHOUTcast server should show a connection. The normal connection information should appear in the log. An example is an output like:

[/SIZE][/FONT][INDENT] [FONT=verdana, arial, helvetica][SIZE=1]code:[/SIZE][/FONT] [SIZE=2]<12/13/02@16:40:29> [source] connected from 127.0.0.1 <12/13/02@16:40:30> [source] icy-name:My NSV Stream ; icy-genre:Video <12/13/02@16:40:30> [source] icy-pub:0 ; icy-br:128 ; icy-url: [URL="http://www.com/"]http://www.com[/URL] <12/13/02@16:40:30> [source] icy-irc:#chan ; icy-icq:123456 ; icy-aim:SomeUser [/SIZE] [/INDENT][FONT=verdana, arial, helvetica][SIZE=2]

If there are any errors, re-read the above steps and try again. If there are no errors the stream can now be viewed.



[SIZE=3][B]Streaming Live Video (nsvcap GUI)[/B][/SIZE]
There is an easier GUI method for streaming live video also, and is recommended. Start NSVcap from the Start Menu.

[SIZE=3]1. Setup[/SIZE]
First the server needs to be set up to connect to the SHOUTcast server. First Select [I]File[/I] > [I]Set Capture Device[/I]. Under the [I]Output[/I] drop-down select [I]Shoutcast host[/I]. The [I]Shoutcast server[/I] filed has the address of the SHOUTcast DNAS. [I]Port[/I] is the port for the server. Notice it is equal to the [I]PortBase[/I] setup in the DNAS, not PortBase+1 like the Command Line tools. [I]Password[/I] is the password for the server.

The [I]headers[/I] box is just like heders.txt for the command line tools. Enter information like what follows:

[/SIZE][/FONT][INDENT] [FONT=verdana, arial, helvetica][SIZE=1]code:[/SIZE][/FONT] [SIZE=2]changeme content-type:video/nsv icy-metadata:0 icy-name:My NSV Stream icy-genre:Video icy-pub:0 icy-br:128 icy-url:[URL="http://www.shoutcast.com/"]http://www.shoutcast.com[/URL] icy-irc:#chan icy-icq:1234567 icy-aim:SomeUser icy-reset:1 [/SIZE] [/INDENT][FONT=verdana, arial, helvetica][SIZE=2]

The first line ([I]changeme[/I]) is the password to connect to the server. If it was changed in the server configuration make sure headers.txt reflects that change. Leave lines two and three alone. The forth line down is all information about the stream, the same that would be entered in the SHOUTcast DSP. The "[I]icy-pub[/I]" header signifies if it is a public stream, listed on [URL="http://www.shoutcast.com/"]SHOUTcast.com[/URL] (1 for public, 0 for not public). The next header "[I]icy-br[/I]" signifies the stream's bit-rate, guess. [I]icy-url[/I], [I]icy-irc[/I], [I]icy-aim[/I] and [I] icy-aim[/I] are the basic steam VJ's information. [I]icy-metadata[/I] tells the sever to keep getting title information. Do not change [I]icy-reset[/I].

Click "OK" to save the information.


[SIZE=3]2. Capture Devices[/SIZE]
Next from the [I]Devices[/I] menu select a video and audio input device.


[SIZE=3]3. Encoder Configuration[/SIZE]
Next, select he [I]NSV[/I] menu and the [I]Config...[/I] option to configure the encoder. This brings up the "NSVenc configuration." These options are the more advanced control options which aren't covered, but feel free to playa round with them. To set up the encoders click the "[I]NSV Encoder Options[/I]" button to bring up the "[I]NSV Encoder Options[/I]" box. Select the audio and video you want. If audio is included use "MP3 (Lame) encoder" and pick the desired encoding options (not discussed). For video choose "VP3 3.1 (proper)." Select a bit-rate to aim for (it won't be constant and may not even be near it). Hit "OK" then "OK" again to exit.

NOTE: The VP3 video format is variable-bitrate in nature, so the bit-rate won't be constant. Plus if you have a frame rate and resolution that is high and a bitrate that is low then the actual bitrate may be much, much larger then the entered bitrate. If you need to lower the frame rate or the resolution try the option in the previous configuration window. (These settings will increase CPU usage).


[SIZE=3]4. Capturing[/SIZE]
Once all the settings are good from the [I]Capture[/I] menu select [I]Start Capture[/I]. Now it should start capturing. Also the SHOUTcast server should show a connection. The normal connection information should appear in the log. An example is an output like:

[/SIZE][/FONT][INDENT] [FONT=verdana, arial, helvetica][SIZE=1]code:[/SIZE][/FONT] [SIZE=2]<12/13/02@16:40:29> [source] connected from 127.0.0.1 <12/13/02@16:40:30> [source] icy-name:My NSV Stream ; icy-genre:Video <12/13/02@16:40:30> [source] icy-pub:0 ; icy-br:128 ; icy-url: [URL="http://www.com/"]http://www.com[/URL] <12/13/02@16:40:30> [source] icy-irc:#chan ; icy-icq:123456 ; icy-aim:SomeUser [/SIZE] [/INDENT][FONT=verdana, arial, helvetica][SIZE=2]

If there are any errors, re-read the above steps and try again. If there are no errors the stream can now be viewed.



[SIZE=4][B]Playback[/B][/SIZE]
Now that you have the streaming part done you can now playback you can view your own stream.

Streaming NSV files can be played in Winamp3 Winamp 2.90+, nsvplay (included with NSV Tools, not discussed), NSVPlayX (ActiveX for Internet Explorer, not discussed) and NSVPlayMoz (Mozilla/Netscape plug-in, not discussed).

The URL for the stream is different then the standard MP3 stream URL. Without any modification Winamp will not be able to determine that it is a NSV file it is receiving and not a MP3 stream. The stream URL for a NSV stream is as follows:
[URL="http://your_ip:8000/;file.nsv"] http://your_ip:8000/;file.nsv[/URL]

Where "[I]your_ip[/I]" is the IP of the system running the SHOUTcast server. The port is 8000 by default (not 8001) or something else if you changed it in the SHOUTcast configuration (PortBase). There is no typo, use "[I];file.nsv[/I]" and not "[I]listen.pls[/I]" after the address and port.

Open that URL in Winamp (Ctrl-L). If everything is working it will connect, buffer, and then the video window will pop up and play.

If you have your stream set to public and it is working eventually it will show up under "Internet TV" in Winamp 2.9X.[/SIZE][/FONT]
davestj is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Off
Smilies are Off
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -6. The time now is 12:37 PM.