我已经成功下载了一段一分钟长的流:
$ mimms -t 1 mms://stream.polskieradio.pl/program3 out.asf
mms://stream.polskieradio.pl/program3 => out.asf
744.45 kB / ∞ B (12.00 kB/s, ∞ s remaining)
Download stopped after user-specified timeout.
$ avprobe out.asf 2>&1 | grep Duration
Duration: 00:00:59.55, start: 0.000000, bitrate: 99 kb/s
然后我将音频流复制到另一个文件:
$ avconv -i out.asf -c:a copy out2.asf
avconv version 9.16-6:9.16-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers
built on Aug 10 2014 18:16:02 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
[asf @ 0x14af020] max_analyze_duration reached
[asf @ 0x14af020] Estimating duration from bitrate, this may be inaccurate
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, asf, from 'out.asf':
Metadata:
WMFSDKVersion : 12.0.7601.17514
WMFSDKNeeded : 0.0.0.0000
IsVBR : 0
Duration: 00:00:59.55, start: 0.000000, bitrate: 99 kb/s
Stream #0.0(eng): Audio: wmav2, 48000 Hz, stereo, fltp, 96 kb/s
Stream #0.1(eng): Data: [0][0][0][0] / 0x0000, 4 kb/s
Output #0, asf, to 'out2.asf':
Metadata:
WMFSDKVersion : 12.0.7601.17514
WMFSDKNeeded : 0.0.0.0000
IsVBR : 0
WM/EncodingSettings: Lavf54.20.4
Stream #0.0(eng): Audio: wmav2, 48000 Hz, stereo, 96 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press ctrl-c to stop encoding
size= 1119kB time=1810474.72 bitrate= 0.0kbits/s
video:0kB audio:717kB global headers:0kB muxing overhead 56.223058%
然后发生了这样的事情:
$ avprobe out2.asf 2>&1 | grep Duration
Duration: 502:54:34.71, start: 0.000000, bitrate: 0 kb/s
有什么办法可以让它恢复到应有的 1 分钟吗?
答案1
不确定这为何重要--你有原始文件。
但尝试使用 FFmpeg 应该会更好。这里可以获取一个独立的二进制文件进行测试。选择 git master 或 release,从解压的文件夹中下载、提取并运行 ffmpeg
http://johnvansickle.com/ffmpeg/
或者建立自己的 -https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu