[FFmpeg-user] Unexpected aac audio duration

naraimo at libero.it naraimo at libero.it
Fri Feb 21 13:58:00 EET 2020


Hi Bryce,

thank you very much for the information.
I have checked the presence of the 1024 samples padding in libavcodec/aacenc.c file (avctx->initial_padding = 1024).
Furthermore, I drew the audio waveform with an online tool. It shows the initial priming delay frame, too.

Just two more questions to better understand the management process.
1) ffmpeg doesn't seem to be aware about the priming delay presence: the decoded pcm contains the padding samples and the same happens with HLS chunks. Is this correct? Shouldn't it be discarded?
2) the priming delay frame doesn't have a negative PTS (see below the output of ffprobe). There is another way to check for it?

./ffprobe -show_frames test/out.aac
ffprobe version N-96789-g56df8296f5 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
  configuration: 
  libavutil      56. 41.100 / 56. 41.100
  libavcodec     58. 71.100 / 58. 71.100
  libavformat    58. 38.101 / 58. 38.101
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 76.100 /  7. 76.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
[aac @ 0x55c3b0149d80] Estimating duration from bitrate, this may be inaccurate
Input #0, aac, from 'test/out.aac':
  Duration: 00:00:14.14, bitrate: 0 kb/s
    Stream #0:0: Audio: aac (LC), 8000 Hz, mono, fltp, 0 kb/s
[FRAME]
media_type=audio
stream_index=0
key_frame=1
pkt_pts=0
pkt_pts_time=0.000000
pkt_dts=0
pkt_dts_time=0.000000
best_effort_timestamp=0
best_effort_timestamp_time=0.000000
pkt_duration=3612672
pkt_duration_time=0.128000
pkt_pos=0
pkt_size=262
sample_fmt=fltp
nb_samples=1024
channels=1
channel_layout=mono
[/FRAME]
[FRAME]
media_type=audio
stream_index=0
key_frame=1
pkt_pts=3612672
pkt_pts_time=0.128000
pkt_dts=3612672
pkt_dts_time=0.128000
best_effort_timestamp=3612672
best_effort_timestamp_time=0.128000
pkt_duration=3612672
pkt_duration_time=0.128000
pkt_pos=262
pkt_size=273
sample_fmt=fltp
nb_samples=1024
channels=1
channel_layout=mono
[/FRAME]
[FRAME]
media_type=audio
stream_index=0
key_frame=1
pkt_pts=7225344
pkt_pts_time=0.256000
pkt_dts=7225344
pkt_dts_time=0.256000
best_effort_timestamp=7225344
best_effort_timestamp_time=0.256000
pkt_duration=3612672
pkt_duration_time=0.128000
pkt_pos=535
pkt_size=232
sample_fmt=fltp
nb_samples=1024
channels=1
channel_layout=mono
[/FRAME]
[FRAME]
media_type=audio
stream_index=0
key_frame=1
pkt_pts=10838016
pkt_pts_time=0.384000
pkt_dts=10838016
pkt_dts_time=0.384000
best_effort_timestamp=10838016
best_effort_timestamp_time=0.384000
pkt_duration=3612672
pkt_duration_time=0.128000
pkt_pos=767
pkt_size=271
sample_fmt=fltp
nb_samples=1024
channels=1
channel_layout=mono
[/FRAME]
[FRAME]
media_type=audio
stream_index=0
key_frame=1
pkt_pts=14450688
pkt_pts_time=0.512000
pkt_dts=14450688
pkt_dts_time=0.512000
best_effort_timestamp=14450688
best_effort_timestamp_time=0.512000
pkt_duration=3612672
pkt_duration_time=0.128000
pkt_pos=1038
pkt_size=276
sample_fmt=fltp
nb_samples=1024
channels=1
channel_layout=mono
[/FRAME]
[FRAME]
media_type=audio
stream_index=0
key_frame=1
pkt_pts=18063360
pkt_pts_time=0.640000
pkt_dts=18063360
pkt_dts_time=0.640000
best_effort_timestamp=18063360
best_effort_timestamp_time=0.640000
pkt_duration=3612672
pkt_duration_time=0.128000
pkt_pos=1314
pkt_size=12
sample_fmt=fltp
nb_samples=1024
channels=1
channel_layout=mono
[/FRAME]


Thanks in advance for any help you are able to provide.
Nadir


More information about the ffmpeg-user mailing list