I want to fetch an image from a connected webcam. I’d rather avoid saving the image to disk. I know I can achieve this with VideoIO
:
using Images
import VideoIO
f = VideoIO.opencamera("/dev/video1")
img = read(f)
But since I’m on a Linux machine with ffmpeg
, I thought I’d pipe the output from a call to ffmpeg
and get the data like that. For instance:
ffmpeg -f video4linux2 -s $res -i /dev/video1 -ss 0:0:2 -frames 1 -f image2 -
But how can I scoop up the output from a pipe call to ffmpeg
and get the image data?