grab frame NTSCtoUSB dongle, opencv2, python wrapper

后端 未结 3 1785
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-01 17:26

Context:

I have been playing around with python\'s wrapper for opencv2. I wanted to play with a few ideas and use a wide angle camera similar to \'rear view\' came

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-01 18:16

    It's a few months late, but might be useful. I was working on a Windows computer and had installed the drivers that came with the device, I tried the same code as your question with an Ezcap from Somagic and got the same error. Since "frame is None," I decided to try an if statement around it - in case it was an initialization error. Placing into the loop:

    if frame is None:
        print 0
    else:
        print 1
    

    The result is: 01110111111111111111111111111...

    And if the frame = cap.read(), above the loop is commented out - I get: 00111111111111111...

    So for my device capture device it appears to be working for all frames beyond the 5th are captured. I'm not sure why this is, but it might be a useful work around for now.

    Disclaimer: Unfortunately, my camera input is currently in a radiation field so I can't get to it for a couple of weeks to make sure it works for sure. However, the images are currently a black frame (which is expected without proper input).

提交回复
热议问题