linux - Unwelcome DELAY when using arecord with aconv -
arecord -f cd -d default:card=intel -| avconv -i pipe:0 -acodec libmp3lame -aq 128k g3-$dt-$$.mp3
i'm trying record via laptop mic. there's unwelcome pause before start of recording.
avconv version 0.8.10-6:0.8.10-1, copyright (c) 2000-2013 libav developers built on feb 5 2014 03:52:19 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, '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, '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 stop encoding ^caborted 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.
i tried strace -f see this
read(3, 0x7fff06200b80, 128) = -1 eagain (resource temporarily unavailable) poll([{fd=3, events=pollin|pollerr|pollnval}], 1, -1^c <unfinished ...> aborted signal terminated...
on scrolling up
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
i did manually.. saved file , ran avconv on file; much faster (instantly finished).
what problem.
that easy, avconv analyzing input stream.
to shorten analysis use switch -analyzeduration
example:
arecord -f cd -d default:card=intel -| avconv -analyzeduration 1000 -i pipe:0 -acodec libmp3lame -aq 128k g3-$dt-$$.mp3
-analyzeduration 1000 = analyze 1ms
as write, second solution run commands in row.
script e.g.
#!/bin/bash arecord ..... avconv .....
sorry excellent english.
gl
Comments
Post a Comment