ffmpeg 6 breaks rotation of recorded images

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
gkmac
Posts: 13
Joined: Wed Jun 20, 2012 6:28 pm

ffmpeg 6 breaks rotation of recorded images

Post by gkmac »

I'm using ZoneMinder v1.36.32 using an overlay ebuild on Gentoo along with ffmpeg v4.4.5

One of my cameras is mounted portrait thus the "Orientation" is set to "Rotate Right". The source type is "Ffmpeg" and the video writer is set to "Camera Passthrough". With ffmpeg v4.4.5 both the live view and the recorded .mp4s are correctly rotated.

But when I try ffmpeg v6.1.1 the recorded .mp4s are not rotated. This symptom shows when I view the recordings in ZoneMinder itself, and also if I download the mp4 and play it back in VLC and other video players. The live view is still rotated correctly though.

Here's what ffmpeg -i says about a recording with ffmpeg v4.4.5 that is rotated correctly

Code: Select all

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'rotated-349248-video.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso6iso2avc1mp41
    title           : Zoneminder Security Recording
    encoder         : Lavf58.76.100
  Duration: 00:00:18.17, start: 0.000000, bitrate: 1831 kb/s
  Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuvj420p(pc, bt709, progressive), 1920x1080, 1829 kb/s, 6 fps, 6 tbr, 90k tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
    Side data:
      displaymatrix: rotation of -90.00 degrees
and here's what it says a recording with ffmpeg v6.1.1 that is not rotated

Code: Select all

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'rotatednot-349250-video.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso6iso2avc1mp41
    title           : Zoneminder Security Recording
    encoder         : Lavf60.16.100
  Duration: 00:00:26.67, start: 0.000000, bitrate: 1808 kb/s
  Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuvj420p(pc, bt709, progressive), 1920x1080, 1806 kb/s, 6 fps, 6 tbr, 90k tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
The difference is the missing "Side data: displaymatrix: rotation of -90.00 degrees" at the end, and yet somehow "title: Zoneminder Security Recording" appears in both.

Upgrading ZoneMinder to v1.36.35 has no effect, in fact for some reason the overlay ebuilds of v1.36.33 demand ffmpeg v5 as a dependency. This v5 version also fails to rotate recorded images and thus I am stuck on v1.36.32
gkmac
User avatar
iconnor
Posts: 3273
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: ffmpeg 6 breaks rotation of recorded images

Post by iconnor »

Thanks for the report. I have replicated it here on ubuntu noble with ffmpeg 6.1.
User avatar
iconnor
Posts: 3273
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: ffmpeg 6 breaks rotation of recorded images

Post by iconnor »

Master and the release-1.36 branch have fixes for this.

I will probably release 1.36.36 soonish.
Post Reply