I'm trying to stream audio from a microphone using FFmpeg over a network to VLC, but I haven't been able to get the latency below about half a second, which is unacceptable for my purpose. I've been able to stream raw video (from the same webcam device) with almost no latency, so I expect it to be possible to do the same with audio since there's less data involved.
FFmpeg command:
ffmpeg -f dshow -i audio="Microphone (2- Microsoft LifeCam VX-5000)" -f wav udp://127.0.0.1:12000
Console output:
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, dshow, from 'audio=Microphone (2- Microsoft LifeCam VX-5000)':
Duration: N/A, start: 1047373.188000, bitrate: N/A
Stream #0:0: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
[wav @ 04fffba0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Output #0, wav, to 'udp://127.0.0.1:12000':
Metadata:
ISFT : Lavf57.36.100
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Metadata:
encoder : Lavc57.40.100 pcm_s16le
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native))
I'm receiving this in VLC with the caching set to 10ms, but the actual delay between a sound and VLC playing it is about half a second.
Also, if I don't start VLC trying to receive the stream before I actually start the FFmpeg stream, it doesn't work. I can easily work around this problem, but it seems a bit strange.
Is there any way for me to further reduce the latency?
Recent Questions...
ما را در سایت Recent Questions دنبال میکنید
برچسب:
نویسنده: استخدام کار
بازدید: 167
تاريخ: چهارشنبه
22 ارديبهشت
1395 ساعت: 9:33