gpt4 book ai didi

c# - 记录桌面保存每 30 分钟

转载 作者:行者123 更新时间:2023-11-30 20:50:10 25 4
gpt4 key购买 nike

这是我的与同一问题相关的问题:

better way to record desktop via ffmpeg

我有这个命令:ffmpeg -f dshow -i video="screen-capture-recorder"-r 30 -t 10 E:\test01.flv

我对此很满意,但我想知道我是否可以每 30 分钟保存一次,这样如果断电,我只会损失最后 30 分钟。

我使用 C# 来启动和隐藏 ffmpeg cmd,所以我想知道如何让它每 30 次保存到相同的 test01.flv分钟?

最佳答案

一种方法是使用 segment muxer :

ffmpeg -f dshow -framerate 30 -i video="screen-capture-recorder" -f segment \
-segment_time 1800 out%03d.flv
  • 来自 docs :

    Note that if you want accurate splitting for a video file, you need to make the input key frames correspond to the exact splitting times expected by the segmenter, or the segment muxer will start the new segment with the key frame found next after the specified start time.

  • 这将生成名为:out001.flvout002.flvout003.flv 等的输出文件。

  • 一个问题是,如果重新调用该命令,它将尝试使用相同的输出文件名。

  • 我从您的命令中删除了 -r 30 并将其更改为 -framerate 30 作为 dshow input device选项。否则,由于默认输入帧速率为 25,ffmpeg 将复制帧以达到您想要的输出帧速率 30。如果您仅提供输入帧速率,则输出将使用相同的帧速率并避免丢弃或复制帧以进行补偿。

关于c# - 记录桌面保存每 30 分钟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22763031/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com