Python Ffmpeg hls段在5300段后停止分段

Python Ffmpeg hls段在5300段后停止分段,python,ffmpeg,http-live-streaming,Python,Ffmpeg,Http Live Streaming,我正在尝试使用hls、ffmpeg和raspivid制作http视频流,我需要1天的重播时间,但在5300段之后,ffmpeg停止分段,并在一天结束时继续将视频写入5301段(5300/5301是平均数,+-50段) 我有足够的存储空间,我的相机可以记录一整天。唯一的问题是ffmpeg在5300段之后决定停止分段 谢谢你,很抱歉我的英语很差^^ 以下是我的流媒体脚本: base="/var/www/html/" set -x rm -rf /var/www/html/ppc/saves/l

我正在尝试使用hls、ffmpeg和raspivid制作http视频流,我需要1天的重播时间,但在5300段之后,ffmpeg停止分段,并在一天结束时继续将视频写入5301段(5300/5301是平均数,+-50段) 我有足够的存储空间,我的相机可以记录一整天。唯一的问题是ffmpeg在5300段之后决定停止分段

谢谢你,很抱歉我的英语很差^^

以下是我的流媒体脚本:


base="/var/www/html/"

set -x

rm -rf /var/www/html/ppc/saves/live live.h264
mkdir -p /var/www/html/ppc/saves/live

# fifos seem to work more reliably than pipes - and the fact that the
# fifo can be named helps ffmpeg guess the format correctly.
mkfifo live.h264
raspivid -a 1036 -w 1640 -h 1232 -fps 15 -t 37200000 -b 1500000 -o - | psips > live.h264 &

# Letting the buffer fill a little seems to help ffmpeg to id the stream
sleep 2

# Need ffmpeg around 1.0.5 or later. The stock Debian ffmpeg won't work.
# I'm not aware of options apart from building it from source. I have
# Raspbian packags built from Debian Multimedia sources. Available on
# request but I don't want to post them publicly because I haven't cross
# compiled all of Debian Multimedia and conflicts can occur.
ffmpeg -y -r 15 -i live.h264 -f alsa  -i default:CARD=C525 -r:a 48000 -ac 1 -af adelay=32s -c:v copy -c:a aac -b:a 128k -map 0:0 -map 1:0 -r 30 \
 -f segment \
 -segment_time 7 \
 -segment_format mpegts \
 -segment_list /var/www/html/ppc/saves/live/live.m3u8 \
 -segment_list_flags live \
 -segment_list_type m3u8 \
 -initial_offset -9 \
 -strict 2 /var/www/html/ppc/saves/live/%08d.ts < /dev/null```

base=“/var/www/html/”
集合x
rm-rf/var/www/html/ppc/saves/live.h264
mkdir-p/var/www/html/ppc/saves/live
#FIFO似乎比管道工作更可靠——事实上
#可以命名fifo,帮助您正确猜测格式。
mkfifolive.h264
拉斯皮维德-a 1036-w 1640-h 1232-fps 15-t 37200000-b 1500000-o-| psips>live.h264&
#让缓冲区填满一点似乎有助于ffmpeg识别流
睡眠2
#需要1.0.5或更高版本的ffmpeg。Debian ffmpeg的股票不起作用。
#我不知道除了从源代码构建它之外还有什么选择。我有
#从Debian多媒体源构建的Raspbian包。可于
#请求,但我不想公开发布,因为我没有交叉
#编译所有的Debian多媒体和冲突都可能发生。
ffmpeg-y-r 15-i live.h264-f alsa-i默认值:CARD=C525-r:a 48000-ac 1-af adelay=32s-c:v copy-c:a aac-b:a 128k-map 0:0-map 1:0-r 30\
-f段\
-段时间7\
-段格式mpegts\
-段列表/var/www/html/ppc/saves/live/live.m3u8\
-段\列表\活动标志\
-段列表类型m3u8\
-初始偏移量-9\
-strict 2/var/www/html/ppc/saves/live/%08d.ts
您的raspivid具有
-t 37200000
,以毫秒为单位,因此为37200s。使用
-segment_time 7
,那么多的数据被消耗在约5300个部分中。您的raspivid具有
-t 37200000
,以毫秒为单位,即37200s。在
-segment_time 7
中,大约5300部分消耗了大量数据。