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

请问可以通过设置ffmpeg参数实现视频分段保存么(windows版本 4.3.4) #130

Closed
ordinaryhub opened this issue Nov 12, 2023 · 2 comments

Comments

@ordinaryhub
Copy link

辛苦大佬解答疑惑

  1. FFMPEG输出参数默认是 -c copy -movflags frag_keyframe -min_frag_duration 60000000 这个每隔60秒分段的作用是什么?是每隔60秒写入数据到硬盘一次,防止内存占用过高么
  2. 我把 FFMPEG输出参数修改为 -c copy 就是说删掉了后边分割片段的指令,发现可以正常录制,也不会内存占用过高
  3. 我把 FFMPEG输出参数修改为 -c copy -f segment -segment_time 3600 想通过这个指令实现每小时保存一次视频,结果发现不能正常录制。
  4. 请问有什么方法设置这个参数实现视频分段保存么
@WhiteMinds
Copy link
Owner

WhiteMinds commented Nov 13, 2023

FFMPEG输出参数默认是 -c copy -movflags frag_keyframe -min_frag_duration 60000000 这个每隔60秒分段的作用是什么?是每隔60秒写入数据到硬盘一次,防止内存占用过高么

原因可以看这里,主要是为了软件内播放器播放时的加载速度:https://github.com/WhiteMinds/LiveAutoRecord/blob/master/packages/manager/src/manager.ts#L204-L213

请问有什么方法设置这个参数实现视频分段保存么

通过 ffmpeg 参数分段可以参考这里:#62 (comment)
注意保存路径中文件名的改变。

@ordinaryhub
Copy link
Author

感谢作者!

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

No branches or pull requests

2 participants