NSV, SHOUTcast and You

.OGV

After finding out that NSVtools don't work correctly under x64, I upgraded to Icecast which supports additional formats. It still accepts legacy .nsv encoding, but I strongly recommend .ogv instead.

Check out the information below regarding codecs, ripping, encoding and subtitles, but if you have the .avi ready to go, you need two simple commands:

You'll need to enter the stream URL and password under the provided .xml, but otherwise that's it! Way easier than encoding to .nsv, and there are many other applications that also encode to Theora.

.NSV

So you want to encode and stream a video file on SHOUTcast? The process is fairly simple, but the execution can be difficult. Everything from drifting sound/audio desynchronization to simple failure to encode properly will plague you if you happen to be unlucky. Some movie files will encode and play the first time through, others will fail miserably and you'll have to become an hero.

If you are lazy, technically illiterate or otherwise impatient, feel free to give up now. If you have something you really want to share and aren't afraid of a command line or installing codecs, read on.

Before we begin, the best resource for this is the Winamp Forum on the topic. Go here for the basic information. Most of the questions and problems are already answered here, particularly in the Introduction to NSV sticky.

Step Zero: Update Codecs

Before you begin doing anything, you need to make sure you've got the most up-to-date codecs you can find, and any additional codecs you may not even have. The codecs required depend entirely on the video formats you're encoding to and from, but just get Combined Community Codec pack. After fucking with WinXP Codec pack so many times I've just given up, CCCP includes everything in the XP pack plus a lot more, so just use that to begin with. You should also hit up DivX and Xvid for their latest codecs.

Step Zero Point Five: Update Codecs

Do you know what FFDShow is? Have you already installed the CCCP because you're an audiovideo expert? Do you know the difference between a device driver and a codec? Do you even know what a codec is?

Chances are, no, you don't. Seriously, go back and do the last step. Even if you think your codecs are up-to-date, or you're so technically literate you get to skip the first two steps on every list of instructions you find on the Internet, go back and do the above step. I will murder you with my teeth if you come begging for help and I find out you didn't do Step 0.

Step One: Rip

With that out of the way, the first step is to turn your video file into something we can transcode into NSV. (I'll get to what this means later.) If your movie is already in .avi, .divx, .xvid or .mpg format, you can go directly down to the next step. Otherwise, you need to get your video into one of these formats.

There are a couple ways to do this, and your method may very well vary from source to source. For example, if you're trying to rip a DVD (assuming you're doing so legally and the DVD has no copy protection and it's Easter Sunday at midnight, because this guide is in no means intending for you to commit copyright infringement!), you could use Xilisoft DVD Ripper or DVDx to rip the chapter directly to AVI (neither always worked right), or you could try a combination of DVD Decrypter and Vidomi. I like the latter option because Vidomi allows you to crop widescreen films to reduce filesize.

Personally I recommend Xilisoft. Check the IRC for more info on this option. On the off-chance that this and DVDx don't work for your particular disc, I'll explain DVD Decrypter and Vidomi. No, wait, I've got a better idea, I'll just show you the YouTube video that taught me!:

The tl;dr is that you rip the DVD to IFO format with DVD Decrypter, run Vidomi, switch to Encoder mode (little cycle arrows), and convert all the necessary VOB files for the necessary movie tracks into a single AVI/XVID/DIVX file. The YouTube video is a lifesaver. (If the video tells you to pick 'double pass' or something on the Xvid encoding and it keeps crashing, choose 'normal' or 'none' or 'standard' or whatever; the multi-pass stuff isn't strictly necessary and I think the FFDShow stuff makes it die.)

No matter how you do it, get your video into one of those DirectShow formats (AVI, DivX, Xvid, MPEG-2, etc.). Once this is done, check your video! Scan through it to make sure the encoding was done correctly. Very common errors include audio/video "drifting"/desynchronization, some of which is hard to detect unless you skip through various parts of the movie. (Speaking of which, if you try to fast forward and it keeps shutting the movie off, it ripped badly and you should try again.) Use multiple viewers to check your work, including WMP, Winamp and VLC (especially get VLC - more on this later).

Step One Point Five: Hardcode Subtitles

If your video includes multiple audio streams and subtitle tracks, you need to hardcode (or "flatten") a single audio and subtitle track directly into the video in order to proceed. This handy guide will show you how to do it and which programs you'll need. (Very quick overview: You need to convert the .srt subtitle file to .ssa, then use the subtitler filter in VirtualDub to hardcode the desired audio/subtitle into the video.)

Another common format, particularly for anime, is MKV. To encode MKV to AVI with subtitles, use the appropriately-named MKV to AVI with Subtitles application (see IRC for more info). This guide will show you what to install (including the Haali Media Splitter from the CCCP) and the settings and steps to doing it. (Please note that I have had a great deal of trouble getting this to work; you may be able to use VirtualDub in this instance, though I've never tried it.)

Step Two: Encode with NSVTools

Download this. These are encoding tools; you won't really need anything from this suite except nsvenc. nsvenc is an encoder, or more specifically a transcoder; it will convert any DirectShow format (AVI, DivX, Xvid, MPEG-2, etc.) into NSV (Nullsoft Streaming Video). There's a batch encoder too, but it kept crashing on me so just use the command line utility.

To use the encoder, open a prompt (Run - cmd), navigate to the folder (e.g. C:\Program Files\NSVTools) and enter:

nsvenc /config

This will bring up a configuration window. Generally, leave the first screen alone except for increasing the volume to 5.0 or so (just to make sure the movie doesn't encode too quietly). Click NSV Encoder Configuration to bring up a more detailed window. What you're looking for here is to select MP3 Lame encoding for audio and set a decent bitrate (usually 128), and VP3 for video (with a bitrate of 300). The defaults are usually something along these lines but you should check them to make sure.

When you've set the configuration and you're ready to give it a try, the command is simply:

nsvenc c:\your\file.avi c:\your\newfile.nsv

Simple, right? On my own rather powerful machine, it takes a good half hour to forty minutes to encode a 1 1/2-hour film. You may want to go make yourself something to eat, walk to the dog, shave the cat, and learn a second language while you wait. (Woe unto you if the encoding fucks up...) When it's done, you should have a NSV file that's about a third to a half of the original file size, a bit more if you selected higher quality encoding (a good idea for dark movies or fast/blurry films). Open this file with VLC player, which is the only one I know of that actually plays these things.

If the movie looks good in VLC, congratulations, you're almost done! If there's a problem, any problem - audio desync, looks blurry, too many artifacts, too quiet, improper rip in general - those problems will be displayed exactly as you see them to your viewers. This is your chance to fix it before you get angry viewers whining about the quality.

If you do run into a problem, there are lots of things to try changing. Check the original file and make sure it's okay, try changing the bitrates on the audio or video, set a lower quality, try different ripping utilities, etc. etc. etc. There are a lot of variables I can't possibly cover here and it varies from source to source, so good luck if it doesn't work the first time.

Step Three: Stream with NSVSCSRC

The final step, of course, is to stream your movie. First, create a text file called headers.txt and put the following in it:

(SERVER PASSWORD GOES HERE ON THE FIRST LINE)
content-type:video/nsv
icy-metadata:0
icy-name:(Name of your stream)
icy-genre:(Genre of your stream, like horror or whatever)
icy-pub:0
icy-br:128
icy-url:(URL if you want it)
icy-irc:#chan
icy-icq:1234567
icy-aim:SomeUser
icy-reset:1

Download this. This is the latest version of nsvscsrc, or Nullsoft Streaming Video SHOUTcast Source. This is the streaming utility, run via the command line, that plays your file for the internet on a SHOUTcast server. Use this instead of the one pre-packaged with NSVTools, since this is newer.

One last step is to move your .nsv file into a folder without any spaces in it, just to make sure it doesn't cause trouble. I recommend a simple c:\movies\moviefolder as the destination folder. Finally, the command to run the application is:

nsvscsrc /SC xen.thisisnotatrueending.com:8000:PASSWORD:headers.txt c:\movies\moviefolder

Note! Enter the folder where the movie is located, not the file directly, or it will crash and you'll be stuck scratching your head (like I was). Also, yes, you need to put the password on the command line even though it's in headers.txt. I don't know why.

Anyway, this will try to connect to the server and start streaming. If it just goes [Re]Connecting to blah over and over again, it's either 1) the wrong folder, 2) the video doesn't work, or 3) someone else is on the SHOUTcast.

Aaand that's it! It'll start streaming when it's connected. Now, I'm sure there must be a more economical way to do this, but for now the best way to see what your movie is doing (and watch it yourself) is to connect to the SHOUTcast with Winamp or something and watch it alongside your other viewers. If anyone knows a way to watch it locally without burning bandwidth both up and down please let me know.

Enjoy ur streaman!

 

Site code and contents 2007-2008 thisisnotatrueending.com. All rights reserved. Click here for legal information.
If you are under the age of 18, you must leave this site immediately.