⚲
Projet
Général
Profil
Connexion
S'enregistrer
Accueil
Projets
Aide
Recherche
:
Polytech Ge Sous Traitance
Tous les projets
Polytech Projets Ge
»
Polytech Ge Sous Traitance
Aperçu
Activité
Roadmap
Demandes
Gantt
Calendrier
Annonces
Documents
Wiki
Fichiers
Dépôt
Télécharger (623 octets)
Support #14557
» opencvSlowMo.py
fichier python pour enregistrer un video en ralenti -
Marouane SOBTI
, 22/11/2022 16:14
import
numpy
as
np
import
cv2
as
cv
cap
=
cv
.
VideoCapture
(
0
)
# Define the codec and create VideoWriter object
fourcc
=
cv
.
VideoWriter_fourcc
(
*
'DIVX'
)
out
=
cv
.
VideoWriter
(
'output.avi'
,
fourcc
,
1
,
(
640
,
480
))
while
cap
.
isOpened
():
ret
,
frame
=
cap
.
read
()
if
not
ret
:
print
(
"Can't receive frame (stream end?). Exiting ..."
)
break
#frame = cv.flip(frame, 0)
# write the flipped frame
out
.
write
(
frame
)
cv
.
imshow
(
'frame'
,
frame
)
if
cv
.
waitKey
(
1
)
==
ord
(
'q'
):
break
# Release everything if job is finished
cap
.
release
()
out
.
release
()
cv
.
destroyAllWindows
()
« Précédent
1
2
3
Suivant »
(1-1/3)
Chargement...