This repository has been archived by the owner. It is now read-only.

mkvmerge doesn't find AAC audio track in transport stream #1980

Closed
koorg opened this Issue May 8, 2017 · 4 comments

Comments

4 participants
@koorg

koorg commented May 8, 2017

Source file :

  • Video: MPEG4 Video (H264) 720x360 25fps [V: h264 high L3.0, yuv420p, 720x360]
  • Audio: AAC 44100Hz stereo 98kbps [A: aac lc, 44100 Hz, stereo, 98 kb/s]

Drag-dropping the file on mkvtoolnix gui only displays the Video track
I can upload a 850k sample if needed

Here are details about the source file from MediaInfo tab from MPC-HC :

General
ID                             : 1 (0x1)
Format                         : MPEG-TS
File size                      : 882 KiB
Duration                       : 19s 960ms
Overall bit rate mode          : Variable
Overall bit rate               : 360 Kbps

Video
ID                             : 257 (0x101)
Menu ID                        : 1 (0x1)
Format                         : AVC
Format/Info                    : Advanced Video Codec
Format profile                 : High@L3.0
Format settings, CABAC         : Yes
Format settings, ReFrames      : 2 frames
Codec ID                       : 27
Duration                       : 14s 200ms
Width                          : 720 pixels
Height                         : 360 pixels
Display aspect ratio           : 2.000
Frame rate mode                : Variable
Color space                    : YUV
Chroma subsampling             : 4:2:0
Bit depth                      : 8 bits
Scan type                      : Progressive

Audio
ID                             : 258 (0x102)
Menu ID                        : 1 (0x1)
Format                         : AAC
Format/Info                    : Advanced Audio Codec
Format version                 : Version 4
Format profile                 : LC
Muxing mode                    : ADTS
Codec ID                       : 15
Duration                       : 19s 992ms
Bit rate mode                  : Variable
Channel(s)                     : 2 channels
Channel positions              : Front: L R
Sampling rate                  : 44.1 KHz
Compression mode               : Lossy

@koorg koorg changed the title from mkvtoolnix gui doesn't find audio track in to mkvtoolnix gui doesn't find audio track in AAC/ADTS file May 8, 2017

@sneaker2

This comment has been minimized.

Show comment
Hide comment
@sneaker2

sneaker2 May 8, 2017

You need to upload a sample. MediaInfo isn't sufficient to debug the problem.

https://github.com/mbunkus/mkvtoolnix/wiki/FTP-server

sneaker2 commented May 8, 2017

You need to upload a sample. MediaInfo isn't sufficient to debug the problem.

https://github.com/mbunkus/mkvtoolnix/wiki/FTP-server

@koorg

This comment has been minimized.

Show comment
Hide comment
@koorg

koorg May 8, 2017

Alright !
Here we go : 1490318232cpve8 - Copie.mp4 in the upload directory.

Note that I'm using v11.0.0 on W10 with media feature pack.

koorg commented May 8, 2017

Alright !
Here we go : 1490318232cpve8 - Copie.mp4 in the upload directory.

Note that I'm using v11.0.0 on W10 with media feature pack.

@mbunkus

This comment has been minimized.

Show comment
Hide comment
@mbunkus

mbunkus May 9, 2017

Owner

Thanks for the report & the sample file. I can reproduce it here and will look into it.

Owner

mbunkus commented May 9, 2017

Thanks for the report & the sample file. I can reproduce it here and will look into it.

@mbunkus mbunkus changed the title from mkvtoolnix gui doesn't find audio track in AAC/ADTS file to mkvmerge doesn't find AAC audio track in transport stream May 9, 2017

@mbunkus mbunkus closed this in 8b7a81f May 11, 2017

@remuxer32

This comment has been minimized.

Show comment
Hide comment
@remuxer32

remuxer32 May 11, 2017

Collaborator

New pre-builds for Windows that contain the fix have been uploaded here:

Collaborator

remuxer32 commented May 11, 2017

New pre-builds for Windows that contain the fix have been uploaded here:

mbunkus added a commit that referenced this issue May 22, 2017

MPEG TS: parse all PMTs in streams with multiple programs properly
Earlier versions of mkvmerge used to detect all tracks in MPEG
transport streams with multiple programs, even though the code wasn't
really implemented & tested for that. However, some tracks (usually
those from the second or a later program) were broken: they might not
contain any data, or only invalid data.

On top of that mkvmerge v12.0.0 contains a fix for #1980 where a track
isn't part of a PMT at all. An unintentional consequence of that fix
was that mkvmerge no longer detected all of the tracks in
multi-program streams. The reason is that in order to detect tracks
not mentioned in a PMT mkvmerge has to do detection by content in the
PES packets. That's only implemented for AAC at the moment. All other
tracks will be blacklisted as soon as they're found.

This wouldn't be a problem if all PMTs of all programs were always
located right at the start of the file with nothing in
between. Unfortunately many files contain track content between
PMTs. So that workflow was:

• mkvmerge finds first PMT, determines types for tracks listed in it
• mkvmerge now considers the PMT to be found
• Continuing scanning the file mkvmerge encounters content for tracks
  not listed in the first PMT, attempting type detection by content,
  failing for most and blacklisting their PIDs
• Next a second PMT is found, however, the PIDs listed in that PMT may
  have already been found and blacklisted before — therefor they won't
  be considered anymore

With this fix mkvmerge actively looks for the PMTs for all
programs. Detection by content is only attempted once all PMTs have
been located. That way all tracks will be detected again.

A side effect of either this patch or one of the other ones before is
that the track content is now OK. I don't know exactly why or which
commit actually fixed it.

Fixes parts of #1990.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.