Skip to content

ffmpeg fails on videos with invalid color space metadata #3

@LALITH0110

Description

@LALITH0110

Description

Image+Video polyglot generation fails when processing certain Samsung phone videos with reserved/invalid color space values.

Error

[graph -1 input from stream 0:1] Invalid color space
[vf#0:0] Error reinitializing filters!
Task finished with error code: -22 (Invalid argument)
Conversion failed!

Video Info

  • Source: Samsung phone recording
  • Format: h264, 2340x1080, yuv420p(tv, reserved/reserved/smpte170m)
  • Issue: ffmpeg 7.1 rejects "reserved" color space values

Steps to Reproduce

  1. Upload image + video (Samsung recorded .mp4)
  2. Select image-mp4 polyglot type
  3. ffmpeg re-encoding fails during video normalization

Behavior

ffmpeg exits with "Invalid color space" error, polyglot generation fails

Current solution to this

Add color space normalization to ffmpeg command:

ffmpeg_cmd = [..., "-vf", "format=yuv420p", "-colorspace", "bt709", ...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions