Skip to content

is_portrait_source returns False for every source on ffmpeg 4.4 (stream_side_data section not supported) #232

Open

Description

@sinmi-hub

On ffmpeg/ffprobe 4.4 (the Ubuntu 22.04 package, 4.4.2), `is_portrait_source` in `helpers/render.py` reports every source as landscape, including true portrait clips such as 1080x1920.

Cause

The probe added in #137 asks for `-show_entries stream=width,height:stream_side_data=rotation`. ffprobe 4.4 has no `stream_side_data` section, so it rejects the whole option before reading the file:

$ ffprobe -v error -select_streams v:0 -show_entries "stream=width,height:stream_side_data=rotation" -of json in.mp4
No match for section 'stream_side_data'
Failed to set value 'stream=width,height:stream_side_data=rotation' for option 'show_entries': Invalid argument

The non-zero exit raises `CalledProcessError`, which the function catches and turns into `False`. Every source then gets the landscape scale branch (`scale=1920:-2`), so portrait footage renders at the wrong size with no error.

Possible fix

Probe `stream=width,height:stream_side_data_list` (accepted by 4.4 and newer, and it still returns `side_data_list` with `rotation`), or retry with plain `stream=width,height` when the first probe fails. Either way, the probe should not fall back to `False` silently when ffprobe rejects its arguments.

Seen at 43cfc56.

Activity

  1. sinmi-hub commented on Oct 30, 2026

    @sinmi-hub
    Author

    I checked the first suggested fix on ffprobe 4.4.2. With a clip carrying a 90-degree display matrix, -show_entries stream=width,height:stream_side_data_list exits 0 and returns side_data_list with "rotation": 90, which is the same shape the current parser reads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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