arecord-f cd-d默认值:card=intel-avconv-i管道:0-acodec
libmp3lame-aq 128k g3-$dt-$$.mp3
我正试着用我的笔记本电脑麦克风录音。开始录音前有一段不受欢迎的停顿。

avconv version 0.8.10-6:0.8.10-1, Copyright (c) 2000-2013 the Libav developers
  built on Feb  5 2014 03:52:19 with gcc 4.7.2
Recording WAVE '-' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

<DELAY>

[wav @ 0x21b4300] max_analyze_duration reached
Input #0, wav, from 'pipe:0':
  Duration: 03:22:53.94, bitrate: N/A
    Stream #0.0: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
Output #0, mp3, to 'g3-Monday-April-14-2014-06_38_07PM-15308.mp3':
  Metadata:
    TSSE            : Lavf53.21.1
    Stream #0.0: Audio: libmp3lame, 44100 Hz, 2 channels, s16, 200 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le -> libmp3lame)
Press ctrl-c to stop encoding
^CAborted by signal Interrupt...te=  51.7kbits/s
size=      94kB time=14.86 bitrate=  51.6kbits/s
video:0kB audio:93kB global headers:0kB muxing overhead 0.143132%
Received signal 2: terminating.

我试了一个strace-f
我看到这个了
read(3, 0x7fff06200b80, 128)            = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN|POLLERR|POLLNVAL}], 1, -1^C <unfinished ...>
Aborted by signal Terminated...

向上滚动时
stat("/usr/share/alsa/alsa.conf", {st_mode=S_IFREG|0644, st_size=9184, ...}) = 0
open("/dev/snd/controlC0", O_RDONLY|O_CLOEXEC) = 3
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
ioctl(3, UI_DEV_CREATE, 0x7fff06201b90) = 0
close(3)                                = 0
open("/dev/snd/timer", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = 3
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
ioctl(3, 0x80045400, 0x7fff06201eb8)    = 0
ioctl(3, SNDCTL_TMR_START or TCSETS, 0x7fff06201ebc) = 0
ioctl(3, TIOCSPGRP, 0x7fff06201ec0)     = 0
ioctl(3, 0x80045400, 0x7fff0620230c)    = 0
semop(786432, {{0, -1, SEM_UNDO|IPC_NOWAIT}}, 1) = 0
open("/dev/snd/controlC0", O_RDONLY|O_CLOEXEC) = 5
fcntl(5, F_SETFD, FD_CLOEXEC)           = 0
ioctl(5, UI_DEV_CREATE, 0x7fff062022f0) = 0
close(5)

                           = 0

我也是手工做的。将它保存到一个文件中,然后对该文件运行avconv;速度要快得多(立即完成)。
有什么问题。

最佳答案

这很容易,avconv分析输入流。
要缩短分析时间,请使用switch-analyzeduration
例子:

arecord -f cd -D default:CARD=Intel -| avconv -analyzeduration 1000 -i pipe:0 -acodec libmp3lame -aq 128k g3-$dt-$$.mp3

-分析持续时间1000=分析1毫秒
在编写本文时,第二种解决方案是连续运行命令。
脚本,例如
#!/bin/bash
arecord .....
avconv .....

对不起,我的英语很好。
德国劳埃德

关于linux - 使用带有aconv的记录时不受欢迎的延迟,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23061126/

10-11 06:45