Thread: VirtualDub2
View Single Post
Old 18th May 2019, 00:10   #856  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
Quote:
Originally Posted by age View Post
When I encode prores HQ with ffmpeg ( and virtualdub) it outputs always the same matrix "BT.470 System B/G".

During the encoding in ffmpeg I'm forced to use the PRORES_METADATA

https://ffmpeg.org/ffmpeg-bitstream-...s_005fmetadata
Latest ffmpeg should set correct flags on private ProRes headers and MOV container level.
If source has known parameters then ffmpeg by default will write them into private ProRes headers (as long as supported). In order to have this info also on container level you need to use "movflags write_colr" and tell ffmpeg what you want there with: -color_primaries, -color_trc, -colorspace options (otherwise it will write default values which is Rec.709 or Rec.601 depending on resolution). If parameters are missing on the source file then you need to tell ffmpeg what they are on input and what you want on output (+ info for movflags as in 1st case). It's bit crap that you need 2 sets of flagging in order to have 100% correctly flagged ProRes file (on container and private headers). Of curse those values should be always aligned.

Example 1 (source without known flagging):

..... -vf colorspace=iall=bt2020:all=bt2020 -color_primaries 9 -color_trc 14 -colorspace 9

in this case we tell ffmpeg that our source is Rec.2020 (iall) and we want to keep it this way (all) and also add flagging on container level as Rec.2020.

Example 2: (source with known flagging as Rec.2020):

-color_primaries 9 -color_trc 14 -colorspace 9

In this case we need just info for movflags option as private headers will be set to match source.

There are many options for colorspace filter which also allows for conversion between different color spaces. Doc:
https://ffmpeg.org/ffmpeg-all.html#toc-colorspace

You can achieve the same with zimg scaling as well which is very high quality filter. In both filters key point is fact that source flagging needs to be known- be on source or set by you. Without it you will have errors as ffmpeg won't know what to start with. All of this applies to prores and prores_ks encoders.

Last edited by kolak; 18th May 2019 at 00:20.
kolak is offline   Reply With Quote