Comments (8)
What kind of camera are you using?
Please add the active format and parameters you are using. Also, are you running a release or debug mode build?
from libv4l-rs.
Hey, I'm using a pretty standard laptop webcam (goes up to 720p, and with MJPEG it'll do 30FPS, slightly lower on YUYV).
I've tried both release and debug.
I messed around with a few different formats (and shrinking it right down to eliminate a slow processor or something as an issue).
Here is some output from a couple of frames of stream_capture_mmap
:
Using device: /dev/video0
Active format:
width : 320
height : 180
fourcc : YUYV
field : progressive
stride : 640
size : 115200
colorspace : sRGB
quantization : default
transfer : default transfer function
Active parameters:
capabilities : TIME_PER_FRAME
modes : (empty)
interval : 1/30 [s]
Buffer
sequence : 2
timestamp : 1665.073533 [s]
flags : MAPPED | TIMESTAMP_MONOTONIC | TSTAMP_SRC_SOE
length : 115200
Buffer
sequence : 3
timestamp : 1665.205535 [s]
flags : MAPPED | TIMESTAMP_MONOTONIC | TSTAMP_SRC_SOE
length : 115200
FPS: 7.462410290914528
MB/s: 0.8201908832008339
Also, for info here is the formats supported from v4l2-ctl
:
v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'YUYV' (YUYV 4:2:2)
Size: Discrete 640x480
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 960x540
Interval: Discrete 0.067s (15.000 fps)
Size: Discrete 848x480
Interval: Discrete 0.050s (20.000 fps)
Size: Discrete 640x360
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 424x240
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 352x288
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 320x240
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 320x180
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.100s (10.000 fps)
[1]: 'MJPG' (Motion-JPEG, compressed)
Size: Discrete 640x480
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 960x540
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 848x480
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 640x360
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 424x240
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 352x288
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 320x240
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 320x180
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.033s (30.000 fps)
from libv4l-rs.
Also, one thing to note, it seems to be consistently very close to 7.5 FPS. it's not a rough number, and it's never been anything else during my testing. (I can't fully remember what it was when I was testing the other day, but wouldn't be surprised if it was the same).
from libv4l-rs.
I'm afraid I can't reproduce this using my Logitech C922 Pro Stream
- I'm getting consistent 30 FPS in MJPG
or 20-30 in YUYV
. What kind of frame times are you getting when using v4l2-ctl
for mmap streaming?
from libv4l-rs.
Oh wow... this is strange...:
time v4l2-ctl --device /dev/video0 --stream-mmap --stream-to=frame.raw --stream-count=100
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.15 fps, dropped buffers: 1
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.14 fps
<<<<<<<<<<<<<<<<<< 26.12 fps
<<<<<<<<<<< 22.37 fps
<<<<<<<< 19.25 fps
I then Ctrl+C-ed it, and did it again afterwards:
time v4l2-ctl --device /dev/video0 --stream-mmap --stream-to=frame.raw --stream-count=1000
<<<<<<<< 7.52 fps, dropped buffers: 1
<<<<<<<< 7.50 fps
<<<<<<< 7.51 fps
<<<<<<< 7.50 fps
<<<<<<<< 7.50 fps
<<<<<<< 7.50 fps
I wonder what could be causing this...
Thanks for your help. I guess I'll close this issue, as it doesn't seem to be to do with this library.
If you have any ideas for places I could look do let me know, but I'll dig into this by myself.
(and thanks for the tip, didn't realise you could stream directly from v4l2-ctl).
from libv4l-rs.
oh wow... I figured it out, that was quick https://stackoverflow.com/questions/46228379/v4l2-framerate-drops
moving to a brighter room sorts it out. Sorry for the distraction!
time v4l2-ctl --device /dev/video0 --stream-mmap --stream-to=frame.raw --stream-count=1000 INT ↵ 5s default 🐍 2.6.3
<<<<<<<< 7.52 fps, dropped buffers: 1
<<<<<<<<<<<<<< 10.83 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 17.17 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 20.36 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 22.29 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 23.59 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 24.50 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 25.20 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 25.73 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.08 fps
from libv4l-rs.
that explains why the framerate seems to drop when I code at night 😄
from libv4l-rs.
Oh sorry, I could have saved you some time there :D
Most, if not all, laptop cameras are really garbage products and way too sensitive to changing light conditions.
from libv4l-rs.
Related Issues (20)
- new release HOT 4
- Missing reset_controls HOT 1
- Problems I encountered using this crate. HOT 4
- Failed to start media pipeline HOT 2
- Accessing to Handle for Streams HOT 1
- Publish `next` to crates.io HOT 2
- Hardware Encoding/Decoding HOT 1
- please release a new version of v4l2-sys-mit HOT 1
- Unable to build for RISC-V HOT 2
- Any way to tell device to write into a memory region i defined? HOT 1
- Publish `Stream::handle()` on crates.io HOT 1
- Feature request: convert to image HOT 7
- Crash on mem::zeroed HOT 3
- Getting zeroes in capture buffers HOT 3
- Manually starting a CaptureStream results in a single queued buffer HOT 1
- Build fail when features=libv4l HOT 2
- Unhelpful error message when compiling with default features off HOT 1
- Fails to build on Fedora "v4l2_pix_format_union_(anonymous_at_/usr/include/linux/videodev2_h_500_2)" is not a valid Ident HOT 3
- OS Invalid input error HOT 2
- Panic: v4l-0.14.0/src/control.rs:172:45: called Result::unwrap() on an Err value: () HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libv4l-rs.