Story: Hello I am Jayson - I want to use a double sided twin camera on a cell phone to record front and back on my surfboard, right now i am using background record. One sided. I use an ip68 cam in a bag with a mount here in so cal surfing and well, i want it to be double sided footage sooooo…
Goal: surf with a recording in progress double sided and a blank screen. two 720x720 make for 720x1440
Linux Code: Includes GTK that android has a tough time supporting…soo i cut it out for the blank screen android final product…
import cgitb
cgitb.enable()
import cv2
import numpy as np
cap = cv2.VideoCapture(0)
cap1 = cv2.VideoCapture(1)
out = cv2.VideoWriter(‘output.mp4’,cv2.VideoWriter_fourcc(*‘H264’), cap.get(cv2.CAP_PROP_FPS), (1440,720))
while(cap.isOpened()):
ret, frame = cap.read()
ret1, frame1 = cap1.read()
if ret == True:
print (frame)
both = np.column_stack((frame, frame1))
out.write(both)
cv2.imshow('Frame', both)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
else:
break
cap.release()
cap1.release()
out.release()
cv2.waitKey(0)
cv2.destroyAllWindows()
Android Code: with out GTK gui preview pane
import cgitb
cgitb.enable()
import cv2
import numpy as np
cap = cv2.VideoCapture(0)
cap1 = cv2.VideoCapture(1)
out = cv2.VideoWriter(‘output.mp4’,cv2.VideoWriter_fourcc(*‘H264’), cap.get(cv2.CAP_PROP_FPS), (1440,720))
while(cap.isOpened()):
ret, frame = cap.read()
ret1, frame1 = cap1.read()
if ret == True:
print (frame)
both = np.column_stack((frame, frame1))
out.write(both)
cv2.imshow('Frame', both)
cap.release()
cap1.release()
out.release()
Issue: working toward android having opencv in termux and it CURRENTLY SAVES AN EMPTY VIDEO??? any help would be greatly appreciated…