At long last, I worked out how to do it using ffmpeg. The process was: open the http...asx file in a text-editor, copy the mms...asf URL, and replace mms with rtsp. Then pass the URL to ffmpeg:
ffmpeg -rtsp_transport tcp \
-i rtsp://copper.jolf.jp/1242/sugawara/130106sugawara.asf myFile.mp3
This downloads it and converts to an mp3. It works on Ubuntu 16.04 using ffmpeg version 2.8.11-0ubuntu0.16.04.1. Other platforms and versions are probably OK too.
Slowness
Each second of the file/stream takes one second to download, so it is very slow.
Near the end, ffmpeg pauses for several minutes and then continues and finishes properly. With the file/stream above, the downloading always takes 4 minutes and 12 seconds longer than the duration of the file. (Can anyone explain this or how to avoid it?)
I thought it might be possible to avoid the pause by using -stimeout 10000
("set socket TCP I/O timeout in microseconds"), but that made no difference. You can do -t -27:00
("stop writing the output after its duration reaches duration") but that doesn't solve the problem.
Here is a way to find the duration of the file without having to stream it:
ffprobe -rtsp_transport tcp \
rtsp://copper.jolf.jp/1242/sugawara/130106sugawara.asf
Other notes
For the reason why -rtsp_transport tcp
is necessary, see here.
I recommend using -hide_banner
to make the ffmpeg output shorter.
If you want to just save the file without converting, use -codec copy
.
At some point I did these commands:
sudo add-apt-repository ppa:mc3man/gstffmpeg-keep
sudo apt-get update
sudo apt-get install gstreamer0.10-ffmpeg
But I don't know whether that was necessary. The advice I was following is here; see also here.
I tried libav, which is similar to ffmpeg and has many of the same options. But it was harder to use and doesn't work with the options above.
Why did other solutions not work?
First it was necessary to find the mms URL and replace mms with rtsp.
I think the reason VLC and other applications didn't work was that the file/stream uses a proprietary Windows Media Audio codec that is not available in those applications.
When you stream it in Windows Media Player, the properties say the audio codec is Windows Media Audio V8, but when you use ffmpeg it says it is using the wmav2 codec. It seems that the ffmpeg developers reverse-engineered version 2 and not version 8, but the two versions are compatible.
Best Answer
I've tried this, and it works:
Reference: