Rotate webcam as well as screen (portrait mode)

Solution:

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

1) Install utilities:

$ sudo apt-get update
$ sudo apt-get install v4l-utils
$ sudo apt-get install v4l2loopback-utils

2) Download v4l2loopback

3) Uncompress ‘v4l2loopback-master’ folder

4) Compile v4l2loopback module:

$ make

5) Install:

$ sudo make install

6) Enable device:

$ sudo modprobe v4l2loopback exclusive_caps=1

7) Check if device is enabled:

$ v4l2-ctl --list-devices

Dummy video device (0x0000) (platform:v4l2loopback-000):
  /dev/video1

USB2.0 UVC 2M WebCam: USB2.0 UV (usb-0000:00:1a.0-1.2):
  /dev/video0

8) Copy the webcam video stream to it via ffmpeg:

$ ffmpeg -f v4l2 -i /dev/video0 -vf "transpose=1,format=yuv420p" -f v4l2 /dev/video1

You can see for more details about paramters:

https://ffmpeg.org

20+ FFmpeg Commands For Beginners

https://github.com/qTox/qTox/wiki/Video