I want to stream youtube videos from command line using VLC media player. I was able to stream youtube videos using this command
cvlc https://www.youtube.com/watch?v=m2Oo4kBHBNU
The problem is that when ever VLC streams videos it uses highest quality video format available (480 and higher). I dont have a uniform interned download speed, some times I can play youtube video of 360 (my highest quality) and other times I can play a youtube video of 240 only.
Because VLC currently streams with highest quality (480 and above according to video) I cant stream using cvlc https://www.youtube.com/watch?v=m2Oo4kBHBNU
this command. How should I force commandline VLC to play video of specific quality?
You can set the required input video settings in VLC for your YouTube clip in either of two ways:
Details of both options below:
Altering input video locally using the command-line:
You can request a specific video size from youtube from the commandline by using the
--preferred-resolution
option. This has the bonus of not changing vlc global settings, so settings specified in this manner are not saved. Settings for this are (seen incvlc -h
):So for your clip the following works nicely:
Altering input video globally using the GUI:
You can also alter the input video settings globally from the GUI preferences as shown in the screenshot below:
These settings are saved for subsequent vlc usage and will be saved in your vlc configuration file:
~/.config/vlc/vlcrc
. As an example: this is added for a preferred resolution of 240:You have to love vlc :)