[FFmpeg-user] transcoding with -filter_complex 'colorspace=' not working as hoped

hydra3333 at gmail.com hydra3333 at gmail.com
Mon Feb 27 14:38:55 EET 2023


> On 2023-02-27 04:59 pm, hydra3333 at gmail.com wrote:
> > the "colorspace=bt709:iall=bt601-6-625:fast=0" seems to be ignored entirely and the resulting clip is BT709.
>
> This tells colorspace that the input is 601 and the output should be 709.
>
> And mediainfo shows the output to have 709, as expected.
>
> Regards,
> Gyan

Thanks Gyan !

A mis-reading of the parameters on my part, then.

Changed the commandline to this:

"!ffmpegexe64_OpenCL!" -hide_banner -v verbose 	-i "G:\DVD\PAT-SLIDESHOWS\2012\NVEExport.0001.mp4" -probesize 200M -analyzeduration
200M -sws_flags lanczos+accurate_rnd+full_chroma_int+full_chroma_inp -strict experimental 	-filter_complex
"pad=0:1080:0:-1,scale=720:576:flags='lanczos+accurate_rnd+full_chroma_int+full_chroma_inp',colorspace=iall=bt709:all=bt601-6-625:sp
ace=bt470bg:trc=bt470bg:primaries=bt470bg:format=yuv420p:fast=0,setdar=16/9" 	-target pal-dvd -g 25 -b:v 9000000 -minrate:v
3000000 -maxrate:v 9200000 -bufsize 1835008 -packetsize 2048 -muxrate 10080000  	-y
"G:\DVD\PAT-SLIDESHOWS\2012\NVEExport.0001.DVD.mpg"

Reported output as hoped:

Routing option strict to both codec and muxer layer
[h264 @ 0000011c44d71000] Reinit context to 1920x1088, pix_fmt: yuv420p
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'G:\DVD\PAT-SLIDESHOWS\2012\NVEExport.0001.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: ndhdavc1mp42isom
    creation_time   : 2023-02-27T04:38:57.000000Z
  Duration: 00:09:08.03, start: 0.000000, bitrate: 8027 kb/s
  Chapters:
    Chapter #0:0: start 0.000000, end 548.032000
      Metadata:
        title           : Start
  Stream #0:0[0x1](eng): Video: h264 (Constrained Baseline), 1 reference frame (avc1 / 0x31637661), yuv420p(progressive, left),
1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 7900 kb/s, 25 fps, 25 tbr, 25k tbn (default)
    Metadata:
      creation_time   : 2023-02-27T04:38:58.000000Z
      handler_name    : Video Media Handler
      vendor_id       : [0][0][0][0]
      encoder         : AVC Coding
  Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 124 kb/s (default)
    Metadata:
      creation_time   : 2023-02-27T04:38:57.000000Z
      handler_name    : Sound Media Handler
      vendor_id       : [0][0][0][0]
[Parsed_scale_1 @ 0000011c45029d80] w:720 h:576 flags:'lanczos+accurate_rnd+full_chroma_int+full_chroma_inp' interl:0
Stream mapping:
  Stream #0:0 (h264) -> pad:default (graph 0)
  setdar:default (graph 0) -> Stream #0:0 (mpeg2video)
  Stream #0:1 -> #0:1 (aac (native) -> ac3 (native))
Press [q] to stop, [?] for help
<snip>
Output #0, dvd, to 'G:\DVD\PAT-SLIDESHOWS\2012\NVEExport.0001.DVD.mpg':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: ndhdavc1mp42isom
    encoder         : Lavf60.2.100
  Chapters:
    Chapter #0:0: start 0.000000, end 548.032000
      Metadata:
        title           : Start
  Stream #0:0: Video: mpeg2video (Main), 1 reference frame, yuv420p(tv, bt470bg, progressive, left), 720x576 (0x0) [SAR 64:45 DAR
16:9], q=2-31, 9000 kb/s, 25 fps, 90k tbn
    Metadata:
      encoder         : Lavc60.2.100 mpeg2video
    Side data:
      cpb: bitrate max/min/avg: 9200000/3000000/9000000 buffer size: 1835008 vbv_delay: N/A
  Stream #0:1(eng): Audio: ac3, 48000 Hz, stereo, fltp, delay 256, 448 kb/s (default)
    Metadata:
      creation_time   : 2023-02-27T04:38:57.000000Z
      handler_name    : Sound Media Handler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc60.2.100 ac3




More information about the ffmpeg-user mailing list