Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Mar 1999 14:51:48 +0100
From:      Jennifer Clark <jen@vulture.dmem.strath.ac.uk>
To:        multimedia@freebsd.org
Subject:   Re: off topic - video compression .avi -> .mov
Message-ID:  <3700D6F4.59484E52@vulture.dmem.strath.ac.uk>

next in thread | raw e-mail | index | archive | help
Hi,

I've been asked to contribute to this thread (by a colleague on this
list) since I did exactly what is stated in the topic a few days ago.
Here's how :-)

My plan was to extract every frame of a soundless AVI file, perform some
simple image processing on each frame, then compress the individual
frames into a mpeg file. The first step prove to be tricky; I had
initially hoped that xanim (from the graphics directory in ports) would
have an option to output individual frames as ppm files, for example,
but this did not appear to be the case. A bit of searching on the web,
however, turned up a patch to xanim that allows you to do exactly this.
You can download the patch from here:

   http://www4.informatik.uni-erlangen.de/~jnweiger/mpeg/mpeg.html

It says the patch is for xanim 2.70.64, but it seemed to work ok on
2.70.7.0. There is also a patch for extracting audio on this page,
although I have not used it.

Using the patched xanim, I extracted all the individual frames as ppm
files, which I further processed with the NetPBM package, also in
/usr/ports/graphics. The processing was fairly simple; each frame was
cropped, gamma corrected, sharpened, then scaled to an appropriate size.
I only came across one problem in this, that the netpbm program
pnmnlfilt, which can be used as a sharpening filter, bombed out with a
floating point exception. The problem was traced to the part of the code
which sets up the filter; essentially, it would attempt to set up a
filter to cope with images of greater than 8 bits per colour component
per pixel depth, which would result in it trying to use scaled integers
greater than INT_MAX or less than INT_MIN. A modification to only allow
images with a maximum of 8 bits per colour component fixed the problem.
I have a patch available for this if anyone wishes it.

Once I had batch processed all the individual frames with netpbm, I used
the program mpeg2encode from ports/graphics/mpeg2codec to convert all
the frames into an mpeg 1 movie. The scripts necessary to do this appear
complex, but using the examples in /usr/X11R6/share/mpeg2/ as templates
makes the exercise fairly trivial. While I have not compressed audio
into an mpeg video stream before, this does appear possible, using
/ports/graphics/mplex and /ports/audio/mpegaudio.

If anyone has any more questions on this, please email me directly as
I am not currently subscribed to this mailing list.

--
Jennifer Clark
http://telepresence.dmem.strath.ac.uk
http://www.crmjewellery.co.uk
http://www.furniturenet.co.uk





To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-multimedia" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3700D6F4.59484E52>