firmware icon indicating copy to clipboard operation
firmware copied to clipboard

Camera rotation adds white line to bottom of video

Open Malvineous opened this issue 4 years ago • 0 comments

Describe the bug When using the Pi camera (at least v1/OV5647) if you request the camera be rotated 90 or 270 degrees, a white line is added on the bottom-most scanline (after rotation).

To reproduce Probably the only relevant parameters are the width, height and rotation but this is the full command I am using:

v4l2-ctl -d /dev/video0 --set-ctrl=exposure_dynamic_framerate=1 --set-ctrl=scene_mode=8 --set-ctrl=rotate=90 -v width=960,height=1296,pixelformat=YU12

After this, any program that captures video (e.g. ffmpeg) has a white line at the bottom of the video.

Expected behaviour No white line, just normal video.

Actual behaviour White line from (0,1296) to (960,1296).

System

  • Which model of Raspberry Pi? Tested on Pi1 and Pi3B
  • Which OS and version (cat /etc/rpi-issue)? Arch Linux ARM
  • Which firmware version (vcgencmd version)? Has been happening for more than two years, currently tested with:
Oct 19 2021 11:52:20 
Copyright (c) 2012 Broadcom
version 0403e22018aafab833d0a16374ac773f66fd7be9 (clean) (release) (start_x)
  • Which kernel version (uname -a)? Linux 5.10.74-1-raspberrypi-ARCH #1 SMP Mon Oct 18 17:51:34 UTC 2021 armv7l GNU/Linux

Additional context

This started happening a few years ago and I finally got around to investigating. It used to happen when streaming H264 data from the camera directly with ffmpeg on a Pi1, and lately I am streaming raw data off the camera on a Pi3 and using V4L2M2M to encode it but I still see the same white line.

The line is not present if rotation is not used, it is only present when rotating 90 or 270 degrees. The white line is always at the bottom of the final video, regardless of rotation direction. Both cameras are OV5647, I don't think I have any others to test.

Malvineous avatar Oct 25 '21 04:10 Malvineous