FFmpegFrameGrabber - How to set devicePath or deviceFile on Linux
#189 opened on Jul 28, 2015
Repository metrics
- Stars
- (6,985 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
Hi
I am found this source which shows how to read video from cam and audio from microphone https://github.com/bytedeco/javacv/blob/master/samples/WebcamAndMicrophoneCapture.java#L120 ; Every time I run the example I get this exception :
-----begin----- VIDEOIO ERROR: V4L: index 1 is not correct! Exception in thread "main" org.bytedeco.javacv.FrameGrabber$Exception: cvCreateCameraCapture() Error: Could not create camera capture. at org.bytedeco.javacv.OpenCVFrameGrabber.start(OpenCVFrameGrabber.java:179) at my.atest1.WebcamAndMicrophoneCapture.main(WebcamAndMicrophoneCapture.java:64) Java Result: 1 -----end-----
...so define index as constant is not working and there should be a dynamic way (a filter)?
The thing is I watching this source https://github.com/bytedeco/javacv/blob/master/src/main/java/org/bytedeco/javacv/FFmpegFrameGrabber.java#L79 and I can see there as arg should be devicePath or deviceFile for example; So to get stream from web cam or microphone I need to get their device paths or files but I don't know how? So my question is... how to get(?filter) the FFmpegFrameGrabber required devices info in the standard way? And if there are related tutorials please share me the link(s)
Thanks
p.s.
- OS : Linux Arch x64
- jdk 1.7
- javacv-1.0