ffmpeg - 从 *.ts 文件生成 m3u8 播放列表
问题描述
我使用 FFmpeg 生成了 hls 视频。但是我忘记放了-hls_list_size 0
。现在它只包含最后 4 个文件。有没有办法使用文件夹内的所有 *.ts 文件只生成 .m3u8 播放列表文件?
解决方案
Assuming you do not have the source or you do not want to re-construct the whole playlist, write a bash script to pick the duration of each segment using the command
ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 ts_files/sample_000.ts
Once you have the segment lengths, it should be quite simple IMHO.
Of-course, you'd want the bash to iterate through the *.ts
files in a sorted order (by name/created at).
While the above may do the job, go through this and this once.
推荐阅读
- nginx - nginx 反向代理到多个后端服务器,具体取决于 URL
- c# - 全局存储 ObservableCollection 项
- jenkins - Jenkins管道,将分支名称传递给gradle build
- angular - 在 Nginx 上部署 Angular 6 应用程序 - 禁止
- ios - 我是否需要获得后台位置更新的“始终”授权?
- django - 具有中继限制基于 ID 的查询访问的 Django 石墨烯
- html - Div hover is not working in every browser
- r - mailR 任务阻塞 R 服务器端口
- laravel - 使用 laravel 的 paypal 订单总额
- android - FileProvider 异常:IllegalArgumentException:未能找到包含的已配置根