Encoding Videos for iPhone and Xbox 360

The following is a foolproof process for converting video’s from many formats to a format compatible with the iPhone and Xbox 360. I primarily use this method

  • archive recordings from my Tivo HD
  • converting xvid videos to be compatible with my iPhone
  • shinking large format mpeg or mpeg2 to lower size files without losing too much quality.

You will need to ensure you have the following installed

a) ffmpeg – ffmpeg with h264 and libfaac compiled in.
b) Encoding Script –  Encoder.bat (Right click link and Save As) Put this file in the same directory as your video files

If ffmpeg is not at the above address I think google will be able to help you out. You need one with the libfaac library compiled into it. Also there are a few other video conversion software projects that install a recent version of ffmpeg. Just install them and copy out the ffmpeg directory. If there is an error then that version of ffmpeg is not compatible.

This Encoder file was setup to convert a TivoHD video extracted from the Tivo and converted to mpeg2 format. This script will not convert .tivo files directly. For information on how to extract your files from the Tivo HD and convert to mpeg2 for use in the script below please try one of the following

  • Tivo Desktop – Tivo’s solution to extraction of recordings
  • tivodecode (for native TivoHD/S3 .tivo files requires a MAK key)
  • s3tots (for modded TivoHD with NoCSR patch).
  • VideoRedo(usefull for cutting out unwanted portions of the video before conversion to mpeg2)

I digress this post is about encoding not how to remove recordings from a Tivo.

First step is to obtain the relevant software.

  1. Download and install FFmpeg
  2. Open up Encoder.bat
    Edit these lines to match your chosen encryption bitrates and installation directories
    set ffmpeg_video_bitrate=512
    set ffmpeg_max_video_bitrate=768
    set ffmpeg_audio_bitrate=128
    set ffmpeg_path=D:\VideoShare\Tivo\Encoders
  3. Optionally comment out the following line if you do not want to perform cropping and scaling
    REM set ffmpeg_cropping=-s 624×352 -aspect 1.77777
    (Note: cropping should be done BEFORE the scaling)
  4. Optionally uncomment this line to force your mp4 to be in 16:9 format (Don’t think this is needed)
  5. Once that has been completed just drag and drop the video files you wish to convert ontop of the batch file in windows explorer. The script can handle dropping of multiple files at once.
    FFmpeg is also capable of converting from many formats

This is a 2 pass encoding method and will take some time but it is definitely worth the effort.

You will be left with your original video file and the encoded mp4 file.

Tags: , , , , , , ,

Leave a Reply