Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > ffmpeg and python big problem

Reply
Thread Tools

ffmpeg and python big problem

 
 
TerabyteST
Guest
Posts: n/a
 
      05-21-2009
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.matplotli.../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... I
don't think it's a problem with ffmpeg because I tried with two
different versions. Not even with the codec: i tried wmv, mpg, avi and
everything, but still the same result. And also, my webcam does the
capture right because if I check the image it's OK. 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!
This program is for my friend and he needs it ready preety quick.

Thank you!
 
Reply With Quote
 
 
 
 
Emile van Sebille
Guest
Posts: n/a
 
      05-21-2009
On 5/21/2009 2:48 PM TerabyteST said...
> 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.matplotli.../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... I
> don't think it's a problem with ffmpeg because I tried with two
> different versions. Not even with the codec: i tried wmv, mpg, avi and
> everything, but still the same result. And also, my webcam does the
> capture right because if I check the image it's OK. 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!
> This program is for my friend and he needs it ready preety quick.


Why not use mencoder directly? Last time I did this I used Python to
organize the shots and mencoder to create the video...

Emile

 
Reply With Quote
 
 
 
 
Rhodri James
Guest
Posts: n/a
 
      05-22-2009
On Thu, 21 May 2009 22:48:33 +0100, TerabyteST <(E-Mail Removed)> 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.matplotli.../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
 
Reply With Quote
 
Rhodri James
Guest
Posts: n/a
 
      05-22-2009
On Fri, 22 May 2009 13:54:26 +0100, TerabyteST <(E-Mail Removed)> wrote:

> Could you give me a link to a version that "works"?


Not with any confidence. The ffmpeg website (http://www.ffmpeg.org)
has a link to this page (http://ffmpeg.arrozcru.org/) which seems to
have binaries on it, but I don't use Windows so I have no idea if
they actually work or not.

> For putting the data in the stream I save bmp stills from the webcam
> and then use the write function giving the name of the file.


You don't believe in making life easy for yourself, do you?
Why are you turning stills into a video anyway? Wouldn't it be easier
to save the webcam output as video (whatever format it claims to be)
and get ffmpeg to work on it directly?

> @Emile: if I can access MEncoder from python and give it the images
> one by one, using a stream like i'm doing in ffmpeg, or telling it a
> sequence to make a video from, I could try it.


You seem to have emailed me directly, not the list. I've copied this
back to the list so Emile can see it too.

--
Rhodri James *-* Wildebeeste Herder to the Masses
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GIDS 2009 .Net:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf ASP .Net 0 12-26-2008 09:29 AM
GIDS 2009 .Net:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf ASP .Net Web Controls 0 12-26-2008 06:11 AM
GIDS 2009 Java:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf Python 0 12-24-2008 07:35 AM
GIDS 2009 Java:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf Ruby 0 12-24-2008 05:07 AM
Python wrapper to ffmpeg and speex maxwell hammer Python 0 01-17-2004 06:22 AM



Advertisments