Farouk 询问如何下载 m3u8 视频: 下载 m3u8 视频
我读到m3u8视频可以用ffmpeg下载:
ffmpeg -i "URL.m3u8" -c copy -bsf:a aac_adtstoasc "output.mp4"
运行代码时出现此错误:
This may result in incorrect timestamps in the output file.
[mp4 @ 035f0f60] Non-monotonous DTS in output stream 0:0; previous: 466839031, current: 466838873; changing to 466839032.
This may result in incorrect timestamps in the output file.
frame=1706633 fps=290 q=-1.0 Lsize=17130325kB time=01:26:27.15 bitrate=27053.7kbits/s
video:15984919kB audio:1133157kB subtitle:0 data:0 global headers:0kB muxing overhead 0.071561%
并且视频与音频不同步。
然后我在没有选项的情况下运行它-bsf
,并出现此错误:
[mp4 @ 04a00060] Malformed AAC bitstream detected: use audio bitstream
filter 'aac_adtstoasc' to fix it ('-bsf:a aac_adtstoasc' option with ffmpeg)
av_interleaved_write_frame(): Operation not permitted
frame= 2 fps=0.0 q=-1.0 Lsize= 1kB time=00:00:00.04 bitrate= 245.6kbits/s
video:0kB audio:0kB subtitle:0 data:0 global headers:0kB muxing overhead 55.839417%
Conversion failed!
如何修复此问题?为什么不同步?
可以使用 Win CMD 完成吗?
答案1
使用 powershell 下载:
Invoke-WebRequest -Uri "URL.mp4" -outfile "1.mp4"
Invoke-WebRequest -Uri "NextURL.mp4" -outfile "2.mp4"
etc.
使用 CMD 加入:
(for %i in (*.mp4) do @echo file '%i') >> mylist.txt
ffmpeg -f concat -i mylist.txt -c copy "video.mp4"