Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#7571 closed enhancement (wontfix)

Information about input color space

Reported by: Ilya87 Owned by:
Priority: normal Component: ffmpeg
Version: unspecified Keywords: color space
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug: ffmpeg even with -loglevel debug provides no data about input colorspace that will be used later by encoder.
How to reproduce:

% ffmpeg -loglevel 5 -i bd.mkv
ffmpeg version 4.1
built on Antergos Linux
Using the command -vf colorspace=all=bt601-6-625:iall=bt601-6-625 I found out that ffmpeg treats input video as BT.601 (I compared first screenshot made with -frames:v 1 default.png with screenshot made using this filter). Why not BT.709? Where does ffmpeg get the information?

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Attachments (1)

bd1.mkv (54.9 KB ) - added by Ilya87 6 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 by Elon Musk, 6 years ago

It guess input colorspace if it is not properly marked. Look at setparams filter how to force input colorspace for filters.

by Ilya87, 6 years ago

Attachment: bd1.mkv added

comment:2 by Ilya87, 6 years ago

It's good about correct guess, but I think that this info (even it is guessed) should be shown using debug or other command.

comment:3 by Ilya87, 6 years ago

The input is blu-ray part, can it have bt.601?

comment:4 by Elon Musk, 6 years ago

Dunno, you can see which colorspace frame use with showinfo filter.

in reply to:  4 comment:5 by Ilya87, 6 years ago

Replying to richardpl:

Dunno, you can see which colorspace frame use with showinfo filter.

In description I see it shows pixel format, not colorspace

comment:6 by Elon Musk, 6 years ago

Because your ffmpeg is older than mine, update it ASAP.

comment:7 by Elon Musk, 6 years ago

And documentation is not in sync.

comment:8 by Ilya87, 6 years ago

Last edited 6 years ago by Ilya87 (previous) (diff)

comment:9 by Elon Musk, 6 years ago

ffmpeg -i bd.mkv -vf showinfo -f null -

You need 4.1 or newer.

comment:10 by Ilya87, 6 years ago

I have 4.1 and it says color_range:unknown color_space:unknown color_primaries:unknown color_trc:unknown

Version 0, edited 6 years ago by Ilya87 (next)

comment:11 by Elon Musk, 6 years ago

Yes, use: ffmpeg -i bd.mkv -vf setparams=colorspace=bt709,rest_of_filtering ....

comment:12 by Ilya87, 6 years ago

I still don't understand why I should set bt709 and maybe it's a bug already if ffmpeg chooses incorrect input color space?

comment:13 by Elon Musk, 6 years ago

Nope, your input just lacks necessary metadata either in container or in video.

comment:14 by Ilya87, 6 years ago

In this case ffmpeg must explicitly declare that color space is guessed and may be incorrect and it is recommended to set it manually.

comment:15 by Elon Musk, 6 years ago

Resolution: wontfix
Status: newclosed

comment:16 by Balling, 3 years ago

blu-ray part, can it have bt.601?

Both AVC and HEVC support BT.601 matrix, but no, Blu-rays are all BT.709.

Ffmpeg swscale defaults to BT.601 limited.

Note: See TracTickets for help on using tickets.