lisamelton / other_video_transcoding

Other tools to transcode videos.
MIT License
555 stars 26 forks source link

Update handling of BT.470 BG color transfer #122

Closed jwoldan closed 2 years ago

jwoldan commented 2 years ago

ffmpeg does not support a passing a bt470bg value for color_trc. Based on https://ffmpeg.org/ffmpeg-codecs.html, the equivalent value is gamma28. This update maps the bt470bg value to gamma28 when setting color_trc.

There may be other similar values that need to be mapped but this is the only one I've encountered in my own testing.

I encountered this issue when transcoding some older videos.

lisamelton commented 2 years ago

@jwoldan Thanks for the patch! I actually fixed this bug some time ago but real life got in the way and I forgot to check in the code.

Your change will work but only for bt470bg. A complete fix should also handle bt470m which would map to gamma22.

So, I will try to check in my change later tonight.

jwoldan commented 2 years ago

Makes sense, I saw the gamma22 <-> bt470m mapping in the options but didn't have a video to test with. That said, I'm open to updating my change if that's easier.

lisamelton commented 2 years ago

@jwoldan My apologies for both missing your last comment and taking so long to respond. I actually just checked in the fix for this that I made some time ago.

jwoldan commented 2 years ago

Thanks!