Go Back   Winamp Forums > SHOUTcast > SHOUTcast TV / Nullsoft Video

 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 3rd April 2003, 20:29   #2
peppert
UID 0
 
peppert's Avatar
 
Join Date: May 2000
Location: a tent outside forums.winamp.com
Posts: 230
NSVenc Stuff
Updated: 04-03-2003


Additional Notes
I'll add a few things which are valid as of April 3:

/ignoredrops on the command line may or may not make your life happier with regard to sync.

Winamp2 now plays NSV SHOUTcast feeds directly. Simply point the player at a server providing a feed and use ctrl-L and http://server.ip:port/;stream=stream.nsv to start watching.

If you wish to include MP3 audio in your stream, make sure to configure the sample rate conversion on the first page appropriately.

For example, if you are broadcasting a 128kbps stereo MP3 feed, then leave the conversion at 44100 khz stereo. If you'll be using a 24kbps 22khz mono MP3 feed, you should set the sample rate conversion to be 22050 mono. 11khz would be 11025 and so on.

We do still recommend you continue to use either 44khz, 22khz, or 11khz as the sample rate for broadcasting to ensure maximum compatibility with soundcards.

You'll want to use CBR and normal quality for the encoding, solely.


NSVenc Command Line Switches and Options
Here's a rundown of what all the settings actually do, and some guidelines for setting up a stream of your own.

First I'll go over a list of what every setting actually means and does, then establish some guidelines for how to configure the settings.

List of settings and their functions:


NSVEnc Config Window:
Deinterlace Video: This should be checked if the source you are capturing from sends an interlaced signal. Most capture boards provide a progressive signal, but a few send alternating frames. Check your capture documentation to see if you need this setting activated. Chances are whether you're streaming from a capture board or off an AVI file; you will not need this enabled.

High quality deinterlace: Improved deinterlace quality at the expense of more consumption of CPU. Unsuitable for live streaming.

Cropping: If your source is letterboxed or has garbled edges, you may remove a specific number of pixels from the output stream by entering the number of pixels to remove from each edge here. Keep in mind, however, that the VP3 codec requires a resolution that is a multiple of 8 pixels, so if you crop any pixels, you'll need to crop at total of 8, 16, 24, etc. This has a small impact on CPU.

Resizing: This option requires significant CPU and should be avoided for live streaming. Resizing takes a large resolution source and reduces it to a resolution more suitable for streaming. You should only use this option as a last effort, as it's far better to preprocess an AVI or tell your capture card to do the reduction for you when you can.

High quality resize: Improved resizing quality at the expense of CPU. Unsuitable for broadcasting.

Audio Processing: Resampling is required when your audio codec will be streaming at a reduced sample-rate or in mono. If you use 128kbps MP3, use 44100 and Stereo. for 64kbps mono, you'd use 44100 and mono. for 24kbps MP3, you'd use 22050 sample-rate and Mono. 8kbps mono mp3, 11025 and mono. You get the idea.

Lowpass filter when downsampling: This reduces the tendency of transient frequencies to sound wacky when downsampling to lower frequencies. Try it on your stream if you're using a low sample-rate to see what its effects are.

Output frame-rate: If you need to reduce the number of frames per second in the output stream, provide the actual frames you want to stream at here. For example, if you have a 1.2Ghz CPU you might want to only stream at 15 fps instead of 30. You can also increase the frame-rate if you really want to, though the only instance where this remotely makes sense is converting 29.0097 fps to 30.

NSV Encoder Configuration:
This screen provides access to the NSV header, audio and video codec controls. I'll only provide information on configuring the MP3 audio and VP3 video codecs:

NSV Format options:
All of these options, except sync interval, mean nothing for live streams. They're only useful on file-based NSV streams.

Audio send-ahead: This defines a differential in sync between the audio stream and video stream. It should almost always remain at 0.

Min/Max Sync Frame Interval: The number of frames which may occur between a forced resync in the stream. 10 / 50 is a good value for streaming, far better than the 0/150 that is specified as default.

File header: If checked, includes the optional NSV header which includes metadata.

TOC size: the size of the NSV header's Table of Contents. 1024 is the default.

Metadata: Information about the creator, title, copyright and other data. Check NSV's documentation for current fields which can be used here.

AUDIO:
Audio format is the codec to use to send audio. You almost certainly want to use MP3 Lame here.

Encoder options:

Mode: ALWAYS leave this at CBR. Choose Mono or Stereo, and make sure the previous config page is sampling to match.

Bitrate: Bitrate is the bitrate of the audio track. Make sure you set an appropriate sample-rate to match on the previous config page (mono 48kbps+ and stereo 96kbps+ = 44100, mono 24-32kbps and stereo 48-96kbps 22050, lower 11025)

Quality: Always leave this on Low for a live stream.

VIDEO:
Video format: You will almost certainly want VP3.

Bitrate: The target bitrate you want to video stream to go at. Keep in mind this is independent from Audio bitrate. A good standard bitrate for 320x240 30fps is about 256-384kbps. at 160x120 15fps you can go as low at 96kbps.

Keyframe bitrate: The target bitrate of each keyframe. Keyframes are the master frames the video changes are drawn from, usually occurring at a scene change or when significant differences are on screen. They typically occur about once a second. This value will be the bitrate dedicated to these specific frames, and should be set to between 1/3rd and 1/2 the video bitrate. i.e. 256kbps video bitrate would indicate a 96kbps keyframe bitrate.

Allow dropped frames: MUST be checked if you expect the stream to be anywhere near the bitrates you've defined.

Quality: 57 is a good default to use on a fast Athlon XP or P4. otherwise, you'll need to go lower. Note that for some crazy reason, On2 decided to make a higher number mean lower quality. 63 is lowest, 50 is highest. A higher quality also tends to increase bitrate. The higher a quality setting here, the more CPU will be required to stream as well.

Quick compress: should always be checked on for live streaming

Auto keyframe: should always be checked on for live streaming

Threshold: The percentage difference to force a keyframe. set to 90

Minimum distance: The minimum interframes to allow between keyframes. Set to 8.

Maximum distance: The maximum frames to allow before forcing a keyframe. Set to 120.

Noise sensitivity: The keyframe selector will tolerate more noise when this value is raised. 1 is a good default for standard captured video.

Sharpness: The amount of unsharp mask applied to each frame. 1 is a good value.



Video Guidelines
Most everyone will use the VP3 codec. Establishing an ideal bitrate depends on a number of factors, including resolution of source material, available processing power, available upstream bandwidth, and type of material being streamed.


Video resolution:
Larger resolutions will require much more bandwidth and CPU. It is fairly impossible to stream real time at 24 or 30fps any material larger than 480 pixels high or wide. Most streams should conform between 160x120 and 320x240. You establish the resolution to stream at on the first config page. Note that if at all possible, configure the source to be at the same resolution you intend to stream at, as this will greatly reduce CPU. Resizing a 640x480 capture or AVI to 320x240 will greatly impact your ability to stream it, so either set the capture settings to the resolution you intend to stream at, or resize the source AVI you'll be streaming from.


Processing power:
My Athlon XP 2600+ consumes 50% CPU doing live capture and encode on 30fps at 320x240 using 320kbps and a 180kbps keyframe bitrate. Yes, you *will* need very serious CPU to do live 30fps and 24fps encoding, as in a 1.4Ghz or faster processor. This is all the machine will be able to do with that processing power as well, so if you aren't ready to dedicate a CPU to the task, then you're not ready for high-bitrate high-quality broadcasting. You can reduce the frame rate or the resolution to attain a CPU usage level your machine can broadcast at. You can check by using Windows' Task Manager to look at CPU usage (performance tab) while encoding.


Upstream bandwidth:
Obviously, you can only push as many bits as your internet connection allows. All dialup, and most broadband connections do not offer enough upstream bandwidth to stream high-bitrate video. If your DSL line is 1.5 down and 128k up, then you could at most send a 96kbps NSV feed. Serious broadcasters looking to push 320x240 at 24 or 30fps will need to invest in a T1 line. Cable users may be able to squeeze enough bits upstream to a SHOUTcast server somewhere to relay the signal out. I use a company T1 line to send my stream to a SHOUTcast server, which is located at a major datacenter.


Type of material:
The rule of thumb here is the more motion, the more bits you'll need. A news broadcast will require significantly less bits than an action movie, as the amount of scene changes and camera motion in the news broadcast is usually focused on the same object.

Keeping this in mind, some of the following settings may be appropriate for your material:

T1 upstream, dual 2.4Ghz+ processor:
Pretty much whatever you want. Preprocessing and capture will occur on one CPU and the other CPU will be dedicated to compression of the audio and video. This CPU coupled with a MiniDV source via Firewire is the ideal broadcast setup.

T1 upstream, 2 Ghz+ processor, 320x240 30fps capture NTSC:
audio: 64kbps mono MP3 @ 44100
video: 280kbps / 120kbps keyframe @ qual 57

T1 upstream, 1.4Ghz processor, 320x240 30fps capture NTSC:
audio: 64kbps mono MP3 @ 44100
video: 256kbps / 100 kbps keyframe @ qual 57, 15 fps

Cable upstream, 1.4Ghz processor, 160x120 30fps capture NTSC:
audio: 24kbps mono MP3 @ 22050
video: 128kbps / 56 kbps keyframe @ qual 57, 15 fps


Hopefully this establishes some useful guidelines. I invite you to post messages on this forum about what hardware you're using and corresponding settings which work well for you. Please be specific about CPU, capture device, and audio/video settings!

Good luck,
-Tom
peppert is offline  
 
Go Back   Winamp Forums > SHOUTcast > SHOUTcast TV / Nullsoft Video

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump