NAV: daxcompress ffmpeg_psp pmpenc


ffmpeg with h.264/AVC for the PSP

Take a look at vepp, too!

The PSP has this great capability of playing your own videos if you convert them to the mp4-like format. If your PSP's firmware is below 2.00, you can only use mpeg4 simple profile but if it's 2.00 of above you can use h.264/AVC which, to my experience, is much better at low bitrates. Anyway, the firmware restricts the resolution to half of the PSP's pixels. If you can run homebrew software on your PSP you can get full-res with other players (see pmpenc).

Nobody seems to provide us Linux/unix/OSX people with a transcoder, but all the good ones seem to use ffmpeg which is already there for unix. If you don't want AVC you can use any version of ffmpeg, otherwise you need the patched version below. pspenc.sh is a wrapper for it all.

Instructions for building ffmpeg (MobileHackerz version) under unix

I "ported" the MobileHackerz version of ffmpeg back to unix. The following was only tested with Debian Linux unstable as of 2006-01-14 but should work fine elsewhere.

You need

For pspenc.sh, you'll need

Compilation and Installation

Get the linked files above and place them into your homedir. There are several ways to build and install ffmpeg, I'll show how to install it in your homedir. Experienced users will find it easy to adapt these instructions for system-wide installation.
$ cd ~
$ tar zxvf ~/x264_051028.tar.gz
$ cd x264_051028/
$ ./configure --enable-pthread --prefix=${HOME}
$ make install

$ cd ~
$ tar zxvf ~/ffmpeg-051130-0.33.tar.gz
$ cd ffmpeg_051130/
$ patch -p1 < ~/ffmpeg-mh-unix.patch
$ ./configure --enable-faac --enable-x264 --enable-gpl \
--enable-xvid --enable-pthreads --prefix=${HOME} --disable-debug \
--extra-cflags=-I${HOME}/include --extra-ldflags=-L${HOME}/lib
$ make install
That's it. Binaries will be in ~/bin. Some files will be installed in ~/lib, ~/include and ~/man.

Using it

I suggest using my little shell-script to transcode files for the PSP. Get pspenc.sh here. For aspect-preserving resolution calculation, you need mplayer, myidentify.sh, python and rezomatic.py in your PATH.

Options

usage: pspenc.sh [option]... [file]...
  --bitrate, -b       set bitrate for video (384)
  --4by3, -4          set aspect to 4:3 (default is 16:9)
  --singlepass, -1    single pass encoding (default is 2-pass)
  --mpeg4sp, -m       use MPEG4/SP (default ist h.264/AVC, this need firmware
                      2.00 or above on the PSP)
pspenc.sh will create .pspenc/num in your home directory to keep track of the file number (nnnnn below).

Example

$ pspenc.sh legal_movie_file.avi
This will result in files named MAQnnnnn.MP4 or M4Vnnnnn.MP4 which you will have to place into the folders /MP_ROOT/100ANV01 or /MP_ROOT/100MNV01 on your PSP respectively.

Notes

"normal" ffmpeg 20060101-0.2 seems to be able to produce MPEG4/SP files which are suitable for the PSP. h.264/AVC works only with the MobileHackerz version.

The instructions above will install ffmpeg in /usr/local/bin. If you already have ffmpeg in /usr/bin, that version may get executed instead. Check with

$ which ffmpeg
and modify pspenc.sh accordingly.

If you need additional codecs (like ac3) run

./configure --help
in the ffmpeg sourcedir. Follow the instructions. Enabling additional codecs may require that you install additional software. Then do
make clean
make install
again.

pspenc.sh tries very hard to find a suitable resolution which doesn't distort your video while filling as much of the screen as possible. If it should get the aspect ratio wrong, please let me know.

Legal

No warranties. Don't hold me responsible for anything that happens. Do not use this for anything illegal. For ffmpeg, see FFmpeg License and Legal Considerations.

Copyright and License

This software is (C) 2006 Arne Zellentin (zarne AT users DOT sf DOT net)
It is released under the terms of the GNU General Public License (GPL).

Last modified: Monday, 05-Feb-2007 01:47:54 CET

Valid HTML 4.01 Transitional