Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' #581

Open
iitdpooja opened this issue Oct 15, 2021 · 0 comments

Comments

@iitdpooja
Copy link

I am trying to put two videos in a single frame.
But I am getting Type Error. Please check below code.

import cv2
import numpy as np
cap1=cv2.VideoCapture('first.avi')
cap2=cv2.VideoCapture('fourth.avi')
fps = cap1.get(cv2.CAP_PROP_FPS)
global Video_h
global Video_w
Video_h = cap1.get(cv2.CAP_PROP_FRAME_HEIGHT)
Video_w = cap1.get(cv2.CAP_PROP_FRAME_WIDTH)
while (True):
frame=np.zeros([int(2Video_h),int(3Video_w),3], dtype=np.uint8)
ret,frame1=cap1.read()
ret,frame2=cap2.read()
frame[0:int(Video_h),0:int(Video_w)] = frame1
frame[0:int(Video_h),int(Video_w)-200:int(Video_w*2)-200] = frame2
cv2.namedWindow("window", cv2.WND_PROP_FULLSCREEN)
#cv2.setWindowProperty("window",cv2.WND_PROP_FULLSCREEN,cv2.WINDOW_FULLSCREEN)
cv2.imshow("window", frame)
if cv2.waitKey(1) & 0xff == ord('q'):
break

below error is coming:
Traceback (most recent call last):
File "c:/Users/shiva/Documents/Python/test.py", line 15, in
frame[0:int(Video_h),int(Video_w)-200:int(Video_w*2)-200] = frame2
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant