0

Original Thread: Download all .m4s files of a mpeg dash 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/"

Since I don't have enough 'reputation' score to add my comment in that thread, I've had to start a new thread here..Could anyone translate the Linux command lines above into the Windows version? How to use WGET for Windows?

llogan
  • 57,139
  • 15
  • 118
  • 145
胡浩治
  • 1
  • 2
  • Download Busybox for Windows. You can get all of the commands. No cygwin or msys2 required. Link: https://frippery.org/busybox/ – Biswapriyo Dec 16 '17 at 19:21
  • @Biswa Thank you Biswa! but then another issue arises: how to join/merge one IS.mp4 file + a tremendous amount of .m4s files using the "busybox cat" command? I tried to type "busybox cat IS.mp4 *.m4s > video.mp4" but it simply yields an error saying "cat: can't open '*.m4s': Invalid argument". Thank you! – 胡浩治 Dec 18 '17 at 09:32
  • Type `busybox sh` and you get a Linux like terminal. Then put your commands as you mentioned in question. – Biswapriyo Dec 30 '17 at 18:11

1 Answers1

1

The script creates a file named links.txt, containing filenames to download from a base URL using wget.

The first line of links.txt is simply IS.mp4. You can create that by hand, or using the exact same echo command, which works the same way in Bash and DOS.

The seq command generates a list of filenames like this:

000000.m4s
000001.m4s
000002.m4s
000003.m4s
...
000394.m4s

You can achieve the same using Excel and a simple formula. Copy the result and append to the end of links.txt.

Alternatively, if you have Bash (if not you can easily get from Git Bash), then you can achieve the same that seq is doing like this:

for i in {0..394}; do printf "%06d.m4s\n" $i; done >> links.txt

Finally, in the wget command there's nothing to translate, you can run that command in DOS.

janos
  • 3,297
  • 1
  • 22
  • 31
  • For seq, if you download the [GNUWin32 CoreUtils](http://gnuwin32.sourceforge.net/packages/coreutils.htm) package, you can use the seq command above "as is" as well (assuming you add it to your Path). – Anaksunaman Dec 16 '17 at 16:06
  • 1
    @Anaksunaman `seq` is generally not a recommended tool, so I avoid it as much as possible – janos Dec 16 '17 at 16:11
  • @janos Thank you janos! However, the wget command is NOT available in my system.. so it's NOT runnable in DOS by default? I've had to download one from web. If it's available by default, could you refer me to the default directory of wget.exe in Windows? AND, btw, do you know how to join video files consisting of one IS.mp4 + multiple m4s files (say, from 000000.m4s to 002200.m4s) in Windows without losing quality? I think the copy command won't work here? I followed Biswa's tips above but the "busybox cat" command won't seem to work for me.. Or do you know how to correctly type that command? – 胡浩治 Dec 18 '17 at 09:28
  • @胡浩治 you can download Wget for Windows from here, for example: http://gnuwin32.sourceforge.net/packages/wget.htm As for concatenating the video files, that should be a different question, with more details about how the files were split. – janos Dec 18 '17 at 09:31
  • @janos OK thanks janos! So should I start another thread concerning my second question, or do you know any where I can find a good tutorial to resolve this issue? Many thanks – 胡浩治 Dec 18 '17 at 09:35
  • @胡浩治 yes please start a new thread on that. Make sure to include the explanation of how the original file was split to multiple files. At this point it's not clear if they can be simply combined with `cat`. Actually, first, I recommend you try to combine with `cat` like this: `cat IS.mp4 00*.m4s > combined.mp4` and see what happens. If that doesn't work, then explain in the question what happens, all error messages you get, and so on. – janos Dec 18 '17 at 10:47
  • OK thanks @janos ! However, the wildcard symbol doesn't work for me when using "busybox cat" command.. please refer to my new thread here: https://superuser.com/questions/1278394/mpeg-dash-segment-merge-in-windows-the-argument-in-command-busybox-cat-is-inv, thank you. – 胡浩治 Dec 19 '17 at 09:48