Skip to content

Rotation metadata on input video is ignored #347

Open
@ivystopia

Description

@ivystopia

Description:

When converting a video with embedded rotation metadata (e.g. a 1920×1080 video rotated 90° to be vertical), gifski ignores the metadata, so the GIF comes out rotated.

VLC and other players show the video correctly (as if it were actually 1080×1920).

Suggestions:

  • Make gifski honour the rotation metadata
  • Or add a command-line flag (e.g. --rotate=90)

Steps to Reproduce:

  1. Use a video with rotation metadata.

    For example, a video whose mediainfo includes rotation data similar to:

    <track type="Video">
      ...
      <Rotation>90.000</Rotation>
      <Rotation_String>90°</Rotation_String>
      ...
    </track>
  2. Run:

    gifski -o output.gif input.mp4

Workarounds:

Workaround 1: Pre-process the input video with FFmpeg:

ffmpeg -noautorotate -i input.mp4 -vf "transpose=1" -metadata:s:v:0 rotate=0 -c:v libx264 -qp 0 -c:a copy rotated.mp4
gifski -o output.gif rotated.mp4

Workaround 2: Extract PNG frames from the input video, rotate them, and use gifski on the frames:

# Extract frames to PNG files:
ffmpeg -i input.mp4 frame%04d.png

# Rotate PNGs 90° clockwise using ImageMagick:
mogrify -rotate 90 frame*.png

# Convert rotated PNGs to a GIF:
gifski -o output.gif frame*.png

Environment:

  • OS: Ubuntu 24.04
  • gifski: 1.32.0
  • ffmpeg: 6.1.1-3ubuntu5
  • ImageMagick: 6.9.12-98 Q16 x86_64 18038
  • VLC: 4.0.0-dev (nightly)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions