简体   繁体   English

FFmpeg UHD编码(配接到x265)

[英]FFmpeg UHD encoding (piping to x265)

Update based on the good answers: 根据好的答案进行更新:

Source: Prores HQ 4:2:2 10bit 4kp25 REC:2020 来源:Prores HQ 4:2:2 10bit 4kp25 REC:2020

Heres my syntax now: 现在是我的语法:

ffmpeg -pix_fmt yuv422p10 -i JUNGLES_PLUTO_UHD_HDR_HLG.mov -pix_fmt yuv420p10 -f yuv4mpegpipe - | x265 --y4m - --input-res 3840x2160 --fps 25 --preset veryslow --b-adapt 2 --ref 4 --no-open-gop --keyint 50 --min-keyint 50 --no-scenecut --profile main --level-idc 5 --no-high-tier --sar 1:1 --colorprim bt709 --transfer bt709 --colormatrix bt709 --bframes 3 --hrd --vbv-bufsize 25000 --bitrate 25000 --vbv-maxrate 25000 --aud --no-info --b-pyramid -o test.h265

output: Option pixel_format not found. 

Target: (non-hdr UHD STB) 目标:(非高清UHD STB)

hevc.file 
rec:709
  • Question 1: How does one pipe correctly from ffmpeg to x265 ? 问题1:如何从ffmpeg到x265正确传输管道?
  • Question 2: How can one make sure the cpus are all taxed? 问题2:如何确保对cpu全部征税? I have 16vcores, but im getting like 2-3% usage on all 我有16个vcore,但即时通讯的使用率却只有2-3%
  • Question 3: Any suggestions on the parameters to increase the quality? 问题3:对提高质量的参数有何建议?
  • Question 4: Since the content is BT2020, but my target device is not currently able to display/render BT2020, but BT709.. how would i change the syntax to enable this in the best way..(downscale it) Would : 问题4:由于内容是BT2020,但我的目标设备当前无法显示/渲染BT2020,但是BT709 ..我将如何更改语法以最佳方式启用它。

    --colorprim bt2020 --transfer bt2020 --colormatrix bt709 --colorprim bt2020-转让bt2020 --colormatrix bt709

be correct? 是对的吗?

Option pixel_format not found.

Remove the -pix_fmt yuv422p10 input option. 删除-pix_fmt yuv422p10输入选项。 This isn't needed because your input is not rawvideo and ffmpeg can automatically detect it from your input file. 这不是必需的,因为您的输入不是rawvideo,并且ffmpeg可以从您的输入文件中自动检测到它。

Question 1: How does one pipe correctly from ffmpeg to x265 ? 问题1:如何从ffmpeg到x265正确传输管道?

Avoiding the piping 避免管道

If your ffmpeg supports libx265 then you don't even need to pipe: 如果您的ffmpeg支持libx265,那么您甚至不需要管道:

ffmpeg -i input.mov -c:v libx265 -crf 28 output.mp4

Using a pipe 使用管道

You didn't provide any output from ffmpeg . 您没有提供ffmpeg任何输出。 When piping you can use - as the output. 进行管道输送时,可以使用-作为输出。

ffmpeg -i input.mov -f yuv4mpegpipe - | x265 --y4m - -o output.265
  • The input is MOV, so this container has the pixel format, size, and frame rate info included, so you can omit all of your input options. 输入为MOV,因此此容器包含像素格式,大小和帧频信息,因此您可以省略所有输入选项。 Also, as Andrey mentioned in a comment, you won't need -f rawvideo either because it will override the automatic selection of the MOV demuxer. 另外,正如安德烈(Andrey)在评论中提到的那样,您也不需要-f rawvideo ,因为它将覆盖MOV多路-f rawvideo的自动选择。

  • If the you are actually inputting rawvideo then you would need the additional options, but they should be changed: -pxt_fmt to -pixel_format , -s to -video_size , and -r to -framerate as shown in the rawvideo demuxer documentation . 如果您实际上是在输入rawvideo,则需要其他选项,但应将其更改: -pxt_fmt-pixel_format-s-video_size ,以及-r-framerate ,如rawvideo demuxer文档中所示

  • Use -f yuv4mpegpipe not -t yuv4mpegpipe . 使用-f yuv4mpegpipe而不是-t yuv4mpegpipe

  • You don't need to declare --input-res or --fps with Y4M inputs for x265. 您无需为x265的Y4M输入声明--input-res--fps

Question 2: How can one make sure the cpus are all taxed? 问题2:如何确保对cpu全部征税? I have 16vcores, but im getting like 2-3% usage on all 我有16个vcore,但即时通讯的使用率却只有2-3%

You can run multiple encoding instances at once. 您可以一次运行多个编码实例。

Question 3: Any suggestions on the parameters to increase the quality? 问题3:对提高质量的参数有何建议?

Use --crf instead of --bitrate . 使用--crf而不是--bitrate A lower value is a higher quality. 较低的值表示较高的质量。 Range is 0-51. 范围是0-51。 See FFmpeg Wiki: H.265 . 参见FFmpeg Wiki:H.265

Question 4: Since the content is BT2020, but my target device is not currently able to display/render BT2020, but BT709.. how would i change the syntax to enable this in the best way..(downscale it) 问题4:由于内容是BT2020,但我的目标设备当前无法显示/渲染BT2020,但可以显示/渲染BT709 ..我将如何更改语法以最佳方式启用它。

You can downscale with ffmpeg : -vf scale=-2:1080 您可以使用ffmpeg进行降级: -vf scale=-2:1080

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM