Commit 49e5426b authored by mac's avatar mac

c

parent 7fee5366
Pipeline #393 failed with stages
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment