1

I am working on a recipe to convert Avid DNxHD files which are rec.709 "legal" range (15-235 in 8bpc) to .png files which are "full" range (0-255). In looking around it seems that "colorspace" could do this, but I am quite new to FFMPEG filters and I can't seem to get it to work... I've looked all over the place but not found a solution to this simple question

-i video.mov -fv yadif=0:0:0,colorspace=srgb transcode_%04d.png just throws an error, and I assume I just don't know the proper syntax (no real example for this in the manual, that I could find).

Separately i thought this might work: -i video.mov -vf yadif=0:0:0,scale=in_range=tv:out_range=full transcode_%04d.png. This runs without complaining, but the output .png's are still in legal range.

  • How are you checking pixel values? – Gyan Sep 20 '18 at 6:35
  • @Gyan Pulling into After Effects and color sampling. I've got a file exported from Avid as legal, and another as full to compare against. – Spencer Sep 20 '18 at 18:27
  • Take an input which has pure white or black in it and run: ffmpeg -i video.mov -vf trim=end_frame=1,signalstats@pre,format=rgb24,signalstats@post test.png I assume the black/white portion is visible in the first frame. If not, add -ss X before -i where X should be a timestamp of a frame that has white/black in it. Share log. Add 2> log.txt at end of cmd to generate it. – Gyan Sep 21 '18 at 5:55
  • @Guyan I figured it out if you're interested! I just didn't fully understand filter chaining syntax in ffmpeg, and didn't realize that ffmpeg will automatically default to "full" range as long as I tell it that the source is "tv"... – Spencer Sep 25 '18 at 22:53
  • That's not correct. Output range is determined by destination pixel format, which in turn depends on the pixel formats the encoder allows. full is not an automatic outcome. – Gyan Sep 26 '18 at 4:48
1

Whelp finally figured this one out when I stumbled across the answer in another forum. Pretty simple really, just needed to study up on filtergraphs. And for the record bwdif deinterlacing is FAR better than yadif! Not sure why anyone even recommends yadif anymore with bwdif out there...

-i inputfile -vf bwdif=0:0:0,scale=in_range=tv outputfile.mov

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.