[Libav-user] Audio encoding AAC from alsa device to mp4 av_write_trailer abort
Charles
linux2 at orion15.org
Fri Feb 17 20:46:03 EET 2017
Having an issue with av_write_trailer
*** glibc detected *** /avcatt/av_dev/audio/record_audio_to_file: corrupted double-linked list: 0x000000000063ade0 ***
Reading "alsa" device decoding then encoding with AAC and writing to mp4(a) file.
Code is here
https://gist.github.com/anonymous/3b67a65becf5d1e2e4b304a4e94af651
At a loss at this point why it fails.
The output file gets closed, or at least there is a moov atom
The issue might be the log
[mp4 @ 0x61c3e0] track 0: codec frame size is not set
But I have not be able to find what I should be setting for "frame_size" since the example code just uses frame_size for nb_samples.
Not really sure if that is a real issue, this is my first attempt at audio.
Any help or where to look would be appreciated.
Thanks
Charles
gdb output: (avlog::debug)
Reading symbols from /avcatt/av_dev/audio/record_audio_to_file...done.
(gdb) r -t 2 -v
Starting program: /avcatt/av_dev/audio/record_audio_to_file -t 2 -v
[Thread debugging using libthread_db enabled]
OPTION -t run time seconds set to 2
OPTION -v verbose level set to 1
[alsa @ 0x607100] All info found
Output #0, mp4, to 'test.mpa':
Stream #0:0, 0, 0/0: Audio: aac, 48000 Hz, stereo, fltp, 64 kb/s
[file @ 0x632aa0] Setting default whitelist 'file,crypto'
[mp4 @ 0x61c3e0] track 0: codec frame size is not set
[SWR @ 0x63b9c0] Using s16p internally between filters
Total time used was 2.01309 seconds frames read from input was 46 frames decoded was 46 frames encoded was 46
Write the trailer
*** glibc detected *** /avcatt/av_dev/audio/record_audio_to_file: corrupted double-linked list: 0x000000000063ade0 ***
[omitted blah blah]
(gdb) bt
#0 0x0000003d30c325e5 in raise () from /lib64/libc.so.6
#1 0x0000003d30c33dc5 in abort () from /lib64/libc.so.6
#2 0x0000003d30c704f7 in __libc_message () from /lib64/libc.so.6
#3 0x0000003d30c75f3e in malloc_printerr () from /lib64/libc.so.6
#4 0x0000003d30c790b6 in _int_free () from /lib64/libc.so.6
#5 0x0000003e1aa26823 in av_freep (arg=<value optimized out>) at libavutil/mem.c:249
#6 0x0000003e1bcf9a5d in av_write_trailer (s=0x61c3e0) at libavformat/mux.c:1336
#7 0x0000000000404e53 in main (argc=4, argv=0x7fffffffe5d8) at record_audio_to_file.cpp:929
linux2 1225 # ffprobe test.mpa
ffprobe version N-83494-g2b9f92f Copyright (c) 2007-2017 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-17)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64
--mandir=/usr/share/man --extra-cflags=-I../Nvidia --disable-crystalhd --enable-gnutls --enable-decoder=aac --enable-pthreads
--enable-shared --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect --enable-libxcb
libavutil 55. 46.100 / 55. 46.100
libavcodec 57. 79.100 / 57. 79.100
libavformat 57. 66.102 / 57. 66.102
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 73.100 / 6. 73.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mpa':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf57.66.102
Duration: 00:00:03.88, start: 0.000000, bitrate: 18 kb/s
Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 16 kb/s (default)
Metadata:
handler_name : SoundHandler
More information about the Libav-user
mailing list