The Basics
No surprises here, the basic syntax for reading a file isvlc [option] [file(s) path]
vlc” with “cvlc” in all the commands. Let’s start with the basics.1. Reading a DVD
To read a DVD, use the command:vlc dvd://[device][[@title][:[chapter][:angle]]]
vlc dvd://@1:8 –audio-language=en
2. Reading an Audio CD
To read an audio CD, very similarly, usevlc cdda://[device][@[track]]
3. Reading a Flux
To read a flux from the network:vlc http://IP_server:portvlc v4l2:///dev/video0
4. Managing playlist
I said earlier that you can easily create a playlist by putting more than one file as an argument. You can then define the playing mode withvlc -Z [files]
vlc -L [files]
vlc -R [files]
5. Put Video in Full Screen
To put a video in full screen:vlc --fullscreen [file]
vlc -f [file]
Advanced Usage
So far, we’ve seen the necessary code for using VLC as a multimedia player. But most of you know that we can use it for much more than that. VLC has a lot of modules which can be used to transcode files, stream them on the Internet, etc. To see all of these modules, typevlc -lvlc [input_stream] --sout \
'#transcode{vcodec=[video_codec], acodec=[audio_codec]}
:standard{access=[type_of_output], dst=[name_of_output], mux=[output_type]}'
[input_stream]” you put the file or flux that you want to transcode. The “--sout” indicates the output channel. Both “vcodec” and “acodec” define, respectively, the video and the audio codec used for the transcoding. You can choose among the codecs supported by VLC, like mp4v, MPJG, WMV1, vorb, flac, etc. The list is quite long so you may want to check on the official website. Then, “access” is for saving the transcoded file. The type of output can be “file”, “udp”, “rtp”, or “http”. “dst” stands for destination and defines the name of the output. Finally, “mux” is the format, to select among ts, ps, ogg, avi, etc.As you may have noticed, the access option makes the difference between transcoding and streaming on the networking. We could do something like
vlc -vvv video.avi –sout
'#transcode{vcodec=mp4v, acodec=mpga}
:standard{access=http, mux=ogg, dst=XXX.XXX.XXX.XXX:Port}'
As a final note, you can display the help for each module with the line:
vlc -p [module_name] --advanced
Conclusion
Of course, you can still do more with VLC and the command line. Summing up broadly, there is still audio content streaming, using different modules, screen casting, and more. But the syntax is very similar to the examples above, and the wiki should now seem a bit clearer. I invite you to play a little with the syntax, and to make your own examples in order to be more familiar with this great tool.Do you have other examples? Basic or advanced? Please let us know in the comments.
......................................
