Automatically configure Logitech C925e webcam to 1080p @ 24fps MJPEG on system boot.
This repository contains a systemd service and bash script that ensures your Logitech C925e webcam always starts with consistent settings:
- Resolution: 1920x1080 (1080p)
- Framerate: 24 fps
- Format: MJPEG (Motion-JPEG)
When using webcams for recording (especially in OBS Studio), it's important to have consistent, predictable settings. This script ensures your webcam is always configured the same way, so you know exactly what framerate and quality you're recording at without having to check settings each time.
webcam-1080p-24fps.sh- The configuration scriptwebcam-config.service- Systemd service file for automatic startup
sudo cp webcam-1080p-24fps.sh /usr/local/bin/
sudo chmod +x /usr/local/bin/webcam-1080p-24fps.shOr place it in your preferred scripts directory (e.g., ~/scripts/system/).
sudo cp webcam-config.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable webcam-config.servicesudo systemctl start webcam-config.serviceOr simply reboot your system - the service will run automatically.
You can run the script manually at any time:
./webcam-1080p-24fps.shNote: The webcam must not be in use by any application when running the script.
Check that the service is running:
systemctl status webcam-config.serviceView current webcam settings:
v4l2-ctl --device=/dev/video0 --get-fmt-video
v4l2-ctl --device=/dev/video0 --get-parm- Linux system with systemd
v4l2-ctlutility (usually inv4l-utilspackage)- Logitech C925e webcam (or compatible device that supports 1080p @ 24fps MJPEG)
To change the settings, edit webcam-1080p-24fps.sh and modify these variables:
WEBCAM_DEVICE="/dev/video0" # Your webcam device
RESOLUTION="1920x1080" # Desired resolution
FPS="24" # Desired framerate
FORMAT="MJPEG" # Video formatCheck available formats and framerates for your webcam:
v4l2-ctl --device=/dev/video0 --list-formats-extThe webcam is currently in use by another application (e.g., OBS, browser). Close all applications using the webcam and try again.
Check the service logs:
sudo journalctl -u webcam-config.service -n 50If your webcam is not /dev/video0, find the correct device:
v4l2-ctl --list-devicesThen update the WEBCAM_DEVICE variable in the script.
MIT License - Feel free to use and modify as needed.
Created by Daniel with assistance from Claude Code.