Rotate webcam as well as screen (portrait mode)

cameravideoxrandr

TL;DR: Is it possible to rotate by 90 degrees the feed of a built-in screen webcam?

I have 2 screen monitors, one in landscape and one in portrait mode. The webcam is on the "portrait" monitor, the "landscape" monitor doesn't have a rotation capability (so I cannot switch them). The display on the second screen is rotated using xrandr, via arandr. However, the webcam feed is still filming as if there was no physical rotation, which is a problem for videoconferencing. I would like a way to tweak the video feed at driver level so that I can use it in other applications.

I have tried to use v4l2-ctl but I cannot find a "rotate" features (while there are many configuration options for contrast/hue/etc.). I can use

My distribution is Archlinux but I don't think it's relevant here. The portrait screen is a philips 271P4Q. Lsusb output for the integrated webcam:
Bus 001 Device 005: ID 04ca:7054 Lite-On Technology Corp.

If there's nothing to do yet, I would also like to know whom I can report this to, to improve the situation (Xorg developers? Linux kernel devs?).

Thank you for any input on this.

Best Answer

You might be able to do this as described here. Install and modprobe the v4l2loopback module (you may need to compile it) to create a new video device, then copy the webcam video stream to it via ffmpeg:

ffmpeg -f v4l2 -i /dev/video0 -vf transpose=1 -f v4l2 /dev/video1
Related Question