4

I need to rotate (90 degrees) the video feed of my laptop webcam to use it with skype/hangout.

It seems to be possible using the gstreamer infrastructure, but I don't know how.

2
  • Which version of Ubuntu?
    – Daniel Beck
    May 12, 2013 at 12:27
  • @Daniel I personally run Mint 14. Any hint to do this in any Ubuntu version would be appreciated.
    – silviot
    May 13, 2013 at 14:14

1 Answer 1

3

Take a look at this: https://unix.stackexchange.com/questions/408187/rotate-webcam-as-well-as-screen-portrait-mode

The answer by Lucio Anibal Criollo Rivera worked for me well.

I am bringing it here for the sake of clarity:

  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

https://www.ostechnix.com/20-ffmpeg-commands-beginners/

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

1
  • 1
    I used ` ffmpeg -f v4l2 -i /dev/video2 -vf "transpose=2,transpose=2,format=yuv420p" -f v4l2 /dev/video4` to FLIP the camera vertically - this allowed me to do a demonstration on paper with my webcam overhead.
    – Jmoney38
    Jan 11, 2022 at 20:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .