Ripping mobility from the clutches of telecom
Ubuntu Dapper, ffmpeg, 3gp Videos, and Less Moose Than Ever
Mobile video is apparently the next big thing. Everyone knows it. Talk to just about anyone working in mobile and they know that everyone is working on video. The commercials on television and the radio keep telling me I can get the video content I want on my phone today!! For the most part I have to admit I’m not really sure what they’re doing.
I don’t really want to pay a few dollars to download a video in some format that I can’t play under Linux of someone (almost anyone really) shaking their junk. Maybe that Salma Hayek scene from Dusk till Dawn, but that’s about it. And getting videos of the kinds of content I want to watch into the formats I need them in to put them on my devices using the operating systems I choose to use has been and definitely continues to be difficult. And no, I’m not going to switch operating systems so that I can watch videos. I think the very concept of “entertainment” escapes a lot of people.
Yet I try it out every once in a while. Cause there is compelling content out there. What compelling content you might ask? Why, this years SchmooCon videos of course! If the website is to be trusted, the videos contain a record low level of moose. You just can’t get that kinda quality in commercial programming! I simply must have it. I don’t think I have to tell you how often I pull down a video on abusing security measures only to find a big hunk of moose in there stinking the whole thing up. Plus, I’m lusting after 3gp posting like MoMo London does. Not that I feel they’re lording their superior 3gp generation skills over us… but they could be! Makes me feel all hackity.
Here’s the step by for getting a 3gp output supporting set of tools onto Ubuntu Dapper:
- Make sure you have the extra repositories in your apt config and install mplayer and mencoder. I had a few repositories on already, and had mplayer installed before I started this adventure. However mencoder wasn’t in there, so I just cranked up the whole thing, apt-get update, and apt-get install mencoder-686.
- You need a ffmpeg that supports AMR in order to generate the 3gp videos. This includes, for some reason, downloading the codec from 3gpp.org. Yep, that’s right. Don’t even get me started. Just do it and steadfastly ignore the idiocy. IGNORE IT! You’ll need the ffmpeg source. The developers suggest pulling directly from subversion, I suggest listening to their suggestion.
- Once you have the ffmpeg source you should look in the libavcodec/amr.c file for info about where to get the necessary bits from 3gpp.org. Do not, under any circumstances, try to visit 3gpp.org itself. It’s worse than useless. I know you’re about to say something like “why the fuck should I be reading source code if all I want to do is create a 3gp video?” But in this case it will actually give you less of a headache if you read the instructions out of the source code of an open source project than if you try to read the website of a group responsible (from what I can tell) mainly for making things simple and easy. The amr.c file will have some links to the 3gpp.org website for some zip files, and it’ll tell you where to put them. I built with the amr_nb-float version. I tried out am_wb also, but that failed to build for me. The download I used was http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip.
Create the amr_float directory, download the zip, unzip it, unzip the zip inside the zip, sigh to yourself, and just keep going. - Standard build and install now: ./configure –enable-amr_nb; make; make install
- At this point you should have an ffmpeg executable, and it should know how to generate 3gp videos! The conversion process definitely isn’t what one would call seamless however. Personally I’ve been using the process described in this post to string together the right sets of commands. It seems to be working well.
ffmpeg, mencoder, and I have crossed paths before. It’s normally not a pretty sight. Sure, I manage to get them to do pretty much what I want. But it’ll take days sometimes of poking around, playing with options, trying suggestions that other random crackpots toss out into discussion forums. And even after that the video and audio get out of sync, the streams pop and hiss, the color levels are off, the volume is either deafening or too soft. But I have to say that this time around it’s looking pretty good actually. I’ve tried a few different videos and they’ve been converting well. The sync seems consistent throughout even a 40 minute video. I can understand what people are saying in the clips. And besides my visit to the 3gpp website (before I realized that the answers I was looking for laid in the ffmpeg source code) I haven’t even felt like crying yet. Ahhhh, the sweet moosey smell of success.
| Print article | This entry was posted by miker on July 19, 2006 at 11:44 pm, and is filed under ThisIsMobility. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |

about 3 years ago
Hi there,
Thanks for that.
I would suggest when configuring ffmpeg, to consider some of the other codecs you may want, eg xvid, ogg. You can substitute vorbis for libogg. Meh..
./configure –enable-amr_nb –enable-vorbis –enable-xvid; make;
sudo make install
What I want to know is if there is a way to configure my poxy phone to encode the audio as ogg!
Maybe what is needed, is a tool which will use a cached/mostly built ffmpeg, show a dialog explaining the license ambiguity, watch the user click “Yeah Whatever” (or no if they want to give up now), and then just build it, and install it as a deb. Pop this tool as part of a deb config into universe/restricted and bobs your proverbial uncle.
Of course, I am now already looking for ways to hack my phone to deal with other kinds of audio codec, or about to try to find one which supports other codecs.
about 3 years ago
This category contains both applets and components that can be used to play Flash video (.flv) in websites and Flash applications. Applets are XML-driven, and do not require the Flash authoring environment. Components, however, are designed for Flash developers, and must be installed using the Adobe Extension Manager. Most of these include demo files that you can download freely to see if these solutions are appropriate for you.
about 2 years ago
Well done. Worked for me also. Tomorrow I’m showing mobile video to officials in the City Hall of Gdansk (concerning a project utilising mobile video throughout the UEFA 2012 World Cup). Great thanks, my presentation will be clear.