You've already forked FrameTour-RenderWorker
- 统一归零视频起始时间戳,避免源素材非 0 起始 PTS 造成封装后首帧冻结 - 修改 setpts 滤镜表达式为 setpts=PTS-STARTPTS 格式 - 为所有速度调整场景应用标准化的时间戳处理 - 添加视频编码参数测试文件,确保 B 帧在各种硬件加速下被禁用 - 为软件、QSV 和 CUDA 硬件加速添加 B 帧禁用测试用例
26 lines
703 B
Python
26 lines
703 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
from constant import HW_ACCEL_CUDA, HW_ACCEL_NONE, HW_ACCEL_QSV
|
|
from handlers.base import get_video_encode_args
|
|
|
|
|
|
def _assert_bframe_disabled(args):
|
|
assert '-bf' in args
|
|
bf_index = args.index('-bf')
|
|
assert args[bf_index + 1] == '0'
|
|
|
|
|
|
def test_get_video_encode_args_disable_b_frames_for_software():
|
|
args = get_video_encode_args(HW_ACCEL_NONE)
|
|
_assert_bframe_disabled(args)
|
|
|
|
|
|
def test_get_video_encode_args_disable_b_frames_for_qsv():
|
|
args = get_video_encode_args(HW_ACCEL_QSV)
|
|
_assert_bframe_disabled(args)
|
|
|
|
|
|
def test_get_video_encode_args_disable_b_frames_for_cuda():
|
|
args = get_video_encode_args(HW_ACCEL_CUDA)
|
|
_assert_bframe_disabled(args)
|