Skip to content

Instantly share code, notes, and snippets.

@dietrichm
Last active November 8, 2022 10:53
Show Gist options
  • Save dietrichm/a68273439928e85db838558fd2bb002f to your computer and use it in GitHub Desktop.
Save dietrichm/a68273439928e85db838558fd2bb002f to your computer and use it in GitHub Desktop.
Logitech C505e HD Webcam flickering
SUBSYSTEM=="video4linux", KERNEL=="video[0-9]*", ATTRS{product}=="C505e HD Webcam", ATTR{index}=="0", RUN+="/usr/bin/v4l2-ctl -d $devnode --set-ctrl=power_line_frequency=1"

Logitech C505e HD Webcam flickering

By default, this device - as many other webcams - is configured for the 60 Hz power line frequency used in the US.

When using the device i.e. in Europe, in order to avoid annoying flickering of the video stream, the power line frequency must be reconfigured for 50 Hz.

Switch power line frequency on Linux

On Linux machines, you can use an Udev rule to automatically switch the frequency when the device is plugged in. See the attached 99-logitech-webcam.rules file.

Ensure v4l2-ctl is installed (it's available through v4l-utils) and save this file as /etc/udev/rules.d/99-logitech-webcam.rules.

Note: with the/my C505e it seems to take some time before the change takes effect and the flickering stops. Sometimes, it needs half a minute or more. Be aware of this when experimenting and installing this rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment