Convert old AVI files to a modern format
Posted
by
iWerner
on Ask Ubuntu
See other posts from Ask Ubuntu
or by iWerner
Published on 2011-01-11T10:15:32Z
Indexed on
2011/01/11
10:59 UTC
Read the original article
Hit count: 326
video
|conversion
Hi, we have a collection of old home videos that were saved in AVI format a long time ago. I want to convert these files to a more modern format because the Totem Movie Player that comes with Ubuntu 10.4 seems to be the only program capable of playing them.
The files seem to be encoded with a MJPEG codec, and playing them in VLC or Windows Media Player plays only the sound but there is no video.
Avidemux was able to open the files, but the quality of the video is severely degraded: The video skips frames and is interlaced (it's not interlaced when playing it in Totem).
Neither ffmpeg nor mencoder seems to be able to read the video stream. mencoder reports that it is using ffmpeg's codec. Here's a section from its output:
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
[mjpeg @ 0x92a7260]mjpeg: using external huffman table
[mjpeg @ 0x92a7260]mjpeg: error using external huffman table, switching back to internal
Unsupported PixelFormat -1
Selected video codec: [ffmjpeg] vfm: ffmpeg (FFmpeg MJPEG)
while running ffmpeg
produces the following:
$ ffmpeg -i input.avi output.avi
FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --extra-version=4:0.5.1-1ubuntu1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 1 / 52.20. 1
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 4. 0 / 0. 4. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Mar 4 2010 12:35:30, gcc: 4.4.3
[avi @ 0x87952c0]non-interleaved AVI
Input #0, avi, from 'input.avi':
Duration: 00:00:15.24, start: 0.000000, bitrate: 22447 kb/s
Stream #0.0: Video: mjpeg, yuvj422p, 720x544, 25 tbr, 25 tbn, 25 tbc
Stream #0.1: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
Output #0, avi, to 'output.avi':
Stream #0.0: Video: mpeg4, yuv420p, 720x544, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream #0.1: Audio: mp2, 44100 Hz, stereo, s16, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 0 fps= 0 q=0.0 Lsize= 143kB time=15.23 bitrate= 76.9kbits/s
video:0kB audio:119kB global headers:0kB muxing overhead 20.101777%
So the problem is that output does not contain any video, as evidenced by the video:0kB
at the end.
In all of the above cases the audio comes out fine.
So my question is: What can I do to convert these files to a more modern format with more modern codecs?
© Ask Ubuntu or respective owner