Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting stream parameters #261

Open
dbrb2 opened this issue Dec 29, 2021 · 2 comments
Open

Setting stream parameters #261

dbrb2 opened this issue Dec 29, 2021 · 2 comments

Comments

@dbrb2
Copy link

dbrb2 commented Dec 29, 2021

This isn't a bug, so much as a request for clarification:

I can specify frame rate and resolution for an H.264 video source (in this case a pi camera with the bcm2835-v4l2 driver) as follows:
v4l2rtspserver -F $FPS -H $Y -W $X /dev/video0

I can also set some other stream parameters using v4l2-ctrl at the terminal - such as:
v4l2-ctl -d /dev/video0 -c video_bitrate=4000000

On paper, I can also set frame rate at the terminal (when the device is not in use) - v4l2-ctl -d /dev/video0 -p 10

However, if I do that, and then subsequently start v4l2rtspserver without a "-F" parameter, the frame rate defaults to 25fps

Does v4l2rtspserver set frame rate and resolution to some default if not specified - overriding any preceding v4l2-ctl commands?

@mpromonet
Copy link
Owner

Hi,

You are right, default settings is 25fps, this could be better to not set fps by default.
There is 2 possible ways either using '-f ' (no ioctl will be send and then current capture settings will be used), or using '-F0' (fps will not be set).

Best Regards,
Michel

@dbrb2
Copy link
Author

dbrb2 commented Dec 30, 2021

Ah thanks.
Setting just -f still seemed to override the configured frame rate with 25fps
However, setting -F0 left it as set

Interestingly, whilst leaving out an explicit F defaulted to 25fps, not specifying W and H does not seem to result in these being overridden - they stay set to whatever their preconfigured valued were

Cheers!

`
#!/bin/bash

DEVICE=/dev/video0
PORT=554
X=640
Y=480
FPS=5
BITRATE=4000000
MODE=0 #0=VBR, 1=CBR
WB=1
POWERLINE=1

v4l2-ctl -d $DEVICE -c video_bitrate=$BITRATE
v4l2-ctl -d $DEVICE -c video_bitrate_mode=$MODE
v4l2-ctl -d $DEVICE -c white_balance_auto_preset=$WB
v4l2-ctl -d $DEVICE -c power_line_frequency=$POWERLINE
v4l2-ctl -p $FPS
v4l2-ctl --set-fmt-video=width=$X,height=$Y,pixelformat=4

/usr/local/bin/v4l2rtspserver -F0 -P $PORT -u "" $DEVICE
`

Repository owner deleted a comment from dsmahalle Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants