Search:  
Gentoo Wiki

HOWTO_NSV_on_Linux


This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

Contents

Introduction

The aim of this document is to enable Nullsoft Streaming Video (NSV) decoding in Gentoo. NSV is used in conjuction with Shoutcast to provide Internet TV service to Winamp users. Although one of the common codecs, VP3, is open-source, the more common codec, VP6, is proprietary. Therefore, many streams cannot be decoded in Linux.

Installation

Codecs

First, the Windows codecs need to be installed. Although Real Media is beyond the scope of this guide, it is still useful to include Real support.

Code: Installing Windows Codecs
# echo "media-libs/win32codecs real" >> /etc/portage/package.use
# emerge win32codecs

The Player

Next, MPlayer, with network streaming support, needs to be installed. This is the only player in Linux which currently has the best support for VP6 NSVs. At the time of this writing, the version of mplayer that supports the win32codecs USE flag is mplayer-1.0_pre7 which is not in the 'stable' branch of portage. We need to tell portage to get the latest 'testing' mplayer package:

Code: Installing MPlayer with network streaming support
# echo "media-video/mplayer ~x86" >> /etc/portage/package.keywords

And then the USE flags for mplayer:

Code: Installing MPlayer with network streaming support
# echo "media-video/mplayer network real live win32codecs" >> /etc/portage/package.use
# emerge mplayer (Tip: Dealing with masked packages)

Note: if you already have an entry for media-video/mplayer in your /etc/portage/package.use, just edit the file manually and don't use the 'echo' command and bash redirection.

Now, run mplayer:

$ mplayer

You should get results similar to the following:

CPU: Advanced Micro Devices Athlon 4 /Athlon MP/XP Palomino 1541 MHz (Family: 6, Stepping: 2)
Detected cache-line size is 64 bytes
MMX supported but disabled
MMX2 supported but disabled
SSE supported but disabled
3DNow supported but disabled
3DNowExt supported but disabled
CPUflags:  MMX: 0 MMX2: 0 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions:

Now, recompile mplayer with the necessary supported processor options, such as mmx and sse, enabled. This should improve performance.

File: /etc/portage/package.use
media-video/mplayer network real live mmx mmxext sse 3dnow 3dnowext

Finally:

# emerge mplayer

Watching NSV Streams

Because NSV Streams are Shoutcast servers, they have a limited number of slots for listeners to fill. When a server is full, the client can continue to attempt to connect to the server by looping connection attempts. In Winamp, this can be done by toggling 'Repeat' in the playlist. However, in Linux, this can be done using a shell script:

File: nsvstream
#!/bin/sh

while true
do
sleep 3                 # so the server is not bombarbed with requests
mplayer $1 -ao alsa     # Replace with proper ID. OSS Users: Replace with proper device.
done

This script can be used to connect to a stream like so:

Code: Connecting to NSV Streams
nsvstream http://ip:port

If you want to list multiple streams on the command line, edit the script to read:

File: nsvstream-multi
#!/bin/sh

while true
do
sleep 3                 # so the server is not bombarbed with requests
for stream in $*
do
 mplayer $stream -ao alsa     # Replace with proper ID. OSS Users: Replace with proper device.
done
done

Or if you wanted to have a listing of the same streams as Winamp users you could try Lintelkku or Tunapie

In Winamp, a Shoutcast URL usually ends with ';file.nsv' or 'listen.pls'. This is unnecessary with MPlayer; it only needs the IP address and port.

Links

MPlayer Homepage

Nullsoft NSV Info Page

Lintelkku

Retrieved from "http://www.gentoo-wiki.info/HOWTO_NSV_on_Linux"

Last modified: Fri, 05 Sep 2008 06:32:00 +0000 Hits: 18,171