Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
animegan2-pytorch
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
git
animegan2-pytorch
Commits
c82d0178
Commit
c82d0178
authored
Mar 29, 2023
by
mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
total
parent
a7a18209
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
testVideo.py
testVideo.py
+13
-2
No files found.
testVideo.py
View file @
c82d0178
...
...
@@ -103,17 +103,24 @@ def video2comix(args):
print
(
'video open status:'
,
vc
.
isOpened
())
# 获取视频宽度
frame_width
=
int
(
cv2
.
get
(
cv2
.
CAP_PROP_FRAME_WIDTH
))
frame_width
=
int
(
vc
.
get
(
cv2
.
CAP_PROP_FRAME_WIDTH
))
# 获取视频高度
frame_height
=
int
(
cv2
.
get
(
cv2
.
CAP_PROP_FRAME_HEIGHT
))
frame_height
=
int
(
vc
.
get
(
cv2
.
CAP_PROP_FRAME_HEIGHT
))
print
(
'video w,h:'
,
str
(
frame_width
),
','
,
str
(
frame_height
))
#total frames num
numFrames
=
int
(
vc
.
get
(
cv2
.
CAP_PROP_FRAME_COUNT
))
print
(
'video total Frames num:'
,
str
(
numFrames
))
# fps
fps
=
vc
.
get
(
cv2
.
CAP_PROP_FPS
)
print
(
'video fps:'
,
str
(
fps
))
# target coim fps
fps_flow
=
args
.
fps
# fps / 2
print
(
'video fps:'
,
str
(
fps_flow
))
# MPEG can not play in web
fourcc
=
cv2
.
VideoWriter_fourcc
(
*
"H264"
)
wh
=
(
frame_width
,
frame_height
)
...
...
@@ -128,6 +135,10 @@ def video2comix(args):
while
vc
.
isOpened
():
vc
.
set
(
cv2
.
CAP_PROP_POS_FRAMES
,
n
)
# 截取指定帧数
n
=
n
+
step
#跳帧
if
n
>=
numFrames
:
print
(
'video2comix - read frame is over'
)
break
su
,
frame
=
vc
.
read
()
if
frame
is
None
:
print
(
'video2comix - read frame is none'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment