[FFmpeg-trac] #2504(undetermined:new): Audio glitches and distortion when recording and direct play
FFmpeg
trac at avcodec.org
Fri Apr 26 16:57:49 CEST 2013
#2504: Audio glitches and distortion when recording and direct play
-------------------------------------+-------------------------------------
Reporter: MrNice | Type: defect
Status: new | Priority: normal
Component: | Version:
undetermined | unspecified
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Summary of the bug: I try to record from integrated audio card input
line/micro and get distortions.
How to reproduce:
{{{
$ ffmpeg -debug 1 -vn -f alsa -ac 2 -channel_layout stereo -i hw:0,0 -c:a
pcm_s16le /Store3/Test/pcm_`date +%m%d_%H%M`.wav
ffmpeg version N-52061-g8137ea3 Copyright (c) 2000-2013 the FFmpeg
developers
built on Apr 13 2013 21:10:51 with gcc 4.4.7 (GCC) 20120313 (Red Hat
4.4.7-3)
configuration: --prefix=/opt/ffmpeg-opt/usr --enable-shared
--bindir=/opt/ffmpeg-opt/usr/bin --datadir=/opt/ffmpeg-opt/usr/share
/ffmpeg-opt --incdir=/opt/ffmpeg-opt/usr/include/ffmpeg-opt --libdir=/opt
/ffmpeg-opt/usr/lib64 --mandir=/opt/ffmpeg-opt/usr/share/man
--shlibdir=/opt/ffmpeg-opt/usr/lib64 --arch=x86_64 --optflags='-O2 -g'
--enable-bzlib --disable-crystalhd --enable-gnutls --enable-libass
--enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-
libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-
libopus --enable-libpulse --enable-libschroedinger --enable-libspeex
--enable-libtheora --enable-libvorbis --enable-libx264 --disable-libv4l2
--enable-libxvid --enable-x11grab --enable-avfilter --enable-postproc
--enable-pthreads --disable-static --enable-shared --enable-gpl --disable-
debug --disable-stripping --build-suffix=1 --disable-doc --enable-runtime-
cpudetect
libavutil 52. 26.100 / 52. 26.100
libavcodec 55. 2.100 / 55. 2.100
libavformat 55. 2.100 / 55. 2.100
libavdevice 55. 0.100 / 55. 0.100
libavfilter 3. 53.101 / 3. 53.101
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
matched as AVOption 'debug' with argument '1'.
Reading option '-vn' ... matched as option 'vn' (disable video) with
argument '1'.
Reading option '-f' ... matched as option 'f' (force format) with argument
'alsa'.
Reading option '-ac' ... matched as option 'ac' (set number of audio
channels) with argument '2'.
Reading option '-channel_layout' ... matched as option 'channel_layout'
(set channel layout) with argument 'stereo'.
Reading option '-i' ... matched as input file with argument 'hw:0,0'.
Reading option '-c:a' ... matched as option 'c' (codec name) with argument
'pcm_s16le'.
Reading option '/Store3/Test/pcm_0426_1018.wav' ... matched as output
file.
Finished splitting the commandline.
Parsing a group of options: global .
Successfully parsed a group of options.
Parsing a group of options: input file hw:0,0.
Applying option vn (disable video) with argument 1.
Applying option f (force format) with argument alsa.
Applying option ac (set number of audio channels) with argument 2.
Applying option channel_layout (set channel layout) with argument stereo.
Successfully parsed a group of options.
Opening an input file: hw:0,0.
[alsa @ 0x20f7720] All info found
Input #0, alsa, from 'hw:0,0':
Duration: N/A, start: 1366967936.157276, bitrate: 1536 kb/s
Stream #0:0, 1, 1/1000000: Audio: pcm_s16le, 48000 Hz, stereo, s16,
1536 kb/s
Successfully opened the file.
Parsing a group of options: output file /Store3/Test/pcm_0426_1018.wav.
Applying option c:a (codec name) with argument pcm_s16le.
Successfully parsed a group of options.
Opening an output file: /Store3/Test/pcm_0426_1018.wav.
Successfully opened the file.
[graph 0 input from stream 0:0 @ 0x20e8280] Setting 'time_base' to value
'1/48000'
[graph 0 input from stream 0:0 @ 0x20e8280] Setting 'sample_rate' to value
'48000'
[graph 0 input from stream 0:0 @ 0x20e8280] Setting 'sample_fmt' to value
's16'
[graph 0 input from stream 0:0 @ 0x20e8280] Setting 'channel_layout' to
value '0x3'
[graph 0 input from stream 0:0 @ 0x20e8280] tb:1/48000 samplefmt:s16
samplerate:48000 chlayout:0x3
[audio format for output stream 0:0 @ 0x20effc0] Setting 'sample_fmts' to
value 's16'
[AVFilterGraph @ 0x20f7320] query_formats: 4 queried, 9 merged, 0 already
done, 0 delayed
Output #0, wav, to '/Store3/Test/pcm_0426_1018.wav':
Metadata:
ISFT : Lavf55.2.100
Stream #0:0, 0, 1/48000: Audio: pcm_s16le ([1][0][0][0] / 0x0001),
48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le -> pcm_s16le)
Press [q] to stop, [?] for help
size= 1076kB time=00:00:05.73 bitrate=1536.1kbits/s
video:0kB audio:1076kB subtitle:0 global headers:0kB muxing overhead
0.007263%
31021 frames successfully decoded, 0 decoding errors
Statistics: 4 seeks, 31024 writeouts
}}}
Result: very bad audio, distortion
Same result with
{{{
$ ffmpeg -debug 1 -vn -f alsa -ac 2 -channel_layout stereo -i hw:0,0 -ar
44100 -ab 320k -c:a mp3 /Store3/Test/mp3_`date +%m%d_%H%M`.mp3
}}}
Result: very bad audio, distortion
{{{
$ ffplay -debug 1 -f alsa -ac 2 -i hw:0,0
}}}
Result: statics after almost every bip.
More tests with other applications:
'''Audacity'''
With Alsa, input: default then pulse then ALC892 (hw:0,0)
Result: with these 3 different parameters, audio is perfect.
'''recordmydesktop'''
input: DEFAULT
result: audio is perfect.
'''gnome-sound-recorder 2.29.91'''
Record from input: Capture
format flac, ogg, pm3
Result: with these 3 different formats, audio is perfect.
'''arecord'''
arecord -f cd -t wav out.wav
Result: audio is perfect.
'''VLC'''
input hw:0,0
Result: static after every bip.
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2504>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list