Showing posts with label Exaile. Show all posts
Showing posts with label Exaile. Show all posts

Saturday, February 27, 2010

Capturing audio from a flash file

Suppose you have a flash file that you want to extract the audio from. Perhaps it's an educational thing where the video really doesn't add much to the information, and you just want the audio so you can listen to it on your way to work.

You can use this script to download a flash file from YouTube:

http://www.catonmat.net/blog/revisiting-gnu-awk-youtube-video-downloader/

To run this script, just do

gawk -f path/to/get_youtube_vids.awk url/to/youtube/page

e.g.

gawk -f ./get_youtube_vids.awk http://www.youtube.com/watch?v=N_AqSbgMMS8

Copy the url out of the location bar of the browser. This created a file named N_AqSbgMMS8.flv in the current directory. This script should show progress, but that part seems to be broke. It'll claim to be at 0% for the entire download. It's better to check the file system for progress.

To dump the audio portion of the file, run ffmpeg from the command line. First do this:

ffmpeg -i N_AqSbgMMS8.flv

and see something like this:

Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 25.00 (25/1)
Input #0, flv, from 'N_AqSbgMMS8.flv':
Duration: 00:08:16.36, start: 0.000000, bitrate: 103 kb/s
Stream #0.0: Video: flv, yuv420p, 320x240, 95 kb/s, 25 tbr, 1k tbn, 1k tbc
Stream #0.1: Audio: mp3, 22050 Hz, stereo, s16, 8 kb/s
At least one output file must be specified

Then run this:

ffmpeg -i N_AqSbgMMS8.flv -vn -ar 22050 -ac 2 -ab 64 -f ogg bettername.ogg

-vn means no video
-ar means audio sampling frequency, set it to the same as in the output from ffmpeg -i
-ac means the number of channels, so if ffmpeg says 'stereo', use 2, if ffmpeg says 'mono', use 1
-ab is bit rate, the default is 64k
-f is the output format. "mp3" could be used in place of "ogg", but the restricted codecs would need to be installed. You can check the supported formats by running 'ffmpeg -formats'.

The ogg output produces a file that is a little weird. mplayer plays it from the command line just fine. Exaile adds it to the playlist, but the line in the playlist is blank. Exaile does play the file, though. Aqualung doesn't even seem to be able to load the file at all. No complaints from vlc.

To install the restricted formats, google around for "ubuntu restricted codecs" to find suitable instructions. After that, use synaptic to install both libavcodec-extra-52 and libavformat-extra-52 on Ubuntu 9.10. The mp3 file that is created works on all 4 of the players I tested, although Exaile still shows a blank line in the playlist. Maybe that's just a bug in Exaile.




Tuesday, August 4, 2009

Decibel

I continue to search for a decent music player. I just want something that will play tracks either from my laptop directly or from my desktop computer in the basement. Most of my music is on my desktop, I just mount the music directory on that computer using sshfs as a folder on my laptop, then I can pick and play whatever.

I was using Amarok for quite a while. It is decent, but has a lot of features that I don't use. I really don't use playlists, I usually just pick an album and play it from start to finish. Then I "upgraded" to Kubuntu 9.04, and found KDE lacking and Amarok had morphed into some sort of abomination not worth using. Long story short, I dumped both KDE and Amarok.

As a replacement for Amarok, I ran across Exaile. It seemed to be a pretty decent player, not too flashy, not a lot of features, but really, beyond a file chooser and play and stop buttons, what else does a music player need? The 0.2.x versions tended to lock up on me, so I got into the habit of using the lastest development version. While the 0.3.x versions don't lock up like the earlier versions, it does consume a significant amount of CPU cycles. I tend to listen to music while coding, and usually I'm running an IDE, JBoss, possibly a database, an SQL tool. All of these take a fair amount of horse power, so I don't want my music player using up 30% of the CPU.

Today I found a mention of Decibel on a blog about XFCE. It really is a minimal music player. The left side is a file chooser, the right side is the playlist. It has pause, stop, and play buttons, as well as forward and backward buttons. It has repeat and shuffle. That's about it. The preferences are minimal. It's memory footprint is tiny, and it uses almost no CPU. It does exactly what it needs to do to play music, and no more. Nice!

Thursday, May 28, 2009

Exaile

Exaile is a music player for Linux. I initially installed it after upgrading to Ubuntu 9.04 and finding that Amarok has been trashed. I have nothing against whoever in the Amarok project decided to make these horrible changes. I work on several open source projects, and my motivation is to produce apps that I like, and I don't often ask the community what they'd like. I'm assuming that's what happened with Amarok, it's just that the direction it has gone is not the direction I want to go.

So I searched around and found Exaile. It actually looks and runs a lot like the old Amarok did. I don't tend to make playlists. I have all my music in a single directory, separated out by subdirectories by artist, and further subdirectories by album. I tend to play complete albums, so this organization works well for me. Exaile has a file view that lets me drag and drop folders into the playlist area, and that's it. That's all I want, simply play the music and get out of the way. I don't want to look at visuals of someone else's idea of that music looks like graphically (I've got my own case of synesthasia, and I don't need any help with the visuals...) I also don't really care about the album art or the back cover or whatever. If I want those, I'll go take the covers off of the shelf and look at them directly.

Anyway, Exaile is a great app and worth looking into if you just want a good music player that just plays music. To install the latest, use apt-get and install exaile-devel:

sudo apt-get install exaile-devel

If you just do:

sudo apt-get install exaile

you'll get the older version from Ubuntu rather than the latest from the Exaile project.