FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
opencv_tutorials/python/code_012/opencv_012.py at master · HZHCoder1990/opencv_tutorials · GitHub
HZHCoder1990
/
opencv_tutorials
Public
forked from
JimmyHHua/opencv_tutorials
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
opencv_tutorials
/
python
/
code_012
/
opencv_012.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
28 lines (23 loc) · 734 Bytes
Breadcrumbs
opencv_tutorials
/
python
/
code_012
/
opencv_012.py
Copy path
File metadata and controls
28 lines (23 loc) · 734 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import
cv2
as
cv
import
numpy
as
np
capture
=
cv
.
VideoCapture
(
"./test.avi"
)
# capture = cv.VideoCapture(0) 打开摄像头
height
=
capture
.
get
(
cv
.
CAP_PROP_FRAME_HEIGHT
)
width
=
capture
.
get
(
cv
.
CAP_PROP_FRAME_WIDTH
)
count
=
capture
.
get
(
cv
.
CAP_PROP_FRAME_COUNT
)
fps
=
capture
.
get
(
cv
.
CAP_PROP_FPS
)
print
(
height
,
width
,
count
,
fps
)
out
=
cv
.
VideoWriter
(
"./test_cp.avi"
,
cv
.
VideoWriter_fourcc
(
'D'
,
'I'
,
'V'
,
'X'
),
15
,
(
np
.
int
(
width
),
np
.
int
(
height
)),
True
)
while
True
:
ret
,
frame
=
capture
.
read
()
if
ret
is
True
:
cv
.
imshow
(
"video-input"
,
frame
)
out
.
write
(
frame
)
c
=
cv
.
waitKey
(
50
)
if
c
==
27
:
# ESC
break
else
:
break
capture
.
release
()
out
.
release
()
Back
|
FazBrowse Home
|
New Git URL