ffmpeg hls分段在5300个分段后停止分段

时间:2019-04-09 11:16:54

标签: python ffmpeg hls

我正在尝试使用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```

0 个答案:

没有答案