Saturday, January 28, 2012

Strip audio track from a video file using mplayer

Let's say there is a large file encoded into mp4 and the audio is what is of most interest. Because I am not very familiar with mplayer/mencoder/sox this was a problem in the sort of hard category. First, I tried using mencoder, but I think some frame synchronization data is included in the stream and causes a metronome-like ticking. I tried using mplayer instead, and finally found the right sequence with some googling and trial and error. I'll save my work here for future reference.

Command line sequence to strip audio from an mp4 using an intermediate named fifo buffer
$ mkfifo fifo.wav
$ mplayer -quiet t.mp4 -ao pcm:fast:file=fifo.wav -vc dummy -vo null -channels 2 &
$ cat fifo.wav | sox -t raw -r 44100 -e signed -b 16 -c 2 - -t ogg audio.ogg
$ rm fifo.wav

For my test file, the resulting ogg file was about 5% as big as the mp4 file that includes the video. YMMV

Also, in fooling around with sox, I stumbled upon this misc information. I think this may be equivalent to the "play" command:

$ sox audio.ogg -d

Wednesday, January 25, 2012

This American Life: Planet Money Team on Euro Crisis

This episode was mostly about the Greek aspect of the European Debt Crisis. Here is the audio split into 5 parts.

1.
2.
3.
4.
5.

Wednesday, January 18, 2012

On Point Discussion : SOPA/PIPA

This was a very interesting and timely discussion.

Direct to mp3 download.

Broken into 4 x 12 minute segments:

1.
2.
3.
4.

I liked the comment about the buggy-whip manufacturers. They content providers could lock down their content if they wanted to do it. They're asking everyone else to change to accommodate their outdated business model.

Reddit Goes Black to Protest SOPA/PIPA

Reddit is down to protest SOPA/PIPA. Wikipedia is also down. As an experiment, let's see if I can still write something from memory and without fact checking. ;)

Of course, if wikipedia were up and running, I could have simply linked to their article on the subject. I am sure that their crowd-sourced article is infinitely better than what I've pieced together here. Write your congressman to stop introducing breakage into the internet.


  • Tit: The internet perceives censorship as damage and routes around it.

  • Tat: SOPA would break DNS at the TLD level




In case, you haven't heard about reddit, here is my summary of what it is. Reddit is one of the most popular and innovative sites on the internet. It is ranked within the top 75 websites in the world, as estimated by total traffic; it is ranked within the Alexa top 125. Recently, Reddit released some of their traffic statistics that showed 2 billion page views in one month. That's fine and good, but what is it? It is a website that is designed to provide news aggregation to appropriate sub-communities within their total audience. They have the seemingly simple goal of matching the topic being discussed with an appropriate news consumer. This isn't a new idea- not by any measure. TV news (remember TV news?) was originally categorized into segments for basic news, weather, and sports. Newspapers (remember newsprint?) have always had a lot of sections: local, national, editorial, comics, classifieds, etc. The concept is the same, only Reddit takes this concept to its ultimate limit. There are literally tens of thousands of categories with content provided and driven by a matching community. Most reddit communities, or subreddits, are small. However, the most popular have over 1 million subscribers! Popular subreddits are r/pics, r/funny, r/todayilearned, r/askreddit, r/iama, r/explainitlikeimfive. There are a lot of technical subreddits, too: r/linux, r/buildapc, r/opensource, etc. The content on most of these subreddits is lightly moderated. That means users will mostly decide what will be popular and what is relevant. A story rises and falls based on popularity. Users really vote for good stories, moving them up in the massive stack of past stories. Also, bad stories get voted down, and they sink deeper into the accumulated pile. If a story becomes popular at the subreddit level it can be promoted to the main page and receive wide coverage from the vast overall audience. The method seems to work. Even stories with very obscure content can receive coverage, simply by catching the interest of a critical mass of the community. That is my view from 10,000 feet. I really could've used wikipedia to check my facts!

Here is a recent screenshot showing the SaltLakeCity subreddit:
.

Because Reddit is doing a lot of things right, and providing a lot of innovation it is the heir-apparent to earlier web pioneers that showed the potential and versatility of on demand news sites. Slashdot is the grandfather of all of these sites. Reddit added features and flexibility and it's hard to see it losing out to anyone else. The government is trying to interject itself into this space. Reddit would be affected to the point that they've said they'd close their doors. Amazingly, reddit keeps their website running with only ten or eleven employees. If SOPA/PIPA pass, then bye-bye reddit!

Here is a taste of what the law could lead to, no more reddit:

.

What about reddit has made it popular?


  • Empowers users to build and manage their own content

  • Easy and powerful user interface to format text, embed graphics, and link to other sites in a totally immersed web environment

  • heir-apparent to earlier news aggregation sites (slashdot, digg)
  • heir-apparent to usenet classification-type system. subreddits match closely with newsgroups in usenet. For example, comp.os.linux.misc matches up with discussions at r/linux and r/opensource.

  • Dynamic rendering of the site on a per user basis. Rendering is determined based on several factors including user subscription and group access control lists. I am guessing that these requirements must place significant demand on their Amazon based servers that are used to provide the site to its 1 million plus simultaneous users. As users know, the site sometimes struggles with delivering content 100% of the time.


Sites like reddit are at the forefront of innovation. Empowering users means giving people what they want. That can be as simple as providing the news they want. It also can be used in creative ways, ways never imagined by their creators. Social media and technology were at the heart of the Arab Spring uprisings. The people demanded their governments give them what they want, or get out of the way.

Monday, January 16, 2012

Minor Update to My Live USB

I have been using a live USB based system, off and on, for the last few months. I am impressed with how well it actually works! There have been a few glitches on my hardware, and have switched to the bleeding edge linux kernel, v3.2.1. I've also upgraded to Firefox 9. It moves a few toolbars around by default, but they can be swapped back to look more like v.3.6.x. The root filesystem is prepopulated with an almost full base install of Slackware 13.37, with a few updates beyond, including the kernel. A few useful packages are also installed including the evince document viewer, and some browser plugins. The space used from the outset is about 3.9G.

Here is a screenshot of the live USB running, with the firefox about box appended:
1.

The system is running in true live mode- all changes to the system are stored in RAM only. A persistent mode is also available. The system's root filesystem is using the same layout as discussed previously on an 8G flash drive.

edit: Here are the steps I use to finalize the boot of a pristine Slackware install in live mode.


  • login as root

  • run pkgtool, select the slackware scripts to run again. Select the relevant choices.

  • add a non-root user using adduser

  • add the above non-root user to the sudoers list, using visudo

  • setup wifi connection parameters, if applicable, using wicd-curses, or similar

  • login as non-root user and begin customizing user environment as desired


    • set screensaver; I dislike the default selection, random screensaver

    • customize xfce's main toolbar

    • start firefox to initialize user directory, .mozilla

    • install adobe flash

    • install other plugins: greasemonkey, reddit enhancement suite




Update 2012-02-02: There were a lot of slackware patches in the recent official slackware changelog. Here is a screenshot showing Firefox 10.

2.