Changes between Version 61 and Version 62 of Scaling


Ignore:
Timestamp:
Aug 24, 2024, 2:53:29 AM (2 years ago)
Author:
Balling
Comment:

new mention of jpeg chroma siting center and new options out_chroma_loc, in_chroma_loc

Legend:

Unmodified
Added
Removed
Modified
  • Scaling

    v61 v62  
    204204== Chroma sample location ==
    205205
    206 FFmpeg does not see the chroma sample location on either limited or full range file, so you should specify it by hand when going to .rgb (or upsampled from 4:2:0 to 4:4:4 .yuv):
     206FFmpeg does not see the chroma sample location on either limited or full range file, so you should specify it by hand when going to .rgb (or when upsampling from 4:2:0 to 4:4:4 in .yuv):
    207207{{{
    208208ffmpeg -i cosmos.mkv -vf 'scale=in_h_chr_pos=0:in_v_chr_pos=128' -pix_fmt rgb24 qnfvarejwnfe3.rgb //for left
    … …  
    210210}}}
    211211
    212 To create BT.2020-NCL matrix with top-left chroma this can be used (if the source image is not using bt.2020 primaries the color managment must be done first on linear data, also correct transfer must be tagged, either SDR or HDR one, again this requires color managment):
     212Recently introduced in_chroma_loc and out_chroma_loc can be used as well.
     213
     214
     215{{{
     216ffmpeg -i cosmos-p5.mkv -vf scale=in_chroma_loc=left -pix_fmt rgb24 newway.rgb
     217}}}
     218
     219
     220{{{
     221ffmpeg -i cosmos-p5.mkv -vf scale=in_chroma_loc=topleft -pix_fmt rgb24 newway.rgb
     222}}}
     223
     224
     225To create BT.2020-NCL matrix with top-left chroma this can be used (if the source image is not using bt.2020 primaries the color management must be done first on linear data, also correct transfer must be tagged, either SDR or HDR one, again this requires color management):
    213226{{{
    214227-vf scale=out_color_matrix=bt2020nc:out_h_chr_pos=0:out_v_chr_pos=0
    … …  
    219232ffmpeg -i file.mp4 -c copy -bsf:v hevc_metadata=chroma_sample_loc_type=0 file1.mp4
    220233}}}
     234
     235Also, #9693 says that if you want to write jpeg file you need to specify  -vf scale=out_color_matrix=smpte170m:out_chroma_loc=center