ffmpeg 从m3u8 url下载ts文件并存储ts文件

ffmpeg 从m3u8 url下载ts文件并存储ts文件

我尝试使用 Ffmpeg 下载并存储所有 *.ts 文件在我的电脑上

ffmpeg -i {m3u8_url} -codec copy -start_number 0 -hls_time 8 -hls_list_size 0 -f hls filename.m3u8 -hls_segment_filename out%03d.ts

一些 m3u8_url,ffmpeg 将所有 ts 文件提取到 ts 文件(大文件)并且我得到此日志:

[hls @ 0x55c297df0ee0] Opening 'filename0.ts' for writing
Output #0, hls, to 'filename.m3u8':
  Metadata:
    encoder         : Lavf57.83.100
    Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1920x800 [SAR 1:1 DAR 12:5], q=2-31, 23.98 fps, 23.98 tbr, 90k tbn, 23.98 tbc
    Metadata:
      variant_bitrate : 0
    Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
    Metadata:
      variant_bitrate : 0
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[hls @ 0x55c297df0ee0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[mpegts @ 0x55c297e14e00] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly

另一个m3u8 url,ffmpeg可以下载所有ts文件并按*.ts存储

相关内容