[FFmpeg-user] HD > SD Down-Convert Prores Color

Kevin Wells kevwells at hotmail.co.uk
Fri May 15 11:20:48 CEST 2015


----------------------------------------
> Date: Fri, 15 May 2015 09:39:00 +0100
> From: kevin.j.wheatley at gmail.com
> To: ffmpeg-user at ffmpeg.org
> Subject: Re: [FFmpeg-user] HD> SD Down-Convert Prores Color
>
> On Thu, May 14, 2015 at 4:49 PM, Kevin Wells <kevwells at hotmail.co.uk> wrote:
>> Hi Kevin, what would be your suggestion for a possible work-around?
>
> you can control the conversion ffmpeg adds automatically by using an
> explicit "-vf scale=out_color_matrix=bt709" when going from RGB to
> YCbCr substitute what you need for the bt709 if you need something
> else. Then when decoding from YCbCr you can specify in_color_matrix
> (look for "auto-insert" when adding --loglevel verbose to the ffmpeg
> command line to see this).
>
> They key here is to realise that ffmpeg 'auto-inserts' a scaler to
> perform RGB<->YCbCr and the setup of that scalar is sometimes not in
> agrement with the input/output codec/format as it defaults to bt470bg
> (I guess for historical backwards compatibility) and the code doesn't
> have an obvious way for the formats/codecs to communicate to the
> scalar what settings to use automatically.
>
> Historically you can search on the archives and find there are lots of
> people suggesting to use -colormatrix to do additional matrixing to
> fix this, but the cleaner option in the current ffmpeg code is to
> directly say what you want to happen in the scaler.
>
> For decoding there is a way for the matrix to be passed in, but this
> doesn't always work - the movie file might not be tagged with the
> settings used to encode the movie for instance.
>
> Kevin
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user

Hi Kevin, your reply makes sense, so I have tried the below, but I can see that the colours are still incorrect, the green is quite a different colour green.


ffmpeg -i HD_BARS.mov -vf "scale=in_color_matrix=bt709:out_color_matrix=bt601:w=720:h=576" -vcodec prores -profile:v 3 -vtag apch -f mov SD_BARS.mov
ffmpeg version 2.6.2-tessus Copyright (c) 2000-2015 the FFmpeg developers
  built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
  configuration: --cc=/usr/bin/clang --prefix=/Users/helmutt/data/ext/ffmpeg/sw --as=yasm --extra-version=tessus --disable-shared --enable-static --disable-ffplay --enable-gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-libsoxr --enable-libwavpack --enable-version3 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libgsm --enable-libopus --enable-libmodplug --enable-fontconfig --enable-libfreetype --enable-libass --enable-libbluray --enable-filters --disable-indev=qtkit --disable-indev=x11grab_xcb --enable-runtime-cpudetect
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'HD_BARS.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2015-05-12 12:56:17
  Duration: 00:00:10.00, start: 0.000000, bitrate: 16901 kb/s
    Stream #0:0(eng): Video: prores (apch / 0x68637061), yuv422p10le(bt709), 1920x1080, 15360 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2015-05-12 12:56:17
      handler_name    : Apple Alias Data Handler
      encoder         : Apple ProRes 422 HQ
      timecode        : 00:00:00:00
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 2 channels, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2015-05-12 12:56:17
      handler_name    : Apple Alias Data Handler
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
    Metadata:
      creation_time   : 2015-05-12 12:56:18
      handler_name    : Apple Alias Data Handler
      timecode        : 00:00:00:00
File 'SD_BARS.mov' already exists. Overwrite ? [y/N] y
Output #0, mov, to 'SD_BARS.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    encoder         : Lavf56.25.101
    Stream #0:0(eng): Video: prores (apch) (apch / 0x68637061), yuv422p10le, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 12800 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2015-05-12 12:56:17
      handler_name    : Apple Alias Data Handler
      timecode        : 00:00:00:00
      encoder         : Lavc56.26.100 prores
    Stream #0:1(eng): Audio: aac (libvo_aacenc) (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 128 kb/s (default)
    Metadata:
      creation_time   : 2015-05-12 12:56:17
      handler_name    : Apple Alias Data Handler
      encoder         : Lavc56.26.100 libvo_aacenc
Stream mapping:
  Stream #0:0 -> #0:0 (prores (native) -> prores (native))
  Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (libvo_aacenc))
Press [q] to stop, [?] for help
frame=   50 fps=0.0 q=0.0 size=    1885kB time=00:00:01.97 bitrate=7829.3kbits/sframe=  100 fps=100 q=0.0 size=    3848kB time=00:00:04.44 bitrate=7089.0kbits/sframe=  154 fps=102 q=0.0 size=    5968kB time=00:00:06.96 bitrate=7020.5kbits/sframe=  208 fps=104 q=0.0 size=    8088kB time=00:00:08.94 bitrate=7404.9kbits/sframe=  250 fps=105 q=0.0 Lsize=    9823kB time=00:00:10.01 bitrate=8035.4kbits/s    
video:9660kB audio:157kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.066333% 		 	   		  


More information about the ffmpeg-user mailing list