0

Farouk asked how to download m3u8 videos at: Downloading m3u8 videos

I read m3u8 videos may be downloaded with ffmpeg:
ffmpeg -i "URL.m3u8" -c copy -bsf:a aac_adtstoasc "output.mp4"

Running the code got me this error:

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%

And video was out of sync with audio.

I then ran it without -bsf option, and got this error:

[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!

How to fix this, why is it out of sync?
Can it be done with Win CMD?

1 Answer 1

-1

To download with powershell:

Invoke-WebRequest -Uri "URL.mp4" -outfile "1.mp4"
Invoke-WebRequest -Uri "NextURL.mp4" -outfile "2.mp4"
etc.

To join with CMD:

(for %i in (*.mp4) do @echo file '%i') >> mylist.txt
ffmpeg -f concat -i mylist.txt -c copy "video.mp4"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .