How to fetch both live video frame and timestamp from ffmpeg to python on Windows

后端 未结 3 1630
一生所求
一生所求 2020-12-30 13:29

Searching for an alternative as OpenCV would not provide timestamps for live camera stream (on Windows), which are required in my computer vision a

3条回答
  •  暖寄归人
    2020-12-30 13:57

    You can try to specify the buffer size so you're sure the whole frame fits in it :

    bufsize = w*h*3 + 100 
    pipe = sp.Popen(command, bufsize=bufsize, stdout = sp.PIPE, stderr = sp.PIPE)
    

    with this set up, you can normally read on pipe.stdout for your frames and pipe.stderr for its info

提交回复
热议问题