arecord -f cd -D默认值:CARD = Intel – | avconv -i pipe:0 -acodec libmp3lame -aq 128k g3- $ dt – $$。mp3
我正试图通过我的笔记本电脑MIC进行录音。 录制开始之前有一个不受欢迎的停顿。
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分析输入流。
为了缩短分析,请使用开关分析
例:
arecord -f cd -D default:CARD=Intel -| avconv -analyzeduration 1000 -i pipe:0 -acodec libmp3lame -aq 128k g3-$dt-$$.mp3
-analyzeduration 1000 =分析1ms
在编写时,第二个解决方案是连续运行这些命令。
脚本例如
#!/bin/bash arecord ..... avconv .....
对不起我优秀的英语。
GL