0

My simplified codes:

fource = cv2.VideoWriter_fourcc(*'XVID')
resulte = cv2.VideoWriter('vidname.avi', fourcc, 200, (720, 540))
while record:
    image = retrieve frame from camera with pypylon
    resulte.write(image)
resulte.release()

I met the following problems (from time to time):

  1. The saved video misses the video info (video-length etc.)
  2. The saved video has the video-length info (e.g. 3:32:16, which can be played full length by media players (I use VLC)), but when I use OpenCV VideoCapture to read that video, the video-length becomes much smaller (e.g. 0:37:12). The latter part of the video is unreachable by VideoCapture whereas can be played by media players (VLC). I assume the problem lies in VideoWriter.

My thoughts:

  1. The above problems do not always occur;
  2. I assume the un-execution of "resulte.release()" causes that problem, but I conclude not.
  3. I have 4 cameras running at a same time at 200 fps. I therefore have 4x2 processes for those 4 cameras and grab/save operations. I am not sure if this causes the problem.
  4. I use ".avi" for video codec, I am not sure if this causes the problem (e.g. the decoding problem for .avi).
  5. Codes are runned on Ubuntu 20.04

0 Answers0