Category Archives: Transcoding

Getting out the most: PNG

Many people think that standards are made to simplify and formalize certain formats or tasks. However most standards remain ambigous or “free to choose” in critical parts. This can happen due to political issues (several solutions exist and different companies want to bring in their own stuff) or due to simplicity (just use some other standard that already is ambiguous or disambiguation doesn’t pay off).

One fine example is PNG: The encoding process includes several options which allow for some tweaking. Color space and quantization for instance can be chosen by the encoder. If the encoder uses some standard quantization the encoding might result in a much larger file than needed. Another example is the deflate compression routine, where a trade off between expected file size and buffers can be made (larger buffers result in a higher compression rate but also in a larger memory consumption for decoding). More information can be found e.g. in A Guide to PNG optimization.

For those of you just wanting to optimize their PNGs here is a list of useful stuff:

YouTube Videos for Mobile Phones

Having tested the YouTube Mobile portal I wanted to get the videos downloaded for my mobile phone. Unfortunately two facts hindered me from doing this: (i) Getting the video from an RTP stream is not that trivial and (ii) YouTube has only parts of its video converted for mobile access. Therefore I needed a way to get YouTube videos to my mobile phone 😀

  • First of all you need to get the actual video from Youtube. Surf to the video you like and dowÅ„load it using e.g. YouTube Downloader. Do not forget to rename yourvideo to .flv.
  • Then you will have to convert it to 3gpp. FFMPEG will do the trick. On Linux you might have to compile it yourself (as no AMR and AAC encoder are built in in many precompiled packages). On windows you might use precomiled binaries, e.g. from here.
  • Then let ffmpeg do the job for you:
    Windows: ffmpeg.exe -i .mov -acodec aac -s 352×288 .3gp
    Linux: ffmpeg -i .mov -acodec aac -s 352×288 .3gp

This command line shown above encodes the video to H263 with a bitrate of 200 kbps and AAC with a bitrate of 64 kbps. The video needs to follow the constraints of 3gpp and is therefore changed to resolution 352×288. This is the maximum possible with 3gpp. Alternatively one can also use the AMR audio codec. But this one has a rather low quality.

A ‘really strange approach’ for those of you running Linux, but not willing to compile: You can run the precompiled Windows with Wine ;-D