ffmpeg and python big problem

Rhodri James rhodri at wildebst.demon.co.uk
Thu May 21 20:38:04 EDT 2009


On Thu, 21 May 2009 22:48:33 +0100, TerabyteST <gabrycir at gmail.com> wrote:

> Hello. I am trying to make a video from images shot by my webcam in
> python. I use a module I found on the net (here
> http://osdir.com/ml/python.matplotlib.general/2005-10/msg00145.html )
> but, even if I think I am doing everything correctly, what I only get
> is a grey video with some multi-color squares on the top-left bit...

Obvious starter question: do you have ffmpeg properly compiled for
Windows (i.e. using Cygwin or MinGW)?

> I
> don't think it's a problem with ffmpeg because I tried with two
> different versions.

This is not a guarantee.  ffmpeg is wonderful when it works, and a
total pig when it doesn't.  Sometimes it's big and obvious about
not working and seg-faults on you, and sometimes it just does
something completely implausible with the information you give
it.

> Not even with the codec: i tried wmv, mpg, avi and
> everything, but still the same result.

The output vcodec doesn't matter as much as the input vcodec,
which is mjpeg.  I think webcams are mjpeg devices, but I've
never used one so I'm not sure.

> Last thing left,
> IMO, is the module, but I can't seem to find whats the problem... Is
> it because the module was (maybe) made on Linux and I'm working on
> windows? If you would help me I'd be so glad!

I'm not nearly so worried about the module being written on Linux as
ffmpeg.  The module is full of bad practice, but it doesn't do
anything os-specifically bad.

There is one further thing to check: your code that uses the module.
How do you feed data from the webcam to the VidStream object?  If
you're creating intermediate files of webcam stuff, please say
what they are and how they came to be.

I have to admit, if you've got images from your webcam in a file
already, I don't see why you aren't using ffmpeg directly.

> This program is for my friend and he needs it ready preety quick.

Aha. Ahahahahahahahaha.

Ahem.

Sorry, but "pretty quick" and "ffmeg" don't go together well in
my experience.

-- 
Rhodri James *-* Wildebeeste Herder to the Masses



More information about the Python-list mailing list