# Bake Video Rotation Metadata

Bake a video's rotation metadata into upright pixels and clear the rotate flag so sideways phone clips play correctly everywhere.

## Run it

- **CLI:** `gizza tool video-bake-rotation 'url=https://example.com/input'`
- **Web:** https://gizza.ai/tools/video-bake-rotation/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/video-bake-rotation/tool.json

## Inputs

- `file` — Video _(file; accept: video/*)_

## Output

- Rotation-baked video (video)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `url` — fetch the input file from a public URL (CORS-permitting)

Example: `https://gizza.ai/tools/video-bake-rotation/?url=https://example.com/input`

---

## Fix sideways videos by baking the rotate flag into pixels

Some phones save video sideways and add a hidden **rotation metadata** flag that
tells players how to display it. Most modern players obey the flag; some editing
apps, upload pipelines, previews, and older players ignore it, so the clip looks
sideways. This tool re-encodes the video so ffmpeg applies the embedded
orientation while decoding, then writes normal upright pixels and clears the
rotate flag.

**Worked example:** load a portrait phone clip that looks correct in your phone's
player but sideways after upload. Run the tool once. The result is an H.264 video
whose pixels are actually upright, so players no longer need to understand the
original rotate/display-matrix metadata.

### What changes

- The video stream is re-encoded to H.264 (`CRF 23`, preset `medium`) because the
  orientation has to become real pixels, not just metadata.
- The rotate tag is cleared (`rotate=0`) so players do not double-rotate the
  baked result.
- Audio is copied when the output container supports it; otherwise it is encoded
  to AAC in an MP4 output.

### Notes and limits

- If your video has no rotate metadata, the output will look the same, just
  normalized through the same H.264 encode path.
- This differs from an explicit rotate tool: you do not choose 90/180/270 degrees
  here. The embedded rotation metadata in the file is the source of truth.
- Input and output are each capped at 25 MB because ffmpeg runs in the browser.

### FAQ

<details>
<summary>How is this different from rotating a video manually?</summary>

Manual rotation asks you to choose an angle. This tool reads the angle already
stored in the video container and bakes that orientation into the pixels, then
clears the metadata flag.

</details>

<details>
<summary>Will this be lossless?</summary>

No. Baking metadata into pixels requires decoding and re-encoding the video. The
default H.264 CRF 23 setting is a practical quality/size tradeoff, and audio is
copied when the container allows it.

</details>

<details>
<summary>Why clear the rotate flag?</summary>

After the pixels are upright, keeping the old flag could make players rotate the
clip a second time. Clearing it makes the baked output display consistently.

</details>

<details>
<summary>What if my clip is already upright?</summary>

The output should still display upright. If there was no rotate metadata, this
acts as a normalization/transcode pass rather than a visible rotation fix.

</details>

## Related tools

- [Change Video Speed](https://gizza.ai/tools/change-speed/): Speed up or slow down a video right in your browser, keeping audio in sync — pick a speed factor (0.25x–4x). Re-encodes locally with ffmpeg, nothing is uploaded, free.
- [Extract Video Frames to a Contact Sheet](https://gizza.ai/tools/extract-frames/): Sample frames from a video by interval, fps or scene change and tile them into one contact-sheet image. Free, in your browser with ffmpeg, nothing is uploaded.
- [Gamma Correct an Image](https://gizza.ai/tools/gamma-correct/): Apply gamma correction to image midtones in your browser, with per-channel gamma, highlight protection and PNG/JPG/WebP output options.
- [GIF to MP4 / WebM](https://gizza.ai/tools/gif-to-mp4/): Convert an animated GIF into a much smaller MP4 or WebM video, right in your browser. Re-encodes locally with ffmpeg (H.264 / VP9), nothing is uploaded, free.
- [Pad a Video to an Aspect Ratio](https://gizza.ai/tools/video-aspect-pad/): Letterbox or pillarbox a video to 9:16, 1:1, 16:9 or any preset ratio with colored bars or a blurred background — free, in your browser, nothing is uploaded.
