Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议 添加 视频预先转码降帧率 功能,加快转换速度 #292

Open
zip11 opened this issue Jan 11, 2024 · 3 comments
Open

建议 添加 视频预先转码降帧率 功能,加快转换速度 #292

zip11 opened this issue Jan 11, 2024 · 3 comments
Labels
suggestion Good for newcomers

Comments

@zip11
Copy link

zip11 commented Jan 11, 2024

想加快 转字幕的速度

查看github lssues ,建议把视频预先 转换成 15帧 每秒,对原始视频是 60帧 120帧,减少了处理的数据量,加快提取速度。

调用 ffmpeg软件,使用nVidia 硬件解码,再用nvenc 硬件编码,preset fast 2小时的视频 30fps 5分钟就转好了

::下面是 批处理命令

set vf="input.mp4"
set vfn="new.mp4"
ffmpeg -hwaccel cuvid -c:v h264_cuvid -i %vf% -c:v h264_nvenc -r 15 -preset fast %vfn%

我测试确实可以提高速度,时间少了50%

建议,作者添加 视频预先转码降帧率 功能,加快转换速度

@YaoFANGUK
Copy link
Owner

可以的

@YaoFANGUK YaoFANGUK added the suggestion Good for newcomers label Jan 12, 2024
@Zsural
Copy link

Zsural commented Mar 26, 2024

本人测试了这个方法,其本质是采用抽帧的方式使得需要处理的帧数减半,从而维持了视频相同的长度,因为需要处理的帧数减半了,所以耗费的时间也减少了50%,但是抽帧处理后的视频时间轴基本不变。建议在精准模式下使用。

@eritpchy
Copy link
Contributor

这和config.EXTRACT_FREQUENCY直接翻倍有什么区别, 你只要把main.py:145中的extract_frame_by_det() 强行改成extract_frame_by_fps() 直接开启就自带跳帧了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants