1

I am recording a video stream from my camera and this is what the feed looks like? The moving objects seem to be cut and just show an overall weird behavior. What could cause this phenomenon?

Decreasing the frame rate appears to fix the problem to a certain extent. I am not sure why!

anonymous
  • 136
  • 3
  • 1
    **(1)** You need to use a **better encoder**... Is it H264/MP4 that you are outputting? It looks like it. Basically H.264 codec will **divide** the frame/image into slices, usually 3 (as top, middle, bottom segments of the frame/image). From what I'm seeing: it looks like the slices aren't updating properly per each frame change. There's looped slice contents like the encoder was somehow **re-writing** the same slice data. Maybe a `While` loop is responsible in your code? **(2)** How to recreate that effect? I have one or two creative ideas for it being used as an [artistic] visual effect... – VC.One Apr 26 '23 at 19:42
  • 1
    To answer your second question, I am using an allied vision camera and the Vimba python API to stream images from the camera. OpenCV is used for visualization. – anonymous Apr 26 '23 at 20:55
  • 1
    I guess you are writing old frames in between. Can you shiw your code? Maybe try setting pixel values to 0 after writing a frame to file. If you rhen see black flickering you are writing old frames again instead of new ones. – Micka Apr 26 '23 at 21:06
  • 1
    In c++ vimba sdk gives you info about erroneous frames (I think transmission errors). If python vimba sdk also gives that information you should make sure that you drop erroneous frames. Also try deep coying the frames before video-writing, because vimba might overwrite pixel memory while you are writing. – Micka Apr 26 '23 at 21:09
  • 1
    @anonymous Your file is encoded using MPEG's **Simple Profile**. You likely want an encoding with an H264 Profile like **Main** or **High**. Did you use OpenCV to encode? If yes, did you use a FOUR_CC setting like `mp4v`? If yes then try using `avc1` instead and also save into an MP4 filename (not as AVI). See if that solves the problem? – VC.One Apr 27 '23 at 18:48
  • I see no reason to question the video encoder or suggest using "a better encoder" for this screen recording. that looks like glitches from the camera or its driver. no common video codec would cause such issues. according to OP, this glitching is already visible in the camera preview, which doesn't involve any compression at all (unless the camera transmits its data compressed, which would again be an issue with the camera, not a video codec). – Christoph Rackwitz Apr 28 '23 at 12:51

0 Answers0