gpt4 book ai didi

ffmpeg -f 段在 30 分钟后失败

转载 作者:行者123 更新时间:2023-12-04 23:25:40 26 4
gpt4 key购买 nike

当我使用下面的命令将从命名管道接收到的视频流转换为 HLS 格式的 .ts 文件时,

sudo ffmpeg -i named_pipe.mkv \
-c:v libx264 -r 10 -g 30 -map 0 \
-qmin 18 -qmax 30 \
-f segment -segment_format mpegts -segment_time 3 \
-segment_list list.m3u8 \
-segment_list_type hls\
-segment_list_size 20 -strftime 1 \
%Y-%m-%d_%Hh%Mm%Ss.ts

大约30分钟后停止工作,速度逐渐下降。
这是它停止工作之前的日志。
*** dropping frame 2461 from stream 0 at ts -11787
[h264 @ 0x5639c4f49440] nal_unit_type: 1, nal_ref_idc: 1
*** dropping frame 2461 from stream 0 at ts -11787
[h264 @ 0x5639c4fde520] nal_unit_type: 1, nal_ref_idc: 1
*** dropping frame 2461 from stream 0 at ts -11787
[h264 @ 0x5639c4ffa4a0] nal_unit_type: 1, nal_ref_idc: 1
*** dropping frame 2461 from stream 0 at ts -11786
[h264 @ 0x5639c5016420] nal_unit_type: 1, nal_ref_idc: 1
*** dropping frame 2461 from stream 0 at ts -11786
[h264 @ 0x5639c50323a0] nal_unit_type: 1, nal_ref_idc: 1
*** dropping frame 2461 from stream 0 at ts -11786
[h264 @ 0x5639c504e320] nal_unit_type: 1, nal_ref_idc: 1
*** dropping frame 2461 from stream 0 at ts -11785
[h264 @ 0x5639c4c46e20] nal_unit_type: 1, nal_ref_idc: 1
*** dropping frame 2461 from stream 0 at ts -11785
*** dropping frame 2461 from stream 0 at ts -11785
*** dropping frame 2461 from stream 0 at ts -11784
*** dropping frame 2461 from stream 0 at ts -11784
*** dropping frame 2461 from stream 0 at ts -11784
*** dropping frame 2461 from stream 0 at ts -11783
*** dropping frame 2461 from stream 0 at ts -11783
*** dropping frame 2461 from stream 0 at ts -11783
*** dropping frame 2461 from stream 0 at ts -11782
*** dropping frame 2461 from stream 0 at ts -11782
*** dropping frame 2461 from stream 0 at ts -11782
*** dropping frame 2461 from stream 0 at ts -11781
*** dropping frame 2461 from stream 0 at ts -11781
*** dropping frame 2461 from stream 0 at ts -11781
*** dropping frame 2461 from stream 0 at ts -11780
*** dropping frame 2461 from stream 0 at ts -11780
[out_0_0 @ 0x5639c4b58b40] EOF on sink link out_0_0:default.
*** dropping frame 2461 from stream 0 at ts -11780
No more output streams to write to, finishing.
[segment @ 0x5639c4b4ab20] stream:0 start_pts_time:243 pts:22131000 pts_time:245.9 dts:22131000 dts_time:245.9 -> pts:22131000 pts_time:245.9 dts:22131000 dts_time:245.9
[segment @ 0x5639c4b4ab20] Opening '/var/www/html/hls/list.m3u8.tmp' for writing
[file @ 0x5639c6510be0] Setting default whitelist 'file,crypto'
[segment @ 0x5639c4b4ab20] EXT-X-MEDIA-SEQUENCE:62
[AVIOContext @ 0x5639c4f01f80] Statistics: 0 seeks, 1 writeouts
[segment @ 0x5639c4b4ab20] segment:'/var/www/html/hls/2018-03-06_15h59m25s.ts' count:81 ended
[AVIOContext @ 0x5639c4d1cca0] Statistics: 0 seeks, 1 writeouts
[segment @ 0x5639c4b4ab20] Opening '/var/www/html/hls/2018-03-06_16h18m11s.ts' for writing
[file @ 0x5639c4b8da80] Setting default whitelist 'file,crypto'

最佳答案

您可以使用 -re 确保输出和命名管道输入的运行速度相同。如果您的输出比输入速率快 -re 将保持进程保持相同的速度而不会停止。

sudo ffmpeg -re -i named_pipe.mkv \
-c:v libx264 -r 10 -g 30 -map 0 \
-qmin 18 -qmax 30 \
-f segment -segment_format mpegts -segment_time 3 \
-segment_list list.m3u8 \
-segment_list_type hls\
-segment_list_size 20 -strftime 1 \
%Y-%m-%d_%Hh%Mm%Ss.ts

关于ffmpeg -f 段在 30 分钟后失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49142067/

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