我正在尝试将flv流转换为另一个mp3或ogg流。关键是我想在HTML5页面上使用mp3 / ogg流,因为flv流不能用HTML5播放。所以,我配置了avserver.conf:
Port 8090
BindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 1000
CustomLog -
<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 200K
ACL allow 127.0.0.1
</Feed>
<Stream test1.ogg>
Feed feed1.ffm
Format ogg
AudioBitRate 64
AudioChannels 1
AudioSampleRate 44100
NoVideo
</Stream>
<Stream stat.html>
ACL allow localhost
ACL allow 192.168.0.0 192.168.255.255
</Stream>
<Redirect index.html>
URL http://www.libav.org/
</Redirect>
我使用的命令:
avconv -i http://some_stream_service?format=flv -acodec mp3 http://localhost:8090/feed1.ffm
控制台输出:
avconv version 9.13-6:9.13-0ubuntu0.14.04.1+fdkaac, Copyright (c) 2000-2014 the Libav developers
built on May 10 2014 17:26:31 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
[flv @ 0x126e020] max_analyze_duration reached
Input #0, flv, from 'http://some_stream_service?format=flv':
Metadata:
encoder : Lavf52.87.1
Duration: 00:00:00.00, start: 0.000000, bitrate: N/A
Stream #0.0: Audio: aac, 44100 Hz, stereo, fltp, 31 kb/s
Output #0, ffm, to 'http://localhost:8090/feed1.ffm':
Metadata:
encoder : Lavf54.20.4
Stream #0.0: Audio: libmp3lame, 44100 Hz, stereo, fltp
Stream mapping:
Stream #0:0 -> #0:0 (aac -> libmp3lame)
Press ctrl-c to stop encoding
size= 1080kB time=66.14 bitrate= 133.8kbits/s
它看似有效,但我在网页http://localhost:8090/test1.ogg
上不断获得0个字节。有没有人知道我做错了什么?