labi
October 4, 2021, 10:30pm
1
I have a several frame grabbers. I would like to open one of frame grabber over directshow source filter.
First of all is it possible?
I can open with ffmeg directly:
ffmpeg.exe -loglevel debug -f dshow -s 320x180 -r 24 -i video="@device_pnp_\\?\pci#ven_1c04&dev_0005&subsys_00111c04&rev_01#8&35e39093&0&000800080008#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{741e7ee4-7af1-4fce-a07b-a811af3b666d}" -c:v libx264 -an -profile:v baseline -pix_fmt yuv420p -preset veryfast -r 24 -s 320x180 -f mpegts udp://224.0.1.1:1003?pkt_size=1316
But I need the frames… How can I open this filter in a c++ app?
Thanks,
Labi
probably not possible through OpenCV. it’s not made for this flexibility.
you should use ffmpeg’s APIs, or use Windows API directly.
berak
October 5, 2021, 7:38am
4
your ffmpeg cmdline builds an udp server ?
you could try to reach that from
VideoCapture("udp://224.0.1.1:1003", CAP_FFMPEG);
(until you find a better solution…)
labi
October 5, 2021, 7:47am
5
Thanks, the posted ffmpeg cmdline creates an udp server, but I want to avoid it, therefore more precisely what I need to open an Video Capture Source Filter directly, which I could open with ffmpeg:
-i video="@device_pnp_\\?\pci#ven_1c04&dev_0005&subsys_00111c04&rev_01#8&35e39093&0&000800080008#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{741e7ee4-7af1-4fce-a07b-a811af3b666d}"
but unfortunately these are not work:
VideoCapture("@device_pnp_\\?\pci#ven_1c04&dev_0005&subsys_00111c04&rev_01#8&35e39093&0&000800080008#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{741e7ee4-7af1-4fce-a07b-a811af3b666d}", CAP_FFMPEG);
or
VideoCapture("FrameGrabber X Channel", CAP_DSHOW);
berak
October 5, 2021, 8:05am
6
sure, that is terribly clumsy …
yep, CAP_FFMPEG does not accept “pipeline strings” and CAP_DSHOW does not use “device strings”
CAP_GSTREAMER supports pipelines, but no idea, if they can resolve your device like above … :[