Answers.Body: <p>This is the original expression to be implemented.</p>
  
  <pre><code>x &gt; 0.14996582 ? (pow(10,0, (x - 0.385537) / 0.2471896) - 0.0522720) / 5.5555556 : (x - 0.092809) / 5.367655
  </code></pre>
  
  <p>where <code>x</code> is the pixel intensity normalized to [0,1]. <code>x</code> is linear, so gamma returns identity. </p>
  
  <p>I'm going to assume the <code>0</code> in the pow expression is an extraneous arg since the linked reference at <a href="http://strattoncamera.com/pdf/11-06-30_Alexa_LogC_Curve.pdf" rel="nofollow noreferrer">http://strattoncamera.com/pdf/11-06-30_Alexa_LogC_Curve.pdf</a> depicts pow() as having only two arguments. I'm also assuming that the input is 16-bit full-range integer RGB.</p>
  
  <pre><code>ffmpeg -apply_trc linear -i in%d.exr
         -vf "lutrgb=r='if(gt(val/maxval,0.14996582),maxval*((pow(10, (val/maxval-0.385537)/0.2471896)-0.0522720)/5.5555556),maxval*((val/maxval-0.092809)/5.367655))':
                     g='if(gt(val/maxval,0.14996582),maxval*((pow(10, (val/maxval-0.385537)/0.2471896)-0.0522720)/5.5555556),maxval*((val/maxval-0.092809)/5.367655))':
                     b='if(gt(val/maxval,0.14996582),maxval*((pow(10, (val/maxval-0.385537)/0.2471896)-0.0522720)/5.5555556),maxval*((val/maxval-0.092809)/5.367655))'"
          out%d.tiff
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-02T07:21:52.500Z
Answers.Text: Thanks for much for helping out @gyan, tried it and its still blown out but seems this is definitely the filter to use, the highlights got completely blown up
Answers.UserDisplayName: tankbusta
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-02T08:29:25.090Z
Answers.Text: You need to verify range and the expr. How are you viewing the TIFFs?
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-02T08:34:46.643Z
Answers.Text: doing it in nuke / after effects and i need it to output EXR's not TIFFS but both are ok :)
Answers.UserDisplayName: tankbusta
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-02T08:53:05.800Z
Answers.Text: FFmpeg does not have an EXR encoder. Are you sure the input is full range?
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-02T09:34:28.330Z
Answers.Text: i meant to type i want the output to be mov eventually when i can sticth the files but im just viwing the images in after effects
Answers.UserDisplayName: tankbusta
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-02T09:34:39.257Z
Answers.Text: also yes input is full range as nuke handles it just fine
Answers.UserDisplayName: tankbusta
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-02T13:40:31.560Z
Answers.Text: I ended up doing it in OpenImageIO, FFMPEG couldn't do the job for me
Answers.UserDisplayName: tankbusta
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-02T05:57:38.397Z
Answers.LastActivityDate: 2018-10-02T05:57:38.397Z
Answers.UserDisplayName: Gyan
Body: <p>Im trying to use a expression from NUKE (to convert an exr sequence from its native format into AlexaLogC. Now ive got an expression from nuke which is the following</p>
  
  <pre><code>x &gt; 0.14996582 ? (pow(10,0, (x - 0.385537) / 0.2471896) - 0.0522720) / 5.5555556 : (x - 0.092809) / 5.367655 
  </code></pre>
  
  <p>been trying to find a spot to place this inside a FFMPEG filter to allow it to bring my footage to the right starting point so i can apply the lut from on set on it.</p>
  
  <p>Was wondering if anybody here had advice on how to correctly filter this into ffmpeg.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-01T13:15:34.037Z
Comments.Text: That expr looks like it works on normalized values. What is the pixel format? RGB 16-bit? pow has three arguments - what is the definition?
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-01T15:45:36.080Z
Comments.Text: RGB 16BIT yeahw
Comments.UserDisplayName: tankbusta
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-01T15:46:03.077Z
Comments.Text: Basically need ffmpeg to being it to the alexa color space so i can use a lut on it from DI
Comments.UserDisplayName: tankbusta
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-01T16:06:08.520Z
Comments.Text: pow has three arguments - what is the definition?
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-01T16:15:34.580Z
Comments.Text: @Gyan its not HDR
Comments.UserDisplayName: tankbusta
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-01T16:16:49.750Z
Comments.Text: 2048 X 968 Alexa Scan maybe it is HDR who knows but the whites are blown out and they come in better when i use the alexalogc curve in nuke need that in ffmpeg
Comments.UserDisplayName: tankbusta
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-01T16:21:29.133Z
Comments.Text: I still need the definition of nuke's 3-arg pow function that is shown here.
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-01T16:22:36.247Z
Comments.Text: @Gyan where can i get that info ? i just copy pasted the expression from nukes color preferences
Comments.UserDisplayName: tankbusta
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-01T16:32:07.653Z
Comments.Text: Probably the manual or other Nuke users.
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-01T16:36:32.313Z
Comments.Text: @Gyan so assuming i get that there is a way to fire this into ffmpeg ?
Comments.UserDisplayName: tankbusta
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-01T16:57:18.167Z
Comments.Text: yes, using a combination of filters
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-01T16:59:42.657Z
Comments.Text: @Gyan im looking around now for it
Comments.UserDisplayName: tankbusta
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-01T17:00:08.443Z
Comments.Text: @Gyan cuz this is just the basic AlexaV3LogC curve from nuke
Comments.UserDisplayName: tankbusta
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-01T17:00:40.743Z
Comments.Text: @Gyan
  http://strattoncamera.com/pdf/11-06-30_Alexa_LogC_Curve.pdf
Comments.UserDisplayName: tankbusta
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-01T17:09:28.450Z
Comments.Text: I only see two args in `(t > e * cut + f) ? (pow(10, (t - d) / c) - b) / a: (t - f) / e`
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-01T17:14:26.850Z
Comments.Text: @Gyan yeah i guess thats all i could find on it
Comments.UserDisplayName: tankbusta
Tags: <ffmpeg>
Title: Where to input a log expression in FFMPEG
UserDisplayName: tankbusta
ThreadText: # Where to input a log expression in FFMPEG
  
  (Asked by: username_0 on 2018-10-01)
  
  Im trying to use a expression from NUKE (to convert an exr sequence from its native format into AlexaLogC. Now ive got an expression from nuke which is the following
  
  ```
  x > 0.14996582 ? (pow(10,0, (x - 0.385537) / 0.2471896) - 0.0522720) / 5.5555556 : (x - 0.092809) / 5.367655 
  
  ```
  
  been trying to find a spot to place this inside a FFMPEG filter to allow it to bring my footage to the right starting point so i can apply the lut from on set on it.
  
  Was wondering if anybody here had advice on how to correctly filter this into ffmpeg.
  
  **Tags:** ffmpeg
  
  > **Comments:**
  > **username_1**: That expr looks like it works on normalized values. What is the pixel format? RGB 16-bit? pow has three arguments - what is the definition?  
  > **username_0**: RGB 16BIT yeahw  
  > **username_0**: Basically need ffmpeg to being it to the alexa color space so i can use a lut on it from DI  
  > **username_1**: pow has three arguments - what is the definition?  
  > **username_0**: @username_1 its not HDR  
  > **username_0**: 2048 X 968 Alexa Scan maybe it is HDR who knows but the whites are blown out and they come in better when i use the alexalogc curve in nuke need that in ffmpeg  
  > **username_1**: I still need the definition of nuke's 3-arg pow function that is shown here.  
  > **username_0**: @username_1 where can i get that info ? i just copy pasted the expression from nukes color preferences  
  > **username_1**: Probably the manual or other Nuke users.  
  > **username_0**: @username_1 so assuming i get that there is a way to fire this into ffmpeg ?  
  > **username_1**: yes, using a combination of filters  
  > **username_0**: @username_1 im looking around now for it  
  > **username_0**: @username_1 cuz this is just the basic AlexaV3LogC curve from nuke  
  > **username_0**: @username_1 http://strattoncamera.com/pdf/11-06-30_Alexa_LogC_Curve.pdf  
  > **username_1**: I only see two args in `(t > e * cut + f) ? (pow(10, (t - d) / c) - b) / a: (t - f) / e`  
  > **username_0**: @username_1 yeah i guess thats all i could find on it  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-10-02. Score: 0
  
  This is the original expression to be implemented.
  
  ```
  x > 0.14996582 ? (pow(10,0, (x - 0.385537) / 0.2471896) - 0.0522720) / 5.5555556 : (x - 0.092809) / 5.367655
  
  ```
  
  where `x` is the pixel intensity normalized to [0,1]. `x` is linear, so gamma returns identity.
  
  I'm going to assume the `0` in the pow expression is an extraneous arg since the linked reference at <http://strattoncamera.com/pdf/11-06-30_Alexa_LogC_Curve.pdf> depicts pow() as having only two arguments. I'm also assuming that the input is 16-bit full-range integer RGB.
  
  ```
  ffmpeg -apply_trc linear -i in%d.exr
         -vf "lutrgb=r='if(gt(val/maxval,0.14996582),maxval*((pow(10, (val/maxval-0.385537)/0.2471896)-0.0522720)/5.5555556),maxval*((val/maxval-0.092809)/5.367655))':
                     g='if(gt(val/maxval,0.14996582),maxval*((pow(10, (val/maxval-0.385537)/0.2471896)-0.0522720)/5.5555556),maxval*((val/maxval-0.092809)/5.367655))':
                     b='if(gt(val/maxval,0.14996582),maxval*((pow(10, (val/maxval-0.385537)/0.2471896)-0.0522720)/5.5555556),maxval*((val/maxval-0.092809)/5.367655))'"
          out%d.tiff
  
  ```
  
  > **Comments:**
  > **username_0**: Thanks for much for helping out @username_1, tried it and its still blown out but seems this is definitely the filter to use, the highlights got completely blown up  
  > **username_1**: You need to verify range and the expr. How are you viewing the TIFFs?  
  > **username_0**: doing it in nuke / after effects and i need it to output EXR's not TIFFS but both are ok :)  
  > **username_1**: FFmpeg does not have an EXR encoder. Are you sure the input is full range?  
  > **username_0**: i meant to type i want the output to be mov eventually when i can sticth the files but im just viwing the images in after effects  
  > **username_0**: also yes input is full range as nuke handles it just fine  
  > **username_0**: I ended up doing it in OpenImageIO, FFMPEG couldn't do the job for me  
  
  ---
  
  