请选择 进入手机版 | 继续访问电脑版

ChinaFFmpeg

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1881|回复: 8

[Windows] ffmpeg+H.265+CBR软编码如何实现?

[复制链接]
发表于 2022-6-29 16:50:14 | 显示全部楼层 |阅读模式
请教群里的大牛,ffmpeg如何实现libx265的CBR模式软编码?
我试了libx264使用-x264-params nal-hrd=cbr:force-cfr=1就可以实现CBR模式,但nal-hrd=cbr:force-cfr=1在libx265中不生效,请群里面的老师多指教,万分感谢!
回复

使用道具 举报

发表于 2022-7-4 16:00:51 | 显示全部楼层
[AppleScript] 纯文本查看 复制代码
Bitstream options:
   --[no-]repeat-headers         Emit SPS and PPS headers at each keyframe. Default disabled
   --[no-]info                   Emit SEI identifying encoder and parameters. Default enabled
   --[no-]hrd                    Enable HRD parameters signaling. Default disabled
   --[no-]idr-recovery-sei      Emit recovery point infor SEI at each IDR frame
   --[no-]temporal-layers        Enable a temporal sublayer for unreferenced B frames. Default disabled
   --[no-]aud                    Emit access unit delimiters at the start of each access unit. Default disabled
   --hash <integer>              Decoded Picture Hash SEI 0: disabled, 1: MD5, 2: CRC, 3: Checksum. Default 0
   --atc-sei <integer>           Emit the alternative transfer characteristics SEI message where the integer is the preferred transfer characteristics. Default disabled
   --pic-struct <integer>        Set the picture structure and emits it in the picture timing SEI message. Values in the range 0..12. See D.3.3 of the HEVC spec. for a detailed explanation.
   --log2-max-poc-lsb <integer>  Maximum of the picture order count
   --[no-]vui-timing-info        Emit VUI timing information in the bistream. Default enabled
   --[no-]vui-hrd-info           Emit VUI HRD information in the bistream. Default enabled
   --[no-]opt-qp-pps             Dynamically optimize QP in PPS (instead of default 26) based on QPs in previous GOP. Default disabled
   --[no-]opt-ref-list-length-pps  Dynamically set L0 and L1 ref list length in PPS (instead of default 0) based on values in last GOP. Default disabled
   --[no-]multi-pass-opt-rps     Enable storing commonly used RPS in SPS in multi pass mode. Default disabled
   --[no-]opt-cu-delta-qp        Optimize to signal consistent CU level delta QPs in frame. Default disabled


看x265的帮助信息里面是这样的,会不会使用姿势变了?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-7-5 14:11:27 | 显示全部楼层
本帖最后由 whitelxl 于 2022-7-5 14:15 编辑

x265里面是这样的参数形式-x265-params strict-cbr=1,我现在输出整片是CBR形式了,可是切片输出就成VBR了,请大师兄指教,谢谢。
ffmpeg -i 1.ts -b:v 4000k -muxrate 4000k -c:v libx265 -x265-params strict-cbr=1:vbv-maxrate=4000:vbv-bufsize=4000  -c:a copy -t 20 -hls_time 10 out.m3u8
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-7-5 14:14:49 | 显示全部楼层
孙悟空 发表于 2022-7-4 16:00
[mw_shl_code=applescript,true]Bitstream options:
   --[no-]repeat-headers         Emit SPS and PPS h ...

谢谢大师兄!
是的,x265里面是这样的参数形式-x265-params strict-cbr=1,我现在输出整片是CBR形式了,可是切片输出就成VBR了,请大师兄指教,谢谢。
我的命令如下:
ffmpeg -i 1.ts -b:v 4000k -muxrate 4000k -c:v libx265 -x265-params strict-cbr=1:vbv-maxrate=4000:vbv-bufsize=4000  -c:a copy -t 20 -hls_time 10 out.m3u8
回复 支持 反对

使用道具 举报

发表于 2022-7-12 16:51:10 | 显示全部楼层
whitelxl 发表于 2022-7-5 14:14
谢谢大师兄!
是的,x265里面是这样的参数形式-x265-params strict-cbr=1,我现在输出整片是CBR形式了, ...

vbr的话,可能还是和压缩方式有关系,可以考虑控制vbv buffer. max rate 和min rate做到实际控制
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|Archiver|ChinaFFmpeg

GMT+8, 2024-3-29 22:07 , Processed in 0.062323 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表