Re: [pymecavideo] revision 300, opencv |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/pymecavideo Archives
]
- To: pymecavideo@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [pymecavideo] revision 300, opencv
- From: Jean-Baptiste BUTET <ashashiwa@xxxxxxxxx>
- Date: Wed, 22 Dec 2010 11:30:06 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=3jD8lyM4rqdXJFgKWVcr2hzDSAMNOmQPIe1K9J4QoVw=; b=KNgCa3Bm8ypVCAn8dkgA/gbFatzZlJaybyedrucXLoesOks7r6TR8KHmleoCpLXS5O HfiJfhmQbuyLtuDrOpb5eJ+K6JkXymG14Qjk6LbaiGody8bekBmElk4BfFOV0oZzyUHn grTD36fXoeg+rtIMx/DrEcBb2dzQ/cNLZhKNE=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=M+jJqlCG/OfYRne74M3Bx1CgLdvALjwL1s896mB7nwnHYIJfd3AO1FR0n9hay6KdyS gv59+0p31GoWcAvGdH63fLATFxjBng5aFVc/tniP6yHJK3F+7cFw87UgzlOmzUFqPUTs zdhy9hob5+F/mMMp3WS1H0fDn4BqXSnvM/Iqc=
mmm.....
Je ne comprends pas trop le décalage (NB : je n'ai pas encore regardé le code)
Par contre, j'ai regardé si, avec python et Highgui, il avait des
problèmes pour visualiser les ogv.
Voici le bout de code correspondant en pièce jointe. Vous devez
changer, bien sûr, le chemin du fichier. (ligne 17)
A priori, il n'a pas de problèmes pour lire le film. Je vais aller un
peu plus loin tout à l'heure pour savoir si il a des problèmes pour
"se déplacer" dans le film et afficher les trames.
A+
JB
# -*- coding: utf-8 -*-
import sys
import cv
if __name__ == "__main__":
print "Press ESC to exit ..."
# create windows
cv.NamedWindow('Camera', cv.CV_WINDOW_AUTOSIZE)
# create capture device
device = 0 # assume we want first device
#capture = cv.CaptureFromFile("/media/disk/DCIM/100MEDIA/FILE0004.MOV")
#capture = cv.CaptureFromFile("/media/disk/DCIM/100MEDIA/FILE0003.MOV")
capture = cv.CaptureFromFile("/home/jb/Compil/pymecavideo_svn/pymecavideo/trunk/data/video/Effet_force_magnetique.ogv")
framerate = cv.GetCaptureProperty(capture,cv.CV_CAP_PROP_FPS)
nb_image = str(cv.GetCaptureProperty(capture,cv.CV_CAP_PROP_FRAME_COUNT))
##test symétrie
l = len(nb_image)
pb = False
if l>5 and l%2 == 0:
pb = True
for i in range(l/2-1):
#print nb_image[i], nb_image[len(str(nb_image))/2+i-1]
pb = pb * nb_image[i]==nb_image[len(str(nb_image))/2+i-1]
if pb :
nb_image = nb_image[0:len(str(nb_image))/2-1]
print framerate, nb_image, pb
# check if capture device is OK
if not capture:
print "Error opening capture device"
sys.exit(1)
while 1:
# do forever
# capture the current frame
frame = cv.QueryFrame(capture)
if frame is None:
break
# mirror
# face detection
# display webcam image
cv.SetCaptureProperty(capture, cv.CV_CAP_PROP_FRAME_WIDTH, 640)
cv.SetCaptureProperty(capture, cv.CV_CAP_PROP_FRAME_HEIGHT, 480)
cv.ShowImage('Camera', frame)
# handle events
k = cv.WaitKey(10)
if k == 0x1b: # ESC
print 'ESC pressed. Exiting ...'
break
- References:
- [pymecavideo] revision 300, opencv
- Re: [pymecavideo] revision 300, opencv
- From: Jean-Baptiste BUTET
- Re: [pymecavideo] revision 300, opencv
- Re: [pymecavideo] revision 300, opencv
- From: Jean-Baptiste BUTET
- Re: [pymecavideo] revision 300, opencv
- Re: [pymecavideo] revision 300, opencv
- From: Jean-Baptiste BUTET
- Re: [pymecavideo] revision 300, opencv
- Re: [pymecavideo] revision 300, opencv
- From: Jean-Baptiste BUTET
- Re: [pymecavideo] revision 300, opencv
- Re: [pymecavideo] revision 300, opencv
- From: Jean-Baptiste BUTET
- Re: [pymecavideo] revision 300, opencv
- From: Jean-Baptiste BUTET
- Re: [pymecavideo] revision 300, opencv
- From: Jean-Baptiste BUTET
- Re: [pymecavideo] revision 300, opencv
- From: Jean-Baptiste BUTET