Difference between revisions of "What can VLC do?"

From VideoLAN Wiki
Jump to navigation Jump to search
m (link)
Line 101: Line 101:
 
You can reach me at: jonas (at) vrt.dk
 
You can reach me at: jonas (at) vrt.dk
 
(Im also regularly in the freenode videolan channel, nickname E-bola)
 
(Im also regularly in the freenode videolan channel, nickname E-bola)
 +
 +
The following script is an edit by Inf3rn0 ;)
 +
 +
c:\programfiles\VideoLAN\vlc\http\NowPlaying.htm
 +
<pre>
 +
ID TAG:<vlc id="value" param1="'ARTIST' vlc_get_meta"/> - <vlc id="value" param1="'ALBUM' vlc_get_meta"/> - <vlc id="value" param1="'TITLE' vlc_get_meta"/> (<vlc id="value" param1="'Genre' vlc_get_meta"/>)
 +
 +
<vlc id="foreach" param1="pl" param2="playlist" />
 +
PLAYLIST FILENAME:<vlc id="value" param1="pl.uri" />
 +
<vlc id="end" />
 +
 +
TIME:<vlc id="value" param1="stream_time" />/<vlc id="value" param1="stream_length" />
 +
</pre>
 +
 +
mIRC script
 +
<pre>
 +
alias F2 {
 +
  sockopen vlc_meta_info 127.0.0.1 8082
 +
}
 +
on *:SOCKOPEN:vlc_meta_info: {
 +
  sockwrite -n $sockname GET /NowPlaying.htm HTTP/1.1
 +
  sockwrite -n $sockname Host: localhost
 +
  ;sockwrite -n $sockname Connection: Keep-Alive
 +
  sockwrite -n $sockname $crlf
 +
  sockwrite -n $sockname $null
 +
  /msg $active NP: %tag ( $+ %filename $+ ) ( $+ %time $+ )
 +
}
 +
on *:sockread:vlc_meta_info: {
 +
  if ($sockerr > 0) return
 +
  :nextread
 +
  sockread %temp
 +
  if ($sockbr == 0) return
 +
  if (%temp == $null) /set %temp EMPTY EVENT
 +
  if (404 isin %temp) {
 +
    echo $active 404 when connecting to VLC
 +
    goto end
 +
  }
 +
  if (Undefined isin %temp) { goto nextread }
 +
  if (General isin %temp) { goto nextread }
 +
  if (ID TAG: isin %temp) { %tag = $remove(%temp,ID TAG: ) }
 +
  if (PLAYLIST FILENAME: isin %temp) { %filename = $remove(%temp,PLAYLIST FILENAME: ) }
 +
  if (TIME: isin %temp) { %time = $remove(%temp,TIME: ) seconds }
 +
  goto nextread
 +
  :end
 +
  sockclose vlc_meta_info
 +
}
 +
</pre>
 +
The format is: Artist - Album - Title (Genre) (Filepath) (Time elapsed/total time seconds)
 +
 +
You can now press F2 on you'r keyboard to print what you are listening to :)
 +
 +
//Inf3rn0
  
 
== Streaming - client ==
 
== Streaming - client ==

Revision as of 23:14, 17 May 2006

This area of the wiki contains a list with the possibilities VLC gives you. It was made to help people better realize the potential VLC has. Some entries will simply mention the possibility, others try to explain how to do it as well. Let me start by apologising for my horrible spelling, but I hope you will be able to decipher the texts anyway.

Mediaplayer

Compact Disc (CD) Images

If you have a CD-DA (audio CD), SVCD, or VCD packaged inside a CD-image, in some cases VLC media player can play this without you having to mount it or extract it. You can simply choose "open file" and pick the CD-image. For CD-image support vlc has to be compiled using libcdio (--enable-libcdio) and the various plugins which use libcdio need to be selected (--enable-cddax, --enable-vcdx). Some of these enablements may not be the default for your OS.

The kinds of Compact Disc formats supported are CDRWIN's BIN/CUE format, cdrdao's TOC format, and a limited set of Nero (NRG) formats.

(libcdio also supports ISO-9660 image reading but at present there is no VLC access plugin which uses it. DVD's images follow the UDF format and at present there is no support in libcdio for that, although some limited progress has been made in that direction. It is possible that will get added in the future; volunteers are most welcome).

How to enable/use subtitles

Before you try to enable subtitles make sure the subtitles you have are in a format that VLC can read! You can find the list of compatible subtitle formats here. If VLC has detected any sort of subtitles available, you will be able to turn them on under the menu: Video->Subtitles track->Track 1

Auto detection of subtitle files uses a 'fuzzy' logic which you can specify. If this is wrongly specified you may end up with more subtitle file options than really exist or miss some that are provided. By default it allows any file in the right place which exactly matches the video name, and may have some extra characters. If you are not seeing the number of subtitle options you expect you might want to allow more 'fuzziness' by changing the preference in video/subtitles/subtitle autodetection where help is available if you 'hover' over the field.

If you mainly use .srt subtitles or .sub, you can get them turned on automatically when they are detected, by setting the Input/Codecs->Advanced->Choose subtitle track to 0, it will automatically turn on the subtitle track. You can also experiment with the Choose subtitle language on the same page. But if you experiment a bit with the settings you should be able to get subtitles turned on automatically.

Note: On Mac OS X, the "Video->Subtitles track" menu item is permanently disabled for some reason. You must manually specify the location of the subtitles file in the "Subpictures" pane of the preferences.

Playing windows media files

VLC should be able to succesfully play both audio and video in wma and wmv 1 and 2, for the newest version (wmv3) only the windows version of vlc will be able to play it, since no opensource implementation of wmv3 have been made so far, so the windows vlc plays it by using the windows api. DRM files however can not be played on any OS.

How to adjust picture brightness/colors/contrast..

If you are using the wxwindows userinterface: You can adjust the typical values to tweak the picture of your video source by turning on the extended GUI. This is done in the menu: Settings->Extended GUI. That will give you some extended control options for the video picture as well as an equalizer for the audio.

If you use Mac OS X or a skinned version of VLC: You need to enter the preference menu: Settings->Preferences. Once you have the preferences window open you go to: Video->Filters->Image adjust. Here you can adjust the different values. Note before they take effect you need to turn on the "Image adjust" filter in: Video->Filters

How to control the aspect ratio of the video

Using VLC, you can override the source aspect ratio. This is available both as a command line option and as an option in the Preference dialog in the graphical interface. The aspect ratio can be specified both in ratio format (16:9) or as a decimal number (1.33).

Command Line

When invoking VLC from the command line, use the option --aspect-ratio. For instance,

vlc --aspect-ratio 1.85

Graphical Interface

If using the graphical interface, the setting is In the Video section of the Preferences dialog. You may specify the aspect ratio in the field labeled "Source aspect ratio."

Here is a list of the more common aspect ratios.

  • Fullscreen: 1.33 or 4:3
  • Widescreen: 1.78 or 16:9
  • Typical DVD: 1.85
  • Cinemascope: 2.35

Announce whats playing to IRC

Announce the currently playing track to mirc (an irc client). This is often referred to as a "now playing" script. To be able to get this functionality with vlc one aproach would be to use the http interface. With it you can create a simple file which will display "'Artist' with the song 'Title' from the album 'Album' the genre is 'Genre'" on a page in ur browser. You can then pull that page from mirc with standard sockets and thereby use the text in a script in mirc. Below i will provide some VERY simple and very ugly examples on how you could use this. The examples are tested with vlc 0.8.5 and mirc 6.12. I cant guarantee the code work with any other versions (although it most likely will). Ok so here we go. You start with create a test.html file in the http interface directory (C:\Program Files\VideoLAN\VLC\http) inside this file paste the following to ONE line or it will not work:

ANNOUNCE <vlc id="value" param1="'ARTIST' vlc_get_meta"/>
 with the song <vlc id="value" param1="'TITLE' vlc_get_meta"/>
 from the album <vlc id="value" param1="'ALBUM' vlc_get_meta"/>
, The genre is <vlc id="value" param1="'Genre' vlc_get_meta"/>

Remember to leave an empty line behind the actual line of code, vlc/mirc seems to want this. Then you must create a script in mirc under remote (alt+r) and paste in the following:

alias now {
  sockopen vlc_meta_info 127.0.0.1 8082
}

on *:SOCKOPEN:vlc_meta_info: {
  sockwrite -n $sockname GET /test.html HTTP/1.1
  sockwrite -n $sockname Host: localhost
  ;sockwrite -n $sockname Connection: Keep-Alive
  sockwrite -n $sockname $crlf
  sockwrite -n $sockname $null
}

on *:sockread:vlc_meta_info: {
  if ($sockerr > 0) return
  :nextread
  sockread %temp
  if ($sockbr == 0) return
  if (%temp == $null) %temp = ---
  if (ANNOUNCE isin %temp) {
    %temp = $remove(%temp,ANNOUNCE )
    describe $active is listening to %temp
  }
  goto nextread

  sockclose vlc_meta_info
}

Only things u might want to change is the port the http interface listens on, thats the first line and is port 8082 in my case. You might also want some other text than "is listening to" just change as you see fit.

Thats poretty much it. You should enable the http interface in vlc by default if u wanna use this on a regular basis. This is done under preferences in "Interface->Main interfaces"

Then with all thisa done (and vlc restarted) you can type /now in mirc and it will display ur currently playing track.

This was made for mp3 tracks, so if it doesnt work with other types of media let me know. You can reach me at: jonas (at) vrt.dk (Im also regularly in the freenode videolan channel, nickname E-bola)

The following script is an edit by Inf3rn0 ;)

c:\programfiles\VideoLAN\vlc\http\NowPlaying.htm

ID TAG:<vlc id="value" param1="'ARTIST' vlc_get_meta"/> - <vlc id="value" param1="'ALBUM' vlc_get_meta"/> - <vlc id="value" param1="'TITLE' vlc_get_meta"/> (<vlc id="value" param1="'Genre' vlc_get_meta"/>)

<vlc id="foreach" param1="pl" param2="playlist" />
PLAYLIST FILENAME:<vlc id="value" param1="pl.uri" />
<vlc id="end" />

TIME:<vlc id="value" param1="stream_time" />/<vlc id="value" param1="stream_length" />

mIRC script

alias F2 {
  sockopen vlc_meta_info 127.0.0.1 8082
}
on *:SOCKOPEN:vlc_meta_info: {
  sockwrite -n $sockname GET /NowPlaying.htm HTTP/1.1
  sockwrite -n $sockname Host: localhost
  ;sockwrite -n $sockname Connection: Keep-Alive
  sockwrite -n $sockname $crlf
  sockwrite -n $sockname $null
  /msg $active NP: %tag ( $+ %filename $+ ) ( $+ %time $+ )
}
on *:sockread:vlc_meta_info: {
  if ($sockerr > 0) return
  :nextread
  sockread %temp
  if ($sockbr == 0) return
  if (%temp == $null) /set %temp EMPTY EVENT
  if (404 isin %temp) {
    echo $active 404 when connecting to VLC
    goto end
  }
  if (Undefined isin %temp) { goto nextread }
  if (General isin %temp) { goto nextread }
  if (ID TAG: isin %temp) { %tag = $remove(%temp,ID TAG: ) }
  if (PLAYLIST FILENAME: isin %temp) { %filename = $remove(%temp,PLAYLIST FILENAME: ) }
  if (TIME: isin %temp) { %time = $remove(%temp,TIME: ) seconds }
  goto nextread
  :end
  sockclose vlc_meta_info
}

The format is: Artist - Album - Title (Genre) (Filepath) (Time elapsed/total time seconds)

You can now press F2 on you'r keyboard to print what you are listening to :)

//Inf3rn0

Streaming - client

Listen to online radio

You can of course always simply find a link to a radiostream and then open it as you would any other network stream in VLC. But if you would like to browse a list of online radios, you can try the list of shoutcast radio stations VLC can download for you. First you need top open the playlist window: View->Playlist. Once you have the playlist window open chose: Manage->Service discovery->Shoutcast radio listings. After 10 seconds or so the playlist should have become populated by radio station entries. You obviously require internet access for this to work! If you want the stations sorted alphabetically, you can chose: Sort->Sort by title. Also note shoutcast have many thousands stream availeble, per default in 0.8.2 250 stations are downloaded, this can be changed in the preferences under: Playlist->Service discovery->Shoutcast. Note that the more stations u want to add, the longer delay u will see when the station list is downloaded parsed and added to the playlist. Also note you should see 2 "Folder nodes" in the playlist under shoutcast called Genres and bitrate where the stations will be listed under their respective areas. Note that most stations claim to be multi genre, so a station might be listed under both Top40, pop and rock.

Streaming - server

VLM

The VLM is the Video On Demand part of the VLC streaming server features. It lets u setup a bunch of entries and then let users ask for those streams and it then gives them to the users, it has ALOT of possibilities and i will try to cover them all here.

You can devide VLM entries into 2 general categories VOD and broadcast entries.

Capture / Record things