透過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存儲

相關內容