Category Archives: meta

Compiling WebM into FFMpeg for Windows

I have updated this post with a newer version of the VP8 patches to FFMpeg and support for libvorbis instead of the built in vorbis support.

Google has released source for the VP8 codec as the WebM project. The WebM project will be an open alternative in the HTML5 video tag codec space and being backed by Google, who will use it for YouTube, will give it a fighting chance. WebM is starting to be integrated into FFMpeg but there are still some patches that need to be applied. While there are some guides to how to build FFMpeg for Linux with VP8 WebM support I wanted to get it compiled for Windows.

First off this won't be done using a Windows install but instead using Virtual Box with a fresh install of Ubuntu 10.04 desktop. It is just faster and easier that way. So go ahead and grab Virtual Box and get Ubuntu installed on it before you continue.

Continue reading

How to Create iPad Formatted Videos Using HandBrake or FFMpeg

This is for those who may want to load a video onto their iPad with iTunes that isn't in the correct format. I needed to do this because I was trying to put an iTunes University video on my iPad a couple days ago and iTunes complained that it wasn't in the correct format for the iPad. I'm not sure exactly how that could be but I decided to take the opportunity to see if I could use HandBrake to easily convert it to an iPad friendly format. There is currently no pre-loaded iPad configuration for HandBrake like there is for the iPhone and iPod Touch so I created a few profiles that can easily be imported into HandBrake to output different sizes for the iPad:

Note that when you import videos using iTunes the iPad puts them in their own Videos app unlike the iPhone where they show up under the iPod app. You will want to find the Videos icon if you don't already know where it is:

iPad Videos Screenshot

After verifying that the above 4×3 version worked for the iTunes University video I went about testing it on a couple other video formats. I tested the Big Buck Bunny video that I also used for my post on iPad video streaming in both 640×360 and 1024×576 output formats. Both resolutions looked great. I also tried converting a DVD. If you decide to convert a DVD you will probably want to turn on de-interlacing in HandBrake. You do that by first selecting the "Picture Settings" option:

HandBrake Picture Settings Screenshot

Then the filters tab and then select the type of de-interlace you want (fast, slow, slowest):

HandBrake DeInterlace Settings Screenshot

If you want to use FFMpeg to do all this you can. The following is a slightly modified version of the streaming command I'm using that will output a high bitrate version of the input video:

ffmpeg -y -i input.avi -acodec aac -ar 48000 -ab 128k -ac 2 -s 1024×768 -vcodec libx264 -b 1200k -flags +loop+mv4 -cmp 256 -partitions +parti4x4+partp8x8+partb8x8 -subq 7 -trellis 1 -refs 5 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 1200k -maxrate 1200k -bufsize 1200k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -aspect 16:9 -r 30 -g 90 -async 2 output.mp4

iPhone Windowed HTTP Live Streaming Server

After some more work I have enhanced the HTTP segmenter and uploading script from my iPhone streaming using AWS S3 and Cloudfront post. I added a number of features and tried to pull together some of the ideas from the comments. I'll go over some of the features here and there is a full list of configuration options on the HTTP Live Video Streaming server project page and the source is available at the github repo.

So the major changes I have added are:

  • Yaml based configuration file. See the project page for a complete list of options.
  • Ability to transfer segments via copy, ftp, scp and s3.
  • Added the ability to do variable bitrate streams.
  • Added re-streaming support.
  • Added logging to a file and better debug output.

The variable bitrate streams where done by using pipes. I haven't done a large amount of testing but it seems to work fairly well. I am able to stream a live HD video source into 3 different bitrates on a fairly old PC. Here are a couple clips I created to show the progressive enhancement in action, you probably want to switch to the HD version of the video and watch it full screen to get the bet view:


The configuration file will allow for any number of encoding options or transfer options and they can be put together in a number of different ways. Here are a couple examples of both, see the example configuration files for more.

An encoder example:

ep_128k:
  ffmpeg_command: "ffmpeg -er 4 -y -i %s -f mpegts -acodec libmp3lame -ar 48000 -ab 64k -s 320×240 -vcodec libx264 -b 128k -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 128k -maxrate 128k -bufsize 128k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -aspect 320:240 -g 30 -async 2 – | %s %s %s %s %s"
  bandwidth: 128000

Transfer configuration example:

ftp_dev:
  transfer_type: 'ftp'
  remote_host: '192.168.1.1'
  user_name: 'user'
  password: 'pass'
  directory: 'html/streamingvideo'

As a final note on changes, you are no longer able to use the segmenter without the script now really. If you want to do that you should use the original version of the segmenter source.

Please note that there is still some work to be done on the script to be complete. If I have time my next enhancement will be to add encryption and I will probably try to test builds on other distributions (maybe attempt to create segmenter binaries).

How to create iPhone wireframes with Inkscape

While developing ideas for iPhone applications I've played around with just using Interface Builder to stub things out. This works reasonably well but I know how to use Interface Builder so that makes a difference. If you are designing an application and want to stick with graphical tools only you are in luck because Yahoo has produced a set of wireframing SVG stencils for the iPhone that are very nice.

Continue reading

BlackBerry screen and icon sizes

For some reason the old link I had that contained display dimensions for BlackBerry devices is resulting in a 404 now. When you are doing BlackBerry development it is nice to be able to go to one page that just shows you the screen sizes instead of having to look at each device page so I don't know why they removed this page. After looking around a little I couldn't find a consolidated list that has just screen sizes so I figured I would put one together that replicates the old link:

BlackBerry device model Display screen size Icon image size
BlackBerry Pearl 8100 240 x 260 pixels 60 x 55 pixels Icon theme
48 x 36 pixels Zen theme
BlackBerry 7100 Series 240 x 260 pixels 60 x 55 pixels Icon theme
48 x 36 pixels Zen theme
BlackBerry Pearl 8220 240 x 320 pixels 46 x 46 pixels
BlackBerry Curve 8300 320 x 240 pixels 53 x 48 pixels Icon theme
48 x 36 pixels Zen theme
BlackBerry Curve 8900 480 x 360 pixels Unknown
BlackBerry 8800 Series 320 x 240 pixels 53 x 48 pixels Icon theme
48 x 36 pixels Zen theme
BlackBerry 8700 Series 320 x 240 pixels 53 x 48 pixels Icon theme
48 x 36 pixels Zen theme
BlackBerry Bold 9000 480 x 320 pixels 80 x 80 pixels
BlackBerry Storm 9500 360 x 480 pixels 76 x 76 pixels Home screen
24 x 24 pixels Shortcut bar

This data comes from the BlackBerry devices page.

Converting videos (flv,wmv,avi,etc) into a format that will work with the iPhone/iTunes

I have had an iPhone for a while now and I keep running into instances where I want to have videos outside of youtube in some format that I can watch on the device. These include windows WMV formatted videos from PDC as well as FVL formatted videos on Flex. I finally broke down and found a working solution to convert pretty much any video into a iPhone/iTunes format using mencoder.

Continue reading

Lots of new releases this week

It seems like this week has been release week for "web 2.0" stuff. Facebook F8 went live last week. All kinds of apps have followed.

Google released Maplets, a mashup editor, and Google Gears

Mapquest released an updated mapquest API that uses actionscript.

The one thing I note in all of these new releases is the lack of SOAP or enterprise related. Maybe it is just the current wave but most people seem to be embracing the less complicated API infrastructure.

SOAP vs REST

Recently it seems like the SOAP vs REST debate is heating up. Most of the debate seems to be leaning toward convincing people to not use SOAP based on its increasing complexity. Different people have different views on what REST is but in general if you look at the SOAP specifications or SOAP Standards and Web services and then look at the REST specification, REST for the Rest of Us, or REST you see that in general there is a lot more complexity to SOAP and that is just SOAP itself and not any of its extensions. Here are some good articles I've found that should give you insight into the debate:

After looking over the above references you may be interested in looking at Programmable Web's API list and see what others are using. The majority of the public services listed offer REST interfaces with some offering both REST and SOAP and very few offer just SOAP. Even though REST seems to be in favor now I believe there are still plenty of areas where SOAP makes sense when you have resources to devote to feeding and caring for it.

Tags: , ,