Download all .m4s files of a mpeg dash stream

17

5

When I open this page I can see in Firefox Web Developer Tools / "Network" tab that the page loads files with .mpd extension. And then every few seconds it loads a file/stream with .m4s extension named like

000000.m4s
000001.m4s

How can I download the whole streamed video of this kind?

I think I need to download all .m4s segments but do not know the Linux command or the Windows software to do it. Then I will need to merge these files to a single .mp4

I already tried InviDownloader, but it has numerous problems.

16851556

Posted 2017-04-29T10:39:40.027

Reputation: 181

2

I tried your sample site with youtube-dl and I was able to download it. The software automatically merges them into one file

– nixda – 2017-04-29T11:14:17.497

@nixda thx, youtube-dl worked! Thank you. Here is how to setup it on the Windows.

– 16851556 – 2017-04-29T21:19:49.643

Answers

13

Answering to the question "How can I download the whole streamed video of this kind?"

You can use youtube-dl on the DASH mpd manifest URL to download the video, it worked for me.

youtube-dl {mpd_url}

Maybe you should make clear in the title if you really want these intermediate m2s files or you just want the whole video file.

Fred

Posted 2017-04-29T10:39:40.027

Reputation: 151

What question are you answering? – Toto – 2018-02-23T10:44:24.180

Nice! Did not know that youtube-dl can deal with DASH streams.

– chrisma – 2018-08-01T11:52:04.030

5

1) download IS.mp4 and all *.m4s for video (use wget) and merge IS.mp4 and *.m4s to one file video.mp4

2) download IS.mp4 and all *.m4s for audio and merge IS.mp4 and *.m4s to one file audio.mp4

3) merge video and audio into one file (use ffmpeg -i video.mp4 -i audio.mp4 -c copy movie.mkv)

EDIT

Example how to download audio stream:

echo "IS.mp4" >"links.txt"
seq -f "%06g.m4s" 0 394 >>"links.txt"
wget -i "links.txt" -O "audio.mp4" -B "http://80.188.78.212/aa/ffc8a55fe6f203b0bffecb73efacb69b/1494953435522/eda9c6f7b1e3de68db8e3e5dc0d14fc7/dna-61924494877285694-pc/1002-1502/"

Initial part for audio stream is IS.mp4, audio consists of 394 parts (in a format of 6 digits) and base URL path for audio stream is http://80.188..../1002-1502/. All these information can be obtained from .mpd file.

NOTE: base URL of audio and video stream is changed eachtime you play the video

Unsociable ape

Posted 2017-04-29T10:39:40.027

Reputation: 51

ockquote>

download IS.mp4 and all *.m4s for audio and merge IS.mp4 and *.m4s to one file audio.mp4 HOW?

– tent – 2017-05-15T20:14:42.600

see example above – Unsociable ape – 2017-05-16T17:28:15.780

@Unsociableape What if m4s files have a hash instead of a number increasing in ᴜʀʟ ? In that case, it seems a specific tool is required… – user2284570 – 2017-11-21T00:55:10.073

@user2284570 vimeo have segments in json file, there is audio base url, base64 of audio init segment, audio segment list with start time, end time and url. The same also for video. – andrej – 2018-03-22T10:36:46.227

@Unsociableape , thank you, works perfectly ! – trogne – 2019-03-31T16:05:07.393