Tuesday, September 11, 2012

Yet Another Flash Alternative

[UPDATE: Youtube broke quvi. Waiting for an update... A new version (0.4.8-3) of libquvi-scripts has migrated to Wheezy which fixes the Youtube problem, so you can update your repositories and reinstall]

Since myself and others have written about the thousand or more flash alternatives out there, I thought I'd add one more to the mix. I've discovered a new tool for Linux called quvi. It works from the command line and streams Youtube videos to your player of choice. It basically works like this:

Install quvi, create the file ~/.quvirc and add:

exec = "yourplayer %u"
format = your preferred format

where yourplayer can be vlc or smplayer or whichever. I prefer to run mplayer from the command line with arguments, so my exec line is "mplayer -really-quiet -framedrop -cache 8192 -cache-min 10 %u". (EDIT: if mplayer's picture is lagging behind the sound, add the argument "-lavdopts skiploopfilter=all" and choose a WebM format instead of mp4 as those have less pixelation when skipping the loop filters)

For your preferred format, typical Youtube formats are fmt18_360p, fmt22_720p, and fmt37_1080p, which play mp4s in those resolutions (WebM videos are fmt43_360p, fmt44_480p, fmt45_720p, and fmt46_1080p, and flv videos are fmt5_240p, fmt34_360p, and fmt35_480p). My preferred format is fmt18_360p.

After saving the file, playing videos is as simple as copying the video URL from your browser (don't forget the http://) and then pasting it in a terminal window in quotes after the quvi command like this:

quvi "Youtube URL"

Incidentally, to paste something in an xterm or aterm window, middle-click while the mouse cursor is over the terminal window.

A full list of available formats can be found with:

quvi "Youtube URL" --query-formats

See much more at quvi's man page. It's supposed to support other sites besides Youtube, but I haven't tested them. Also, a similar command line tool for saving videos to disk is called cclive.

When using quvi with mplayer, I find this the most cpu-efficient way to waste time, I mean, watch Youtube videos, and I can even watch them without frame-skipping on a G3 laptop, something I couldn't say for Mactubes.

5 comments:

  1. Nice. However....

    I can only get the 3gp stream, even with exec=mplayer and my format set to fmt22_720p in the .quvirc file. Any ideas? Tried a bunch of youtube videos and always get the fantastocrappy 3gp file.

    This should be very useful to people on G3's and using mintPPC. I was able to install quvi directly from the software manager in Mint 13 on my Dell D620 lattitude, by the way.

    Like the look of Vegas Baby! too!

    ReplyDelete
  2. Nevermind...if the requested default file size is not there, it defaults to 3gp. Doh.

    ReplyDelete
  3. Unrelated, but since we are talking about video... I took the liberty to use AppleScript to automate your method to launch MPlayer from the shell. See:
    http://forums.macrumors.com/showpost.php?p=15703239&postcount=55

    Keep up the good work!

    ReplyDelete
  4. Unrelated, but since we are talking about video... I took the liberty to use AppleScript to automate your method to launch MPlayer from the shell. See:
    http://forums.macrumors.com/showpost.php?p=15703239&postcount=55

    Keep up the good work!

    ReplyDelete
  5. hello,

    have you tried https://code.google.com/p/trizen/

    it's the best tool i ever found for this task and it's developer is very friendly, he already helped me install the new version.

    ReplyDelete