Home » Blog
date 21.Apr.2024

■ Android TV cannot play old AVI video? Convert it!

We recently bought a new television, and it is so "smart" that will not play old AVI movies in my collection — and I love my old movies! Smart TVs are internet enabled computers running Android OS, so you'd have thought possible to install a codec pack or something and sort out AVI like you do on a PC, but apparently that's not an option (?)

One possible solution is to install another player like VLC media player, which has its own set of codecs, but you will only be postponing the inevitable AVI demise. However as we'll see it is very easy to convert AVI to MP4, and in the meantime you save lots of space as MP4 encoded movies are half the size of the equivalent AVI!

The first step is to download and install (on your PC or laptop) the universal media swiss knife FFmpeg. The command line to do the conversion is ridiculously simple; use -i switch for the source file and change the extension to convert:

  ffmpeg -i old_movie.AVI old_movie.MP4

If you only need to convert a couple of movies, you can do it manually with a DOS console, but if you have lots of AVI then you can take advantage of xplorer² batch execution function and do all the conversions in one go. If you are not very familiar with old school command line processing, you have to be careful with the paths (locations) of your files and FFmpeg.exe executable itself. Let's say you have installed FFmpeg in C:\TOOLS folder, then to run it from the command line you must type its full path as C:\TOOLS\ffmpeg (the .EXE part can be omitted)

Old hands will take advantage of %PATH% environmental variable

Then comes the location of the AVI video files to be converted. Are they in a single folder or spread out in many locations? The former is simpler, as you just browse the container folder, select the AVI using a wildcard, and create a batch script for them. But I'll demonstrate the latter more general case, where AVIs are in multiple folders. Step by step:

  1. Gather files. Use xplorer² search command to find all AVI files (typically on the USB drive you connect to your TV), using a simple wildcard like *.AVI.
  2. Generate script.
    Switch to the search results window that shows the AVI files, and select everything with <CTRL+A> keys, then use Tools > Command script menu command, typing this command template:
       C:\TOOLS\ffmpeg -i "$F" "$P\$B.MP4"

    This command will be executed for each selected file, replacing the special $-tokens with parts of the current file, e.g. it may look like:
     C:\TOOLS\ffmpeg -i "E:\path to\old_movie.AVI" "E:\path to\old_movie.MP4"
    If you follow the colors you will see how the full path $F and the base name $B were replaced. If you don't understand the template, just trust me and type it verbatim <g> — using the correct path where you have installed ffmpeg. Use the Preview button in the script wizard dialog (see right) to check your command.

    If ffmpeg was smarter, you could use just $B.MP4 as the output token, but then it would save the converted file in %TEMP% folder (!) — hence the use of full output path $P token to save the MP4 in the same folder as its original AVI. Also note how we enclose all tokens in "quotes" since paths may contain spaces, the scourge of command line.

    script wizard
  3. Do the conversion. As ffmpeg doesn't have GUI you must click Execute DOS button to start the script. The conversion will go one file at a time, and quite slowly unfortunately. On my laptop ffmpeg achieved a speed of ~5x, so a movie of 90 minutes will take ~18 min to convert. If you have a lot to convert, you better leave it as an overnight task! (you don't need to babysit it). Each MP4 will be saved in the same folder as its AVI
  4. Delete old files. Next morning you can (optionally) delete the old converted AVIs, so as you have them conveniently all together in the search results window and selected, you can remove them and save the space using File > Delete menu command.

Now your movie collection is future proof... until such time that MP4 goes to meet AVI and FLV in the video format graveyard!

Post a comment on this topic »

©2002-2024 ZABKAT LTD, all rights reserved | Privacy policy | Sitemap