Hello,
I have just started working with audio streams and am having problems
writing
an AAC stream to a container file. Any help will be very appreciated
I am reading AAC frames from a camera buffer and creating AVPackets using
av_init_packet(). These packets are then written to a stream with the
following
AVCodecContext settings:
...
AVCodecContext* pCodecContext = pAudioStream->codec;
pCodecContext->codec_id = av_codec_get_id(audioTags, 0x706d);
pCodecContext->sample_fmt = SAMPLE_FMT_S16;
pCodecContext->sample_rate = 16000;
pCodecContext->channels = 1;
pCodecContext->time_base.num = 1;
pCodecContext->time_base.den = 16000;
pCodecContext->frame_size = 1024;
...
When I try and play the resulting file using FFplay the following is
displayed:
[aac @ 0x8051450] channel element 0.0 is not allocated
Last message repeated 80 times
When I check the created file using FFprobe the stream sample_rate and
channels values = 0 (Please see below).
I was wondering If anyone knew the reason for the "channel element 0.0
is not allocated" message and how to properly set the sample rate and
channel number
for the AAC stream.
Thank you in advance,
Jeffrey
FFprobe :
libavutil 50.19. 0 / 50.19. 0
libavcodec 52.78. 0 / 52.78. 0
libavformat 52.71. 0 / 52.71. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.20. 1 / 1.20. 1
libswscale 0.11. 0 / 0.11. 0
[aac @ 0x8051450] channel element 0.0 is not allocated
Last message repeated 80 times
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x8050010] max_analyze_duration reached
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'testFS.m4a':
Metadata:
major_brand : M4A
minor_version : 512
compatible_brands: isomiso2
encoder : Lavf52.71.0
Duration: 00:00:19.71, start: 0.000000, bitrate: 64 kb/s
Stream #0.0(und): Audio: aac, 0 channels, s16, 63 kb/s
[STREAM]
index=0
codec_name=aac
codec_long_name=Advanced Audio Coding
codec_type=audio
codec_time_base=0/1
codec_tag_string=mp4a
codec_tag=0x6134706d
sample_rate=0.000000
channels=0
bits_per_sample=0
r_frame_rate=0/0
avg_frame_rate=20219/1294
time_base=1/16000
language=und
start_time=0.000000
duration=19.711875
nb_frames=308
TAG:language=und
[/STREAM]
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user