Re: Extract frame from wmv

2008-11-06 Thread Martin

Tim Golden wrote:

Martin wrote:

Lawrence D'Oliveiro wrote:
In message <[EMAIL PROTECTED]>, Tim 
Golden

wrote:


Alternatively, you might be able to commandline control
mencoder or ffmpeg itself to do this. Not sure, but there
must be *something* among those millions of command-line
options!


FFmpeg--yes!


Unfortunately it looks like I have the same problem as I do with 
pyglet - it's not support by my host.


It looks like I might have to process the files locally and then 
upload them. Painful.


Unless anyone else has any suggestions?



Well, since as far as I can see your host won't let you
install anything which isn't there already, you're down to
implementing a Python-only module to read a frame from a
.wmv. Which is, I would suggest, a not inconsiderable task.

Perhaps pre-filtering is the best solution after all.

TJG


Thanks Lawrence and Tim,

The irony is that I already have a Python only solution - it just 
requires 2.5!


I've actually worked out a way to extract and compress just the 
thumbnails from my local server and upload them without having to 
re-upload the video files (which took days) so I'm happy.


Thanks for the suggestions,

Martin
--
http://mail.python.org/mailman/listinfo/python-list


Re: Extract frame from wmv

2008-11-06 Thread Tim Golden

Martin wrote:

Lawrence D'Oliveiro wrote:
In message <[EMAIL PROTECTED]>, Tim 
Golden

wrote:


Alternatively, you might be able to commandline control
mencoder or ffmpeg itself to do this. Not sure, but there
must be *something* among those millions of command-line
options!


FFmpeg--yes!


Unfortunately it looks like I have the same problem as I do with pyglet 
- it's not support by my host.


It looks like I might have to process the files locally and then upload 
them. Painful.


Unless anyone else has any suggestions?



Well, since as far as I can see your host won't let you
install anything which isn't there already, you're down to
implementing a Python-only module to read a frame from a
.wmv. Which is, I would suggest, a not inconsiderable task.

Perhaps pre-filtering is the best solution after all.

TJG
--
http://mail.python.org/mailman/listinfo/python-list


Re: Extract frame from wmv

2008-11-06 Thread Martin

Lawrence D'Oliveiro wrote:

In message <[EMAIL PROTECTED]>, Tim Golden
wrote:


Alternatively, you might be able to commandline control
mencoder or ffmpeg itself to do this. Not sure, but there
must be *something* among those millions of command-line
options!


FFmpeg--yes!


Unfortunately it looks like I have the same problem as I do with pyglet 
- it's not support by my host.


It looks like I might have to process the files locally and then upload 
them. Painful.


Unless anyone else has any suggestions?

Martin
--
http://mail.python.org/mailman/listinfo/python-list


Re: Extract frame from wmv

2008-11-05 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Tim Golden
wrote:

> Alternatively, you might be able to commandline control
> mencoder or ffmpeg itself to do this. Not sure, but there
> must be *something* among those millions of command-line
> options!

FFmpeg--yes!
--
http://mail.python.org/mailman/listinfo/python-list


Re: Extract frame from wmv

2008-11-05 Thread Martin

Tim Golden wrote:

Martin wrote:

I've looked at Pymedia but I have to admit I couldn't work it out.

Commandline might be good, but I'm really hoping someone can point me 
in the right direction, as this is not my area of expertise.



Nor mine :) Just so people can help you out, can you
be more precise in your requirement? Do you want just
the first frame (eg to act as an img placeholder for
an embedded video). Or do you want to extract one or
more arbitrary frames, eg for screen cap purposes?

This page:

 http://stream0.org/2008/02/howto-extract-images-from-a-vi.html

looks helpful from the ffmpeg pov, but I assume you're
as capable of using Google as I am. I had a very quick
go with the copy of pymedia I have installed here, but
it couldn't read a (fairly recent) .wmv file so that
might be a problem in any case.

UPDATE: Just tried:

 ffmpeg -i bacardi.wmv -r 1 -f image2 images%05d.png

from that page and it produced useful stuff. Worth a try?

TJG


Thanks again Tim,

I'm just extracting the first frame to use as a thumbnail.

I will try ffmpeg. Thanks for pointer. I didn't really know where to 
start looking.


Martin
--
http://mail.python.org/mailman/listinfo/python-list


Re: Extract frame from wmv

2008-11-05 Thread Tim Golden

Martin wrote:

I've looked at Pymedia but I have to admit I couldn't work it out.

Commandline might be good, but I'm really hoping someone can point me in 
the right direction, as this is not my area of expertise.



Nor mine :) Just so people can help you out, can you
be more precise in your requirement? Do you want just
the first frame (eg to act as an img placeholder for
an embedded video). Or do you want to extract one or
more arbitrary frames, eg for screen cap purposes?

This page:

 http://stream0.org/2008/02/howto-extract-images-from-a-vi.html

looks helpful from the ffmpeg pov, but I assume you're
as capable of using Google as I am. I had a very quick
go with the copy of pymedia I have installed here, but
it couldn't read a (fairly recent) .wmv file so that
might be a problem in any case.

UPDATE: Just tried:

 ffmpeg -i bacardi.wmv -r 1 -f image2 images%05d.png

from that page and it produced useful stuff. Worth a try?

TJG
--
http://mail.python.org/mailman/listinfo/python-list


Re: Extract frame from wmv

2008-11-05 Thread Martin

Tim Golden wrote:

Martin wrote:
I need to extract a frame from a wmv file and save it as a jpg. In 
fact I need to extract a frame from each one of a collection of 
several thousand wmv files, but that's beside the point.


I've actually written a script that does exactly this using the pyglet 
module. But while it works fine on my local machine running Python 
2.5, my host is only on 2.4.3. They've installed pyglet for me, but it 
won't run without ctype, and they don't suport it.


Can anyone suggest an alternative way to achieve this using a module 
that will run on a standard 2.4.3 installation?


Pretty sure pymedia can do this kind of thing, possibly
with a bit of work.

http://pymedia.org/tut/src/dump_video.py.html

I used it recentlyish to do the reverse: combine a series
of still shots into a time-lapse movie.

Alternatively, you might be able to commandline control
mencoder or ffmpeg itself to do this. Not sure, but there
must be *something* among those millions of command-line
options!

TJG



Hi Tim,

I've looked at Pymedia but I have to admit I couldn't work it out.

Commandline might be good, but I'm really hoping someone can point me in 
the right direction, as this is not my area of expertise.


Thanks,

Martin
--
http://mail.python.org/mailman/listinfo/python-list


Re: Extract frame from wmv

2008-11-05 Thread Tim Golden

Martin wrote:
I need to extract a frame from a wmv file and save it as a jpg. In fact 
I need to extract a frame from each one of a collection of several 
thousand wmv files, but that's beside the point.


I've actually written a script that does exactly this using the pyglet 
module. But while it works fine on my local machine running Python 2.5, 
my host is only on 2.4.3. They've installed pyglet for me, but it won't 
run without ctype, and they don't suport it.


Can anyone suggest an alternative way to achieve this using a module 
that will run on a standard 2.4.3 installation?


Pretty sure pymedia can do this kind of thing, possibly
with a bit of work.

http://pymedia.org/tut/src/dump_video.py.html

I used it recentlyish to do the reverse: combine a series
of still shots into a time-lapse movie.

Alternatively, you might be able to commandline control
mencoder or ffmpeg itself to do this. Not sure, but there
must be *something* among those millions of command-line
options!

TJG

--
http://mail.python.org/mailman/listinfo/python-list


Extract frame from wmv

2008-11-05 Thread Martin

Hi,

I need to extract a frame from a wmv file and save it as a jpg. In fact 
I need to extract a frame from each one of a collection of several 
thousand wmv files, but that's beside the point.


I've actually written a script that does exactly this using the pyglet 
module. But while it works fine on my local machine running Python 2.5, 
my host is only on 2.4.3. They've installed pyglet for me, but it won't 
run without ctype, and they don't suport it.


Can anyone suggest an alternative way to achieve this using a module 
that will run on a standard 2.4.3 installation?


Thanks,

Martin

--
http://mail.python.org/mailman/listinfo/python-list