[FFmpeg-user] pseudocolor and general filter syntax

Kieran O Leary kieran.o.leary at gmail.com
Sat Aug 26 14:11:50 EEST 2017


I'm trying and failing to get the pseudocolour filter to work. I think my
issue is more to do with not knowing how to formulate the filter syntax in
general. I basically just copy pasted the example from the filter
documentation and I am guessing that I should be populating the
amax/ymax/val values with actual numbers?

 If so, I'm not sure what to populate val and amax with. Things like ymin
and ymax seem like they should be 235 and 255 for 8-bit, but I'm clueless
about the others.

Or perhaps I should be populating the values using signalstats in some way?

Anyhow here's what I tried.

./ffmpeg -i 5fr_out_of_brang.mkv -vf
pseudocolor="if(between(val,ymax,amax),lerp(ymin,ymax,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(umax,umin,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(vmin,vmax,(val-ymax)/(amax-ymax)),-1):-1"
-c:v ffv1 pseudo.mkv
ffmpeg version N-87068-g8a0954d Copyright (c) 2000-2017 the FFmpeg
developers
  built with gcc 5.3.0 (Homebrew gcc 5.3.0)
  configuration:
  libavutil      55. 74.100 / 55. 74.100
  libavcodec     57.103.100 / 57.103.100
  libavformat    57. 77.100 / 57. 77.100
  libavdevice    57.  7.101 / 57.  7.101
  libavfilter     6.100.100 /  6.100.100
  libswscale      4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
Guessed Channel Layout for Input Stream #0.1 : 4.0
Input #0, matroska,webm, from '5fr_out_of_brang.mkv':
  Metadata:
    ENCODER         : Lavf57.76.100
  Duration: 00:00:00.20, start: 0.000000, bitrate: 138359 kb/s
    Stream #0:0(eng): Video: ffv1 (FFV1 / 0x31564646), yuv422p10le(top
coded first (swapped)), 720x576, SAR 16:15 DAR 4:3, 25 fps, 25 tbr, 1k tbn,
1k tbc (default)
    Metadata:
      HANDLER_NAME    : Apple Alias Data Handler
      TIMECODE        : 06:00:05:01
      ENCODER         : Lavc57.75.100 ffv1
      DURATION        : 00:00:00.200000000
    Stream #0:1(eng): Audio: pcm_s24le, 48000 Hz, 4.0, s32 (24 bit), 4608
kb/s (default)
    Metadata:
      HANDLER_NAME    : Apple Alias Data Handler
      DURATION        : 00:00:00.168000000
File 'pseudo.mkv' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (ffv1 (native) -> ffv1 (native))
  Stream #0:1 -> #0:1 (pcm_s24le (native) -> ac3 (native))
Press [q] to stop, [?] for help
[AVFilterGraph @ 0x3b0b460] No such filter: 'ymax'
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!


More information about the ffmpeg-user mailing list