Skip to content

When recording multiple horizontal videos in succession, the second video is incorrectly oriented vertically. #534

@pHr34kY

Description

@pHr34kY

When recording multiple horizontal videos in succession, the second video has incorrect orientation, and is recorded vertically. Sorry for duplicating #506 - I didn't realise until after I created this.

To reproduce:

  1. Orient the device horizontally
  2. Open the GrapheneOS Camera app
  3. Select "Video" mode
  4. Press the "record" button 6 times, approximately two seconds apart.

Expected result: 3 videos recorded in horizontal (landscape) orientation.
Actual result: First video recorded as horizontal, second video recorded as portrait, third video recorded as horizontal.
Suspected cause: The "Rotation" tag is missing from the metadata of the second video.

Three videos as they appear in the gallery:

Image

The same three videos when copied to a PC (Ubuntu):
Image

I made a video demonstrating the issue. It's an external video of the device to demonstrate the orientation.
https://github.com/user-attachments/assets/25898f13-3f03-4e41-a3cf-b271d66cb557

I have included a mediainfo dump of the first two videos. Note that the first video is 1080x1920 with a 270° rotation (a weird way to do it, but it does display correctly in 16:9 landscape). The second video is 1080x1920 (9:16) with no rotation tag on the file.

First recording

$ mediainfo VID_20250412_202654.mp4
General
Complete name                            : VID_20250412_202654.mp4
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (isom/mp42)
File size                                : 4.56 MiB
Duration                                 : 2 s 339 ms
Overall bit rate                         : 16.3 Mb/s
Frame rate                               : 29.868 FPS
Encoded date                             : 2025-04-12 10:26:57 UTC
Tagged date                              : 2025-04-12 10:26:57 UTC
xyz                                      : [redacted]
com.android.version                      : 15

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings                          : CABAC / 1 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 1 frame
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 2 s 339 ms
Source duration                          : 2 s 277 ms
Bit rate                                 : 16.7 Mb/s
Width                                    : 1 080 pixels
Height                                   : 1 920 pixels
Display aspect ratio                     : 0.562
Rotation                                 : 270°
Frame rate mode                          : Variable
Frame rate                               : 29.868 FPS
Minimum frame rate                       : 29.772 FPS
Maximum frame rate                       : 29.871 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.269
Stream size                              : 4.53 MiB (99%)
Source stream size                       : 4.53 MiB (99%)
Title                                    : VideoHandle
Language                                 : English
Encoded date                             : 2025-04-12 10:26:57 UTC
Tagged date                              : 2025-04-12 10:26:57 UTC
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
mdhd_Duration                            : 2339
Codec configuration box                  : avcC

Second recording

$ mediainfo VID_20250412_202659.mp4
General
Complete name                            : VID_20250412_202659.mp4
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (isom/mp42)
File size                                : 5.88 MiB
Duration                                 : 3 s 49 ms
Overall bit rate                         : 16.2 Mb/s
Frame rate                               : 29.868 FPS
Encoded date                             : 2025-04-12 10:27:02 UTC
Tagged date                              : 2025-04-12 10:27:02 UTC
xyz                                      : [redacted]
com.android.version                      : 15

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings                          : CABAC / 1 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 1 frame
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 3 s 49 ms
Source duration                          : 2 s 980 ms
Bit rate                                 : 16.4 Mb/s
Width                                    : 1 080 pixels
Height                                   : 1 920 pixels
Display aspect ratio                     : 0.562
Frame rate mode                          : Variable
Frame rate                               : 29.868 FPS
Minimum frame rate                       : 29.772 FPS
Maximum frame rate                       : 29.871 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.266
Stream size                              : 5.84 MiB (99%)
Source stream size                       : 5.84 MiB (99%)
Title                                    : VideoHandle
Language                                 : English
Encoded date                             : 2025-04-12 10:27:02 UTC
Tagged date                              : 2025-04-12 10:27:02 UTC
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
mdhd_Duration                            : 3049
Codec configuration box                  : avcC

Device Details

Model: Pixel 6a
GrapheneOS Build number: 2025040700
app.grapheneos.camera version: 83

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions