video - m3u8 文件中的随机 .ts 文件名

标签 video ffmpeg video-streaming html5-video

大家好,我的 ffmpeg 行目前看起来像这样

ffmpeg -i "http://x.com/x.ts" -s 810x520 -pix_fmt yuv420p -vcodec copy -acodec copy -bsf:v h264_mp4toannexb -preset baseline  -strict -2 -flags -global_header -f segment -segment_list "E:\2.m3u8"  -segment_time 10 -segment_list_size 5 "E:\2-%%3d.ts"

它生成 .ts 文件,如 1.ts 2.ts 等。

但如果你要查看 twitch.tv 的 m3u8 文件,它看起来像这样
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:3
#ID3-EQUIV-TDTG:2016-10-14T12:33:35
#EXT-X-MEDIA-SEQUENCE:345
#EXT-X-TWITCH-ELAPSED-SYSTEM-SECS:1368.979
#EXT-X-TWITCH-ELAPSED-SECS:1365.240
#EXT-X-TWITCH-TOTAL-SECS:1386.919
#EXTINF:3.440,
index-0000000346-Am9S.ts
#EXTINF:1.720,
index-0000000347-Am3j.ts
#EXTINF:3.980,
index-0000000348-MYfR.ts
#EXTINF:2.000,
index-0000000349-kIwd.ts
#EXTINF:3.300,
index-0000000350-TpwI.ts
#EXTINF:3.500,
index-0000000351-MAjv.ts

我也想做同样的事情有什么例子吗?
谢谢。

此致

最佳答案

这不能直接用 FFMPEG 完成。 Twitch 处理 M3U8 文件并用他们自己的自定义格式重写它。它在最后一段中提到:https://blog.twitch.tv/en/2017/10/10/live-video-transmuxing-transcoding-f-fmpeg-vs-twitch-transcoder-part-i-489c1c125f28/

Certain information needs to be inserted into the HLS bitstreams to enhance the user experience on the player side. By building our own transcoder and player, Twitch can control the full end-to-end ingest-transcode-CDN-playback pipeline. This allows us to insert proprietary metadata structures into the transcoder output, which are eventually parsed by our player and utilized to produce effects unique to Twitch.

关于video - m3u8 文件中的随机 .ts 文件名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40043319/

相关文章:

video - 使用 ffmpeg 准确剪切 .mp4 而不损失音频保真度?

algorithm - 文件比较策略

ffmpeg - 在 h264 视频上设置假持续时间

webrtc - 如何将网页从服务器端直播到 YouTube 和 Facebook,并为该流提供 WebRTC 输出?

iPad 上的 PHP 视频播放

video - 如何使用 ffmpeg 从 webm 视频中提取图像

audio - ffmpeg 将 MXF 视频的多个 (N) 单声道音频 channel 合并到 MP4 视频的多个 (M) 立体声 channel

windows - 将 rtsp-stream 转换为 http 流

如果在视频后期捕获,ffmpeg 仍然会失败

azure - 如何在 Azure 存储上存储的视频中进行搜索