pseudocolor and general filter syntax

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

pseudocolor and general filter syntax

Kieran O Leary
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!
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: pseudocolor and general filter syntax

Paul B Mahol
On 8/26/17, Kieran O Leary <[hidden email]> wrote:
> 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.

amax/ymax.. are valid as described in documentation, that way you do get
working filter example for both 8bit and 10bit video.

You do not change example in any way, why you removed ' chars?

' is important because it says to escape ","
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: pseudocolor and general filter syntax

Kieran O Leary
On 26 Aug 2017 1:51 pm, "Paul B Mahol" <[hidden email]> wrote:

On 8/26/17, Kieran O Leary <[hidden email]> wrote:
> 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.

amax/ymax.. are valid as described in documentation, that way you do get
working filter example for both 8bit and 10bit video.

You do not change example in any way, why you removed ' chars?

' is important because it says to escape ","


Damn, sorry. I think I initially copy pasted the example as is from the
documentation and I got the same error. Then I switched the single quotes
to double quotes to see if that would make a difference. I can't test again
until tomorrow, but thanks for clarifying.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: pseudocolor and general filter syntax

Paul B Mahol
On 8/26/17, Kieran O Leary <[hidden email]> wrote:

> On 26 Aug 2017 1:51 pm, "Paul B Mahol" <[hidden email]> wrote:
>
> On 8/26/17, Kieran O Leary <[hidden email]> wrote:
>> 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.
>
> amax/ymax.. are valid as described in documentation, that way you do get
> working filter example for both 8bit and 10bit video.
>
> You do not change example in any way, why you removed ' chars?
>
> ' is important because it says to escape ","
>
>
> Damn, sorry. I think I initially copy pasted the example as is from the
> documentation and I got the same error. Then I switched the single quotes
> to double quotes to see if that would make a difference. I can't test again
> until tomorrow, but thanks for clarifying.

Ah, put everything also into ""
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: pseudocolor and general filter syntax

Kieran O Leary
On Sat, Aug 26, 2017 at 2:12 PM, Paul B Mahol <[hidden email]> wrote:

>
> Ah, put everything also into ""
>
>
Done: all works perfectly. Thanks for your help and for writing this
filter. I look forward to messing around with it further.

-K
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".