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
49e5426b
Commit
49e5426b
authored
Mar 30, 2023
by
mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
c
parent
7fee5366
Pipeline
#393
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
testVideo.py
testVideo.py
+16
-9
No files found.
testVideo.py
View file @
49e5426b
...
...
@@ -162,29 +162,36 @@ def video2comix(args):
frame_width
=
int
(
vc
.
get
(
cv2
.
CAP_PROP_FRAME_WIDTH
))
# height
frame_height
=
int
(
vc
.
get
(
cv2
.
CAP_PROP_FRAME_HEIGHT
))
print
(
'video w,h:'
,
str
(
frame_width
),
','
,
str
(
frame_height
))
print
(
'video
input
w,h:'
,
str
(
frame_width
),
','
,
str
(
frame_height
))
# fps
fps
=
int
(
vc
.
get
(
cv2
.
CAP_PROP_FPS
))
print
(
'video fps:'
,
str
(
fps
))
print
(
'video input fps:'
,
str
(
fps
))
# total frames num
numFrames
=
int
(
vc
.
get
(
cv2
.
CAP_PROP_FRAME_COUNT
))
print
(
'video input total Frames num:'
,
str
(
numFrames
))
# target coim fps
fps_flow
=
int
(
args
.
fps
)
# fps / 2
print
(
'video output fps:'
,
str
(
fps_flow
))
# total frames num
numFrames
=
int
(
vc
.
get
(
cv2
.
CAP_PROP_FRAME_COUNT
))
print
(
'video total Frames num:'
,
str
(
numFrames
))
step
=
fps
/
fps_flow
#根据fps算要跳几帧,比如:24fpx/5fpx=4,即每4帧读取下,1秒大概读取4~5帧
totalNumFrames
=
int
(
numFrames
/
step
)
print
(
'video output total Frames num:'
,
str
(
totalNumFrames
))
if
args
.
start_seconds
!=
0
:
readFrameNum
=
int
(
args
.
start_seconds
*
fps
)
print
(
'video output capture start sedonds:'
,
args
.
start_seconds
,
', start frames num:'
,
str
(
totalNumFrames
))
if
args
.
total_seconds
!=
0
:
totalNumFrames
=
int
(
args
.
total_seconds
*
fps_flow
)
print
(
'video output total seconds:'
,
str
(
args
.
total_seconds
))
else
:
print
(
'video output total seconds:'
,
str
(
int
(
numFrames
/
fps
)
-
args
.
start_seconds
))
print
(
'video output total Frames num:'
,
str
(
totalNumFrames
))
if
args
.
start_seconds
!=
0
:
readFrameNum
=
int
(
args
.
start_seconds
*
fps
)
# MPEG can not play in web
...
...
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