Answers.Body: <p>I have managed to create a working recipe using curves - whilst not strictly a log to lin lut, it gives a more watchable output.</p>
  <p><code>for %%a in (&quot;*.mkv&quot;) do ffmpeg -i &quot;%%a&quot; -i .\THE_LOGO.png -c:v libx264 -crf 23 -maxrate 10M -bufsize 2M -c:a aac -b:a 192k -filter_complex &quot;yadif, format=yuv420p, curves=all='0/0 0.5/0.75 1/1', curves=increase_contrast, negate, [1]scale2ref=w=oh*mdar:h=ih*0.17[logo][video];[video][logo]overlay=100:100, drawtext='fontfile=c\:/Windows/Fonts/Arial.ttf': timecode='00\:00\:00\:00': r=25: x=(w-tw)/2: y=h-(2.2*lh) :fontsize=150 :fontcolor=white: box=1: boxcolor=black: boxborderw=7&quot; -color_primaries bt709 -color_trc bt709 -colorspace bt709 -y &quot;%%~na_BITC.mp4&quot;</code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-03T19:57:24.163Z
Answers.LastActivityDate: 2023-04-03T19:57:24.163Z
Answers.UserDisplayName: jim_e_jib
Body: <p>I'm making some viewing files of some neg film scans. The film scans are converted to FFV1.mkv using rawcooked and then I have an ffmpeg recipe to create the viewing files.</p>
  <p>I have managed to convert from neg to pos, but would also like to change the colour space from log to lin so the viewing files are a bit easier to watch.</p>
  <p>Is this possible in ffmpeg?</p>
  <p>My recipe so far :</p>
  <p><code>for %%a in (&quot;*.mkv&quot;) do ffmpeg -i &quot;%%a&quot; -i .\THE_LOGO.png -c:v libx264 -crf 23 -maxrate 5M -bufsize 2M -c:a aac -b:a 192k -filter_complex &quot;yadif, format=yuv420p, negate, [1]scale2ref=w=oh*mdar:h=ih*0.17[logo][video];[video][logo]overlay=290:48, drawtext='fontfile=c\:/Windows/Fonts/Arial.ttf': timecode='00\:00\:00\:00': r=25: x=(w-tw)/2: y=h-(2.2*lh) :fontsize=100 :fontcolor=white: box=1: boxcolor=black: boxborderw=7&quot; -y &quot;%%~na_BITC.mp4&quot;</code></p>
  <p>Many thanks :-)</p>
  
Tags: <ffmpeg>
Title: Converting a log colour space to linear using ffmpeg
UserDisplayName: jim_e_jib
ThreadText: # Converting a log colour space to linear using ffmpeg
  
  (Asked by: username_0 on 2023-03-30)
  
  I'm making some viewing files of some neg film scans. The film scans are converted to FFV1.mkv using rawcooked and then I have an ffmpeg recipe to create the viewing files.
  
  I have managed to convert from neg to pos, but would also like to change the colour space from log to lin so the viewing files are a bit easier to watch.
  
  Is this possible in ffmpeg?
  
  My recipe so far :
  
  `for %%a in ("*.mkv") do ffmpeg -i "%%a" -i .\THE_LOGO.png -c:v libx264 -crf 23 -maxrate 5M -bufsize 2M -c:a aac -b:a 192k -filter_complex "yadif, format=yuv420p, negate, [1]scale2ref=w=oh*mdar:h=ih*0.17[logo][video];[video][logo]overlay=290:48, drawtext='fontfile=c\:/Windows/Fonts/Arial.ttf': timecode='00\:00\:00\:00': r=25: x=(w-tw)/2: y=h-(2.2*lh) :fontsize=100 :fontcolor=white: box=1: boxcolor=black: boxborderw=7" -y "%%~na_BITC.mp4"`
  
  Many thanks :-)
  
  **Tags:** ffmpeg
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2023-04-03. Score: 0 | Accepted answer
  
  I have managed to create a working recipe using curves - whilst not strictly a log to lin lut, it gives a more watchable output.
  
  `for %%a in ("*.mkv") do ffmpeg -i "%%a" -i .\THE_LOGO.png -c:v libx264 -crf 23 -maxrate 10M -bufsize 2M -c:a aac -b:a 192k -filter_complex "yadif, format=yuv420p, curves=all='0/0 0.5/0.75 1/1', curves=increase_contrast, negate, [1]scale2ref=w=oh*mdar:h=ih*0.17[logo][video];[video][logo]overlay=100:100, drawtext='fontfile=c\:/Windows/Fonts/Arial.ttf': timecode='00\:00\:00\:00': r=25: x=(w-tw)/2: y=h-(2.2*lh) :fontsize=150 :fontcolor=white: box=1: boxcolor=black: boxborderw=7" -color_primaries bt709 -color_trc bt709 -colorspace bt709 -y "%%~na_BITC.mp4"`
  
  
  ---
  
  