python - ffmpeg hls 段在 5300 段后停止分段
问题描述
我正在尝试使用 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```
解决方案
推荐阅读
- css - 半自动 CSS 代码传输到现有的 .CSS 文件(例如,使用批处理文件)
- ios - 如何使用 NSTimer 更改滚动视图内图像幻灯片上的页面控制指示器
- java - Spring的RetryTemplate中的BackOffInterruptedException怎么办?
- php - 添加多个表以在 PHP 中插入查询
- elasticsearch - 按店铺服务时间排序
- java - 在使用之前,我是否必须将 sc.nextLine() 中的数据分配给变量?
- java - Cucumber - 范围报告 3 问题
- excel - VBA:'没有足够的内存来完成操作'但我觉得我的代码没有使用太多内存
- php - YII2 错误 - 需要应用程序的“id”配置
- c++ - 映射类的数据成员