视频归一化与ffmpeg [英] video normalization with ffmpeg

查看:361
本文介绍了视频归一化与ffmpeg的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有使用ffmpeg脚本将视频亮度归一化到其完整的动态范围?我一直在试图用lutyuv这样做:

Is there anyway to use ffmpeg script to normalize a video luma to its complete dynamic range? I have been trying to do this with lutyuv like this:

ffmpeg -i input.mp4 -vf lutyuv = y ='((val - minval)* 255)/ (maxval - minval)'output.mp4

ffmpeg -i input.mp4 -vf lutyuv=y='((val - minval)*255)/(maxval - minval)' output.mp4

但输出视频与输入完全相同。 (我相信输入没有使用它的完整的动态范围)

but the output video is just exactly the same as the input. (I am sure the input does not use it's complete dynamic range)

任何人都可以帮助我吗?

Can anyone help me please?

谢谢你很多

推荐答案

尝试

ffmpeg -i input.mp4 -vf scale=out_range=full -color_range 2 -pix_fmt yuvj420p output.mp4

我相信,由于您的输入被标记为有限,没有设置输出范围,FFmpeg可能会重新调整过滤器输出。

I believe that since your input is flagged as limited and no range is set for output, FFmpeg probably rescales the filter output.

scale filter with out_range = full 将值扩展为 0-255 color_range 2 将输出标记为全范围。 -pix_fmt yuvj420p 只是放在那里作为一个安全,以防FFmpeg看到像素格式是默认的 yuv420p 和自动 - 压缩范围。 yuvj420p 是全系列的 yuv420p 这以前是一个问题,但不应该是现在。

The scale filter with out_range=full expands the values to 0-255. color_range 2 tags the output as full range. -pix_fmt yuvj420p is just put in there as a safety in case FFmpeg sees the pixel format is the default yuv420p and auto-compresses the range. yuvj420p is yuv420p with full range. This used to be an issue earlier, but shouldn't be now.

这篇关于视频归一化与ffmpeg的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆