Tag Archives: video

YouTube Command Line Player And Downloader `mps-youtube` 0.2.0 Released With Support For Downloading YouTube Playlists, More

mps-youtube is a command line tool that can be used to search, play and download YouTube videos, which supports both local and YouTube playlists.
By default, mps-youtube is basically a YouTube audio player (and downloader), but you can enable external video playback (via mpv or MPlayer) from its options:

Features:

  • search and play audio / video from YouTube;
  • search tracks of albums by album title;
  • search and import YouTube playlists;
  • create and save local playlists;
  • download audio / video from YouTube, with support for DASH (so it can mux separate audio and video streams – that means it can download 1080p YouTube videos since all 1080p YouTube videos use DASH);
  • view video comments;
  • works under Linux, Windows and Mac OSX;
  • many other small but useful features.

The latest mps-youtube 0.2.0, released today, adds quite a few new features and improvements, such as:
  • auto detect terminal size;
  • transcode audio to mp3 and other formats (requires ffmpeg or avconv);
  • added “da” (download best available audio file) and “dv” (download best available video file) commands to playlist search results;
  • added options to download YouTube playlists (use “dapl” for audio and “dvpl” for video) by url or id;
  • the progress indicator now works with mpv;
  • added option to show system notifications (on Ubuntu, install “libnotify-bin” and enable notifications using “set notifier notify-send”);
  • Added overwrite true/false option for downloads (skips download if downloaded file already exists);
  • added copy to clipboard feature (requires “xclip” on Linux);
  • remux audio downloads for better file compatibility.

Getting started with mps-youtube

To start mps-youtube, use the following command:

mpsyt

Before using mps-youtube, let’s configure it.

For some reason, the latest mps-youtube 0.2.0 doesn’t set a default player which means you can only download audio / video from YouTube but you can’t play any audio / video using mps-youtube itself. So let’s set a player – to do this, use the following command:
set player PLAYERAPP

where “PLAYERAPP” can be “mplayer” or “mpv”

By default, mps-youtube searches for music only. If you want to disable this, use the following command:

set search_music false

Also, mps-youtube plays just the audio by default so if you wish to enable playing videos (using the player set above), run the command below (once again, after running “mpsyt”):
set show_video true

You can view all the available configuration options by using the command below:
set

Searching for music / videos using mps-youtube is as easy as adding “.” or “/” in front of the search terms (without the quotes). For instance, to search for Led Zeppelin, you can use:
.led zeppelin

or:

/led zeppelin
You can navigate to the next / previous page of results by using “n” (next) and “p” (previous).
To play an item, enter its number. You can also play multiple items, for instance, use “1-5” to play items 1 to 5 or “1, 2, 6” to play the first, second and sixth item and so on.

To download an item, use:

d ITEM-NUMBER
For example, to download the 3rd search result, use “d 3” – this displays all the available audio and video formats and lets you choose which to download. You can also download the best audio (use “da ITEM-NUMBER”) or best video (use “dv ITEM-NUMBER”). This works for both searches and playlists.

This is just to get you started so for more information on using mps-youtube, type “h” and then “help TOPIC” (where topic is “basic”, “search” and so on) as explained in mps-youtube:

Install mps-youtube

Arch Linux users can install the latest mps-youtube via AUR
mps-youtube is available in Ubuntu 14.04 and 14.10 as well as Debian Sid and Jessie however, that’s an older version so if you want to install the latest version in Ubuntu, Debian, Linux Mint and so on, you can use PIP:

1. Install Python PIP:

sudo apt-get install python-pip

2. Install mps-youtube using Python PIP:

sudo pip install mps-youtube

3. You’ll also need either mpv or mplayer if you want to play audio or video via mps-youtube.

mpv is available in the official Ubuntu 14.04, 14.10 and 15.04 repositories as well as in Debian Jessie and Sid so to install it, use the following command:
sudo apt-get install mpv

Of course, you can also use mplayer, which is available in the official repositories for any Ubuntu / Debian version – install it using the following command:
sudo apt-get install mplayer

If you had mps-youtube installed and you want to upgrade it (or you want to upgrade it later on, when a new version is released), use the following command:
sudo pip install mps-youtube --upgrade

For Windows and Mac OS X installation instructions, bug reports and so on, see the mps-youtube GitHub page.

Read More

Video Transcoder `HandBrake` 0.10.0 Released With Support For New Encoders

HandBrake, a free, open source video transcoder for Linux, Windows and Mac OS X, has been updated to version 0.10.0, getting support for new encoders, like H.265 and VP8, along other interesting changes.

HandBrake 0.10

For those who aren’t familiar with HandBrake, here’s a quick list of features:
  • for input sources, HandBrake supports most common multimedia files and any DVD or BluRay sources that do not contain any kind of copy protection;
  • supported outputs:
    • file containers: MP4 (M4V) and MKV;
    • video encoders: H.264 (x264), H.265 (x265) MPEG-4 and MPEG-2 (libav), VP8 (libvpx) and Theora (libtheora);
    • audio encoders: AAC,, MP3, Flac, AC3 and Vorbis;
  • device presets;
  • title / chapter selection;
  • chapter markers;
  • queue up multiple encoding jobs;
  • subtitles support (VobSub, Closed Captions CEA-608, SSA, SRT);
  • constant quality or average bitrate video encoding;
  • video dilters: deinterlacing, decomb, denoise, detelecine, deblock, grayscale, cropping and scaling;
  • live video preview;
  • comes with graphical and command line interfaces.

Changes in HandBrake 0.10.0 include:

  • Libavformat is now used for muxing instead of mp4v2 and libmkv;
  • added FDK AAC encoder for Windows and Linux as a optional compile-time option;
  • added support for H.265 through x265 1.4 (this encoder is still early in it’s development, so is missing many H.265 features and optimizations);
  • added VP8 encoder (using libvpx);
  • added Lanczos scaler, which is currently HandBrake’s default;
  • added Bicubic (OpenCL) scaler – requires an AMD or Intel GPU supporting OpenCL 1.1 or later. On Linux, this is only available on the command line for now;
  • denoise: hqdn3d filter now accepts individual settings for both chroma channels (Cr, Cb);
  • denoise: new NlMeans filter which offers much higher quality denoising (though it is very slow);
  • added Windows Phone 8 preset;
  • updated libraries: x264 r2479-dd79a61, Libav v10.1 and libbluray 0.5.0;
  • the audio and subtitle controls have been overhauled to support default behaviors which can be stored in presets. This simplifies the workflow for many batch encoding scenarios;
  • Libfaac has been removed due to GPL compatibility issues, and replaced with the libav AAC encoder as the new default for Windows and Linux;
  • removed mcdeint deinterlace and decomb modes. This relied on the snow encoder in libav which has been was removed by upstream;
  • Linux only: automatic audio and subtitle track selection behaviors which can be stored per preset;
  • Linux only: improvements to Auto-Naming feature;
  • Linux only: Batch Add to queue by list selection;
  • Linux only: requires GTK3.

This release also includes some Windows-only new features, like Intel QuickSync video encode / decode support and experimental hardware decode support via DXVA.

For more information, see the official HandBrake 0.10.0 changelog.

Note that under Unity, the bottom HandBrake panes may use a dark background – this is a bug caused by Unity’s overlay scrollbars and you can fix it by disabling the overlay scrollbars (for instance, using Unity Tweak Tool).

Download HandBrake

Download HandBrake

(binaries available for Mac OS X and Windows, or source code)

Ubuntu 14.10 and 14.04 / Linux Mint 17.1 and 17 (and derivatives) users can install the latest HandBrake by using its official PPA. Add the PPA and install HandBrake using the commands below:
sudo add-apt-repository ppa:stebbins/handbrake-releases
sudo apt-get update
sudo apt-get install handbrake-gtk

The last command above will install the HandBrake GTK3 GUI. If you want to install the command line version, use the following command (of course, after adding the PPA):
sudo apt-get install handbrake-cli

You may want to check out the HandBrake Guide.

Read More

youtube-dl, Python video download tool, on front page of Hacker News

By Vasudev Ram

youtube-dl is a video download tool written in Python.

I had blogged about youtube-dl a while ago, here:

youtube-dl, a YouTube downloader in Python [1]

and again some days later, here:

How to download PyCon US 2013 videos for offline viewing using youtube-dl

(The comments on the above post give some better / easier ways to download the videos than I gave in the post.)

Today I saw that a Hacker News thread about youtube-dl was on the front page of Hacker News for at least part of the day (up to the time of writing this). The thread is here:

youtube-dl (on Hacker News)

I scanned the thread and saw many comments saying that the tool is good, what different users are using it for, many advanced tips on how to use it, etc. The original creator of youtube-dl, Ricardo Garcia, as well as a top contributor and the current maintainer (Filippo Valsorda and Philipp Hagemeister, respectively) also participated in the HN thread, as HN users rg3, FiloSottile and phihag_, respectively. I got to know from the thread that youtube-dl has many contributors, and that its source code is updated quite frequently (for changes in video site formats and other issues), both points which I did not know earlier. (I did know that you can use it to update itself, using the -U option).

Overall, the HN thread is a worthwhile read, IMO, for people interested in downloading videos for offline viewing. The thread had over 130 comments at the time of writing this post.

(On a personal note, since I first got to know about youtube-dl and downloaded it, I’ve been using it a fair amount to download videos every now and then, for offline viewing, and it has worked pretty well. There were only a few times when it gave an error saying the video could not be downloaded, and I am not sure whether it was due to a problem with the tool, or with the video site.)

[1] My first post about youtube-dl also had a brief overview of its code, which may be of interest to some Pythonistas.

This other post which mentions youtube-dl may also be of interest:

The most-watched Python repositories on Github

since youtube-dl was one of those most-watched repositories, at the time of writing that post.

Vasudev Ram – Dancing Bison Enterprises

Signup for emails about new products from me.

Contact me for Python consulting and training.

var addthis_config = {“data_track_clickback”:true};

Read More

Bonus: fbff, fbpad … and fbpdf too

I do feel obligated to list some framebuffer-specific software here, and I realized a week or two ago that my last list of framebuffer applications was not only almost a year old, but also omitted a worthy pair.

I don’t have much to show for fbff and fbpad, but they are both by the author of fbpdf, and mentioning one without the other two was an oversight. To complicate things, I don’t have a machine right now that will take faithful images of framebuffer output, so here’s my best effort at fbff, and to be fair, fbpdf.

2014-09-06-jsgk71-fbff 2014-09-06-jsgk71-fbpdf

Laughable, I know. Just don’t ask about fbpad. 🙄

fbff is probably my favorite of the three, as an alternative to running mplayer against the framebuffer. At 2Ghz on an ATI Mobility Radeon 7500 with an xvid-encoded avi file, the results were quite good. If you could see what it was showing, you’d be watching the opening credits for the first episode of season 11 of Gunsmoke. 😕 (Sorry, in my culture, people are mad for anything Western.)

And if you could see fbpdf at work above, it would be a classy black-and-white page with the words, “Sample text here.” I am nothing, if not inventive. 🙄

Please don’t blame the software for the shortcomings you see there. Both fbff and fbpdf accurately rendered the media against the framebuffer, and offered basic controls for each application. In spite of what you see above, they did actually work right. I just lack a proper screenshot.

fbpad was another issue, but that one was working against the clock for me. Configuring fbpad requires some heavy-duty font setup, the use of an outside font conversion tool, then editing the source code and recompiling fbpad to show the converted font.

I can’t say this is a better way than, perhaps, configuring fbterm. If you wade through those steps, show us a screenshot and we’ll all think highly of you. 😉

Dependency-wise, fbff and fbpdf were the heaviest, with fbff pulling in the ffmpeg structure (of course) and fbpdf requiring mupdf, some poppler and some djvulibre. If you have other options for video/audio/image playback and pdf display at the framebuffer, I’d recommend weighing them against what fbff and fbpdf will need.

fbpad didn’t strike me much heavier than fbterm, truth be told — unless you count the time and tools it would take to convert and configure and compile the font. And that, knowing full well I wouldn’t get a proper image of it anyway. 🙁

One last question you might ask: So why make so much fuss about a couple of framebuffer-based applications? Well, for one thing, alternatives to the industry-standard tools, like mplayer or fbida, are always welcome. Neither of those is such a perfect fit for a framebuffer-only machine that someone new can’t wedge their way into my system.

Second, and probably more importantly, access to a framebuffer can sometimes be what saves a machine from the eternal reward. There’s a big difference between a 233Mhz machine that can run text programs fullscreen at 80×25, and a 233Mhz machine that can run a full suite of terminal applications at 1024×768 using the terminus font overlaid atop a picture of Miles Davis.

One is functional, but the other is crazy, funky and cool. 😉

Tagged: audio, framebuffer, image, pdf, video

Read More