gpt4 book ai didi

ffmpeg 段复用器产生无法播放的 HEVC 视频输出

转载 作者:行者123 更新时间:2023-12-04 22:59:49 24 4
gpt4 key购买 nike

我正在尝试使用 ffmpeg 处理来自 USB 网络摄像头的流式视频数据。该过程涉及将原始数据编码为 hevc 格式。到目前为止,我能够做到。
但现在,我想以 10 秒为单位对处理后的数据进行切片并将其保存在单独的文件中。这应该重复,直到我手动终止/中断该过程。

ffmpeg -i /dev/video1 -f segment -segment_times 10 -c:v hevc cam_1_%02d.mp4

上面的代码确实创建了多个文件,但只有第一个文件可以使用 vlc 读取;其他文件看起来已损坏。

当我运行命令时,我可以看到以下消息:-
Stream mapping:  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264)) Press [q] to stop, [?] for help Past duration 0.601555 too largeN/A time=00:00:14.63 bitrate=N/A dup=11 drop=0      Past duration
0.601463 too large Past duration 0.601555 too largeN/A time=00:00:15.16 bitrate=N/A dup=11 drop=0 Past duration 0.601585 too large
Last message repeated 1 times Past duration 0.601646 too large Past duration 0.601677 too large Past duration 0.601707 too largeN/A time=00:00:15.66 bitrate=N/A dup=11 drop=0

我在这里想念什么?

最佳答案

添加 -reset_timestamps 1输出选项。来自 segment muxer documentation :

Reset timestamps at the beginning of each segment, so that each segment will start with near-zero timestamps. It is meant to ease the playback of the generated segments. May not work with some combinations of muxers/codecs. It is set to 0 by default.



另外,考虑更改 -segment_times-segment_time因为你是一个单一的时间值(value)。

关于ffmpeg 段复用器产生无法播放的 HEVC 视频输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46348926/

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