Opened 10 years ago

Closed 19 months ago

#3981 closed defect (invalid)

Duration_LastFrame when muxing mp4

Reported by: downuse Owned by:
Priority: normal Component: avformat
Version: unspecified Keywords: mov
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

when muxing into mp4, there is a delay add to the audio.

Duration_LastFrame : -25ms

General
Complete name                            : C:\mTools\ffmpeg\aac11.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 7.03 MiB
Duration                                 : 5mn 2s
Overall bit rate mode                    : Constant
Overall bit rate                         : 195 Kbps
Writing application                      : Lavf56.6.100

Audio #1
ID                                       : 1
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : HE-AAC / LC
Codec ID                                 : 40
Duration                                 : 5mn 2s
'''Duration_LastFrame'''                       : -25ms
Bit rate mode                            : Constant
Bit rate                                 : 96.0 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz / 24.0 KHz
Compression mode                         : Lossy
Stream size                              : 3.46 MiB (49%)

Audio #2
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : HE-AAC / LC
Codec ID                                 : 40
Duration                                 : 5mn 2s
'''Duration_LastFrame'''                       : -25ms
Bit rate mode                            : Constant
Bit rate                                 : 96.0 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz / 24.0 KHz
Compression mode                         : Lossy
Stream size                              : 3.46 MiB (49%)
ffmpeg started on 2014-09-26 at 18:38:57
Report written to "ffmpeg-20140926-183857.log"
Command line:
ffmpeg -report -y -i 11a.mp2 -i 11b.mp2 -map 0 -map 1 -c:a libfdk_aac -profile:a aac_he -b:a 96k aac11.mp4
ffmpeg version 2.4.git Copyright (c) 2000-2014 the FFmpeg developers
  MPEG-PS Format bugs fixed by None @ Q~691245-1
  built on Sep 26 2014 16:09:59 with gcc 4.8.1 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-libfdk-aac --enable-nonfree --enable-libmp3lame --enable-libvo-aacenc --enable-libx264 --disable-hwaccels --disable-devices --disable-bzlib --enable-zlib --disable-ffplay --disable-ffprobe --disable-ffserver
  libavutil      54.  7.101 / 54.  7.101
  libavcodec     56.  1.101 / 56.  1.101
  libavformat    56.  6.100 / 56.  6.100
  libavdevice    56.  1.100 / 56.  1.100
  libavfilter     5.  1.102 /  5.  1.102
  libswscale      3.  1.100 /  3.  1.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  1.100 / 53.  1.100
Splitting the commandline.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-i' ... matched as input file with argument '11a.mp2'.
Reading option '-i' ... matched as input file with argument '11b.mp2'.
Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0'.
Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '1'.
Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'libfdk_aac'.
Reading option '-profile:a' ... matched as option 'profile' (set profile) with argument 'aac_he'.
Reading option '-b:a' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '96k'.
Reading option 'aac11.mp4' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file 11a.mp2.
Successfully parsed a group of options.
Opening an input file: 11a.mp2.
[mp3 @ 02d61480] Format mp3 probed with size=4096 and score=51
[mp3 @ 02d61480] Before avformat_find_stream_info() pos: 0 bytes read:65664 seeks:2
[mp3 @ 02d61480] All info found
[mp3 @ 02d61480] Estimating duration from bitrate, this may be inaccurate
[mp3 @ 02d61480] After avformat_find_stream_info() pos: 48128 bytes read:98432 seeks:2 frames:50
Input #0, mp3, from '11a.mp2':
  Duration: 00:05:08.43, start: 0.000000, bitrate: 313 kb/s
    Stream #0:0, 50, 1/14112000: Audio: mp2, 48000 Hz, stereo, s16p, 313 kb/s
Successfully opened the file.
Parsing a group of options: input file 11b.mp2.
Successfully parsed a group of options.
Opening an input file: 11b.mp2.
[mp3 @ 02d7c160] Format mp3 probed with size=4096 and score=51
[mp3 @ 02d7c160] Before avformat_find_stream_info() pos: 0 bytes read:65664 seeks:2
[mp3 @ 02d7c160] All info found
[mp3 @ 02d7c160] Estimating duration from bitrate, this may be inaccurate
[mp3 @ 02d7c160] After avformat_find_stream_info() pos: 48128 bytes read:98432 seeks:2 frames:50
Input #1, mp3, from '11b.mp2':
  Duration: 00:05:08.43, start: 0.000000, bitrate: 313 kb/s
    Stream #1:0, 50, 1/14112000: Audio: mp2, 48000 Hz, stereo, s16p, 313 kb/s
Successfully opened the file.
Parsing a group of options: output file aac11.mp4.
Applying option map (set input stream mapping) with argument 0.
Applying option map (set input stream mapping) with argument 1.
Applying option c:a (codec name) with argument libfdk_aac.
Applying option profile:a (set profile) with argument aac_he.
Applying option b:a (video bitrate (please use -b:v)) with argument 96k.
Successfully parsed a group of options.
Opening an output file: aac11.mp4.
Successfully opened the file.
detected 4 logical cores
[graph 0 input from stream 0:0 @ 02d61360] Setting 'time_base' to value '1/48000'
[graph 0 input from stream 0:0 @ 02d61360] Setting 'sample_rate' to value '48000'
[graph 0 input from stream 0:0 @ 02d61360] Setting 'sample_fmt' to value 's16p'
[graph 0 input from stream 0:0 @ 02d61360] Setting 'channel_layout' to value '0x3'
[graph 0 input from stream 0:0 @ 02d61360] tb:1/48000 samplefmt:s16p samplerate:48000 chlayout:0x3
[audio format for output stream 0:0 @ 003390a0] Setting 'sample_fmts' to value 's16'
[audio format for output stream 0:0 @ 003390a0] Setting 'sample_rates' to value '96000|88200|64000|48000|44100|32000|24000|22050|16000|12000|11025|8000'
[audio format for output stream 0:0 @ 003390a0] Setting 'channel_layouts' to value '0x4|0x3|0x7|0x107|0x37|0x3f|0xff|0x63f'
[audio format for output stream 0:0 @ 003390a0] auto-inserting filter 'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the filter 'audio format for output stream 0:0'
[AVFilterGraph @ 00331160] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
[auto-inserted resampler 0 @ 00339400] ch:2 chl:stereo fmt:s16p r:48000Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz
[graph 1 input from stream 1:0 @ 0033d7c0] Setting 'time_base' to value '1/48000'
[graph 1 input from stream 1:0 @ 0033d7c0] Setting 'sample_rate' to value '48000'
[graph 1 input from stream 1:0 @ 0033d7c0] Setting 'sample_fmt' to value 's16p'
[graph 1 input from stream 1:0 @ 0033d7c0] Setting 'channel_layout' to value '0x3'
[graph 1 input from stream 1:0 @ 0033d7c0] tb:1/48000 samplefmt:s16p samplerate:48000 chlayout:0x3
[audio format for output stream 0:1 @ 02d4fe20] Setting 'sample_fmts' to value 's16'
[audio format for output stream 0:1 @ 02d4fe20] Setting 'sample_rates' to value '96000|88200|64000|48000|44100|32000|24000|22050|16000|12000|11025|8000'
[audio format for output stream 0:1 @ 02d4fe20] Setting 'channel_layouts' to value '0x4|0x3|0x7|0x107|0x37|0x3f|0xff|0x63f'
[audio format for output stream 0:1 @ 02d4fe20] auto-inserting filter 'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the filter 'audio format for output stream 0:1'
[AVFilterGraph @ 003391e0] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
[auto-inserted resampler 0 @ 02d508c0] ch:2 chl:stereo fmt:s16p r:48000Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz
Output #0, mp4, to 'aac11.mp4':
  Metadata:
    encoder         : Lavf56.6.100
    Stream #0:0, 0, 1/48000: Audio: aac (libfdk_aac) (HE-AAC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 96 kb/s
    Metadata:
      encoder         : Lavc56.1.101 libfdk_aac
    Stream #0:1, 0, 1/48000: Audio: aac (libfdk_aac) (HE-AAC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 96 kb/s
    Metadata:
      encoder         : Lavc56.1.101 libfdk_aac
Stream mapping:
  Stream #0:0 -> #0:0 (mp2 (native) -> aac (libfdk_aac))
  Stream #1:0 -> #0:1 (mp2 (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
size=     121kB time=00:00:05.05 bitrate= 195.3kbits/s    
size=     228kB time=00:00:09.62 bitrate= 193.9kbits/s    
size=     338kB time=00:00:14.31 bitrate= 193.5kbits/s    
size=     448kB time=00:00:19.00 bitrate= 193.3kbits/s    
size=     558kB time=00:00:23.70 bitrate= 192.8kbits/s    
size=     666kB time=00:00:28.31 bitrate= 192.7kbits/s    
size=     667kB time=00:00:28.31 bitrate= 192.9kbits/s    
size=     771kB time=00:00:32.79 bitrate= 192.7kbits/s    
size=     882kB time=00:00:37.52 bitrate= 192.6kbits/s    
size=     993kB time=00:00:42.26 bitrate= 192.5kbits/s    
size=    1105kB time=00:00:47.04 bitrate= 192.5kbits/s    
size=    1215kB time=00:00:51.73 bitrate= 192.5kbits/s    
size=    1325kB time=00:00:56.42 bitrate= 192.4kbits/s    
size=    1436kB time=00:01:01.16 bitrate= 192.4kbits/s    
size=    1546kB time=00:01:05.85 bitrate= 192.3kbits/s    
size=    1658kB time=00:01:10.63 bitrate= 192.3kbits/s    
size=    1769kB time=00:01:15.37 bitrate= 192.3kbits/s    
size=    1880kB time=00:01:20.10 bitrate= 192.3kbits/s    
size=    1990kB time=00:01:24.80 bitrate= 192.3kbits/s    
size=    2100kB time=00:01:29.49 bitrate= 192.2kbits/s    
size=    2211kB time=00:01:34.23 bitrate= 192.2kbits/s    
size=    2212kB time=00:01:34.27 bitrate= 192.2kbits/s    
size=    2318kB time=00:01:38.79 bitrate= 192.2kbits/s    
size=    2429kB time=00:01:43.53 bitrate= 192.2kbits/s    
size=    2539kB time=00:01:48.22 bitrate= 192.2kbits/s    
size=    2650kB time=00:01:52.91 bitrate= 192.2kbits/s    
size=    2759kB time=00:01:57.61 bitrate= 192.2kbits/s    
size=    2869kB time=00:02:02.30 bitrate= 192.2kbits/s    
size=    2980kB time=00:02:07.04 bitrate= 192.2kbits/s    
size=    3091kB time=00:02:11.77 bitrate= 192.1kbits/s    
size=    3201kB time=00:02:16.47 bitrate= 192.1kbits/s    
size=    3312kB time=00:02:21.20 bitrate= 192.1kbits/s    
size=    3421kB time=00:02:25.85 bitrate= 192.2kbits/s    
size=    3533kB time=00:02:30.63 bitrate= 192.1kbits/s    
size=    3642kB time=00:02:35.28 bitrate= 192.1kbits/s    
size=    3753kB time=00:02:40.02 bitrate= 192.1kbits/s    
size=    3865kB time=00:02:44.80 bitrate= 192.1kbits/s    
size=    3976kB time=00:02:49.53 bitrate= 192.1kbits/s    
size=    4087kB time=00:02:54.27 bitrate= 192.1kbits/s    
size=    4197kB time=00:02:58.96 bitrate= 192.1kbits/s    
size=    4308kB time=00:03:03.70 bitrate= 192.1kbits/s    
size=    4419kB time=00:03:08.43 bitrate= 192.1kbits/s    
size=    4529kB time=00:03:13.13 bitrate= 192.1kbits/s    
size=    4642kB time=00:03:17.95 bitrate= 192.1kbits/s    
size=    4752kB time=00:03:22.64 bitrate= 192.1kbits/s    
size=    4863kB time=00:03:27.38 bitrate= 192.1kbits/s    
size=    4976kB time=00:03:32.20 bitrate= 192.1kbits/s    
size=    5088kB time=00:03:36.98 bitrate= 192.1kbits/s    
size=    5199kB time=00:03:41.71 bitrate= 192.1kbits/s    
size=    5310kB time=00:03:46.45 bitrate= 192.1kbits/s    
size=    5421kB time=00:03:51.19 bitrate= 192.1kbits/s    
size=    5533kB time=00:03:55.96 bitrate= 192.1kbits/s    
size=    5645kB time=00:04:00.74 bitrate= 192.1kbits/s    
size=    5756kB time=00:04:05.48 bitrate= 192.1kbits/s    
size=    5866kB time=00:04:10.17 bitrate= 192.1kbits/s    
size=    5973kB time=00:04:14.74 bitrate= 192.1kbits/s    
size=    6085kB time=00:04:19.52 bitrate= 192.1kbits/s    
size=    6196kB time=00:04:24.25 bitrate= 192.1kbits/s    
size=    6306kB time=00:04:28.95 bitrate= 192.1kbits/s    
size=    6417kB time=00:04:33.68 bitrate= 192.1kbits/s    
size=    6526kB time=00:04:38.29 bitrate= 192.1kbits/s    
size=    6633kB time=00:04:42.90 bitrate= 192.1kbits/s    
size=    6744kB time=00:04:47.63 bitrate= 192.1kbits/s    
size=    6854kB time=00:04:52.33 bitrate= 192.1kbits/s    
size=    6966kB time=00:04:57.11 bitrate= 192.1kbits/s    
size=    7085kB time=00:05:02.18 bitrate= 192.1kbits/s    
[output stream 0:0 @ 0033e7c0] EOF on sink link output stream 0:0:default.
[output stream 0:1 @ 0033d840] EOF on sink link output stream 0:1:default.
No more output streams to write to, finishing.
[libfdk_aac @ 02d95660] Trying to remove 1214 more samples than there are in the queue
[libfdk_aac @ 02dab200] Trying to remove 1214 more samples than there are in the queue
size=    7202kB time=00:05:02.40 bitrate= 195.1kbits/s    

video:0kB audio:7090kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.579538%
Input file #0 (11a.mp2):
  Input stream #0:0 (audio): 12599 packets read (12095040 bytes); 12599 frames decoded (14514048 samples); 
  Total: 12599 packets (12095040 bytes) demuxed
Input file #1 (11b.mp2):
  Input stream #1:0 (audio): 12599 packets read (12095040 bytes); 12599 frames decoded (14514048 samples); 
  Total: 12599 packets (12095040 bytes) demuxed
Output file #0 (aac11.mp4):
  Output stream #0:0 (audio): 7087 frames encoded (14514048 samples); 7090 packets muxed (3630081 bytes); 
  Output stream #0:1 (audio): 7087 frames encoded (14514048 samples); 7090 packets muxed (3630081 bytes); 
  Total: 14180 packets (7260162 bytes) muxed
25198 frames successfully decoded, 0 decoding errors
[AVIOContext @ 02db3680] Statistics: 56 seeks, 14222 writeouts
[AVIOContext @ 02d69aa0] Statistics: 12127936 bytes read, 2 seeks
[AVIOContext @ 02d69960] Statistics: 12127936 bytes read, 2 seeks

it seems work fine with Lavf54.63.100

the following info is from another file,

General
Complete name                            : C:\Users\Nones\Documents\Tencent Files\69124501\FileRecv\aac.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 5.25 MiB
Duration                                 : 3mn 45s
Overall bit rate mode                    : Constant
Overall bit rate                         : 195 Kbps
Writing application                      : Lavf54.63.100

Audio #1
ID                                       : 1
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : HE-AAC / LC
Codec ID                                 : 40
Duration                                 : 3mn 45s
Bit rate mode                            : Constant
Bit rate                                 : 96.0 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz / 24.0 KHz
Compression mode                         : Lossy
Stream size                              : 2.58 MiB (49%)

Audio #2
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : HE-AAC / LC
Codec ID                                 : 40
Duration                                 : 3mn 45s
Bit rate mode                            : Constant
Bit rate                                 : 96.0 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz / 24.0 KHz
Compression mode                         : Lossy
Stream size                              : 2.58 MiB (49%)

Change History (9)

in reply to:  description ; comment:1 by Carl Eugen Hoyos, 10 years ago

Keywords: mov added; mp4 delay Duration_LastFrame removed

Replying to downuse:

ffmpeg version 2.4.git Copyright (c) 2000-2014 the FFmpeg developers
  MPEG-PS Format bugs fixed by None @ Q~691245-1

What is this?

in reply to:  1 comment:2 by downuse, 10 years ago

Replying to cehoyos:

Replying to downuse:

ffmpeg version 2.4.git Copyright (c) 2000-2014 the FFmpeg developers
  MPEG-PS Format bugs fixed by None @ Q~691245-1

What is this?

maybe a bug i posted years ago

comment:3 by Carl Eugen Hoyos, 10 years ago

What I mean is:
Where did you get this version of FFmpeg from?

in reply to:  3 comment:4 by downuse, 10 years ago

Replying to cehoyos:

What I mean is:
Where did you get this version of FFmpeg from?

i get it from git-head

comment:5 by Carl Eugen Hoyos, 10 years ago

This seems unlikely: Current FFmpeg git head does not show the line I quoted above.

in reply to:  5 comment:6 by downuse, 10 years ago

Replying to cehoyos:

This seems unlikely: Current FFmpeg git head does not show the line I quoted above.

I get it from git-head, and merged a local change.

comment:7 by Carl Eugen Hoyos, 10 years ago

Did you send the local change to the developer mailing list?

in reply to:  7 comment:8 by downuse, 10 years ago

Replying to cehoyos:

Did you send the local change to the developer mailing list?

not yet, i deleted a lot of codes that i don't need.. and it's not in ffmpeg code style...sorry, i don't know if you understand me...

comment:9 by Balling, 19 months ago

Resolution: invalid
Status: newclosed

That is not a bug. STTS must be modified as well as editlist to signal the remainder in mp4, for it to be truely gapless.

Note: See TracTickets for help on using tickets.