
Recherche avancée
Médias (1)
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (55)
-
Les vidéos
21 avril 2011, parComme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...) -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Possibilité de déploiement en ferme
12 avril 2011, parMediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)
Sur d’autres sites (7911)
-
OpenCV returns an Array of All Zeros on video.read
19 janvier 2020, par Ikechukwu AnudeBelow is the relevant code
import cv2 as cv
import numpy as np
video = cv.VideoCapture(0) #tells obj to use built in camera\
#create a face cascade object
face_cascade =
cv.CascadeClassifier(r"C:\Users\xxxxxxx\AppData\Roaming\Python\Python36\site-
packages\cv2\data\haarcascade_frontalcatface.xml")
a = 1
#create loop to display a video
while True:
a = a + 1
check, frame = video.read()
print(frame)
#converts to a gray scale img
gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
#create the faces
faces = face_cascade.detectMultiScale(gray, scaleFactor=1.5, minNeighbors=5)
for(x, y, w, h) in faces:
print(x, y, w, h)
#show the image
cv.imshow('capturing', gray)
key = cv.waitKey(1) #gen a new frame every 1ms
if key == ord('q'): #once you enter 'q' the loop will be exited
break
print(a) #this will print the number of frames
#captures the first frame
video.release() #end the web cam
#destroys the windows when you are not defined
cv.destroyAllWindows()The code displays a video captured from my webcam camera. Despite that, OpevCV doesn’t seem to be processing any frames as all the frames look like this
[[0 0 0]
[0 0 0]
[0 0 0]
...
[0 0 0]
[0 0 0]
[0 0 0]]]which I assume means that they are empty.
This I believe is preventing the algorithm from being able to detect my face in the frame. I have a feeling that the issue lies in the ffmpeg codec, but I’m not entirely sure how to proceed even if that is the case.
OS : Windows 10
Language : PythonEDIT : The Frame is not empty but all the values in the array seem to be ’0’
Why is the frame empty and how can I get OpenCV to detect my face in the frame ?
-
Pipe PyQt Widget Images to ffmpeg
31 octobre 2014, par throwaway17434I have a PyQt Window with widgets that change. I want to make a video of it. I found this Answere to be very useful, however it is does not seem to be possible to use subprocess PIPE as a target in QtGui.QPixmap’s save-method. I have the feeling that I should use the native QtProcess for this kind of work, but I don’t know how I can PIPE the images and I can’t see the errors because I can’t see the standard outpur/error either. What I want to do is something like this :
from PyQt4 import QtGui, QtCore
import random
app = QtGui.QApplication([])
win = QtGui.QWidget()
layout = QtGui.QGridLayout()
win.setLayout(layout)
#picture frame
scene = QtGui.QGraphicsScene()
canvas = QtGui.QGraphicsView(scene)
layout.addWidget(canvas,0,0)
# start button
def run():
# set pen
pen = QtGui.QPen(QtCore.Qt.red)
size = canvas.size()
# start seperate process
process = QtCore.QProcess(app)
process.start('ffmpeg',['-y', '-f', 'image2pipe', '-vcodec', 'mjpeg', '-r', '24', '-i', '-', '-vcodec', 'mpeg4', '-qscale', '5', 'video.avi'])
for i in range(100):
x = random.randint(1, size.width()-1)
y = random.randint(1, size.height()-1)
scene.addLine(x,y,x,y, pen=pen)
QtGui.QPixmap.grabWidget(win).save(process, "jpeg")
but_run = QtGui.QPushButton("Go!")
but_run.clicked.connect(run)
layout.addWidget(but_run,1,0)
win.show()
app.exec_() -
Pipe PyQt Widget Images to ffmpeg
10 février 2024, par throwaway17434I have a PyQt Window with widgets that change. I want to make a video of it. I found this Answer to be very useful, however it is does not seem to be possible to use subprocess PIPE as a target in QtGui.QPixmap's save-method. I have the feeling that I should use the native QtProcess for this kind of work, but I don't know how I can PIPE the images and I can't see the errors because I can't see the standard outpur/error either. What I want to do is something like this :


from PyQt4 import QtGui, QtCore
import random

app = QtGui.QApplication([])
win = QtGui.QWidget()
layout = QtGui.QGridLayout()
win.setLayout(layout)

#picture frame
scene = QtGui.QGraphicsScene()
canvas = QtGui.QGraphicsView(scene)
layout.addWidget(canvas,0,0)

# start button
def run():
 # set pen
 pen = QtGui.QPen(QtCore.Qt.red)
 size = canvas.size()
 
 # start seperate process
 process = QtCore.QProcess(app)
 process.start('ffmpeg',['-y', '-f', 'image2pipe', '-vcodec', 'mjpeg', '-r', '24', '-i', '-', '-vcodec', 'mpeg4', '-qscale', '5', 'video.avi'])
 for i in range(100):
 x = random.randint(1, size.width()-1)
 y = random.randint(1, size.height()-1) 
 scene.addLine(x,y,x,y, pen=pen)
 QtGui.QPixmap.grabWidget(win).save(process, "jpeg")
 
but_run = QtGui.QPushButton("Go!")
but_run.clicked.connect(run)
layout.addWidget(but_run,1,0)

win.show()
app.exec_()