[FFmpeg-user] Transport Stream Descriptors

Marcelo Boufleur mboufleur at gmail.com
Thu Sep 8 22:51:19 EEST 2016


>
> Use "-mpegts_flags +system_b" to get Private Descriptor 0x06.
> (0x81 is ATSC for AC-3)
>

Thank you Carl Eugen, the "-mpegts_flags +system_b" option does apply a
descriptor of 0x6 to the audio tracks as per DVB specs. However, I would
still like to go back to ATSC version and try to recreate the original
descriptors. We can see the below example for the three samples I am
working right now:

    Stream #0:1[0x1e2](por): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz,
stereo, fltp, 448 kb/s
    Stream #0:1[0x101](por): Audio: ac3 ([129][0][0][0] / 0x0081), 48000
Hz, stereo, fltp, 448 kb/s
    Stream #0:1[0x101](por): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz,
stereo, fltp, 448 kb/s

First is the original sample, second is the ffmpeg ATSC remux version,
third is ffmpeg DVB remux version.

I am using a free app called DemuxToy to further analyse these files and
see exactly what is different after the ffmpeg remultiplex procedure. Below
you may find the results:

=== ORIGINAL FILE ===
• PAT
    • TableId:0x00
    • SectionSyntaxIndicator:1
    • PID:0x0000
    • TransportStreamId:0x0000
    • VersionNumber:0
    • ValidNow:TRUE
    • TotalSections:1
    • TotalExpectedSections:1
    • TotalBytes:16
    • TotalPrograms:1
    • ProgramMaps
    |   +- • Map
    |        +- • ProgramNumber:1
    |        +- • PID:0x01E0
    • CRC:OK

• PMT program:1
    • TableId:0x02
    • SectionSyntaxIndicator:1
    • PID:0x01E0
    • ProgramNumber:1
    • VersionNumber:0
    • ValidNow:TRUE
    • TotalSections:1
    • TotalExpectedSections:1
    • TotalBytes:71
    • PcrPid:0x01E1
    • hasRCT:FALSE
    • hasInteractiveApp:FALSE
    • hasMetadata:FALSE
    • DescriptorLoop
    • ElementaryStreams
    |   +- • ES (Track Video 1)
    |   |    +- • StreamType:MPEG-2 Video Stream (0x2)
    |   |    +- • ElementaryPID:0x01E1
    |   |    +- • DescriptorLoop
    |   |
    |   +- • ES (Track Audio 1)
    |   |    +- • StreamType:User Private Stream (0x81)
    |   |    +- • ElementaryPID:0x01E2
    |   |    +- • DescriptorLoop
    |   |           + Descriptor
    |   |           |   +- • Tag:RegistrationDescriptor (0x05)
    |   |           |   +- • Lenght:4
    |   |           |   +- • Content
    |   |           |          +- • FormatIdentifier:AC-3 (0x41432D33)
    |   |           |          +- • AdditionalIdentificationInfo:
    |   |           |
    |   |           + Descriptor
    |   |           |   +- • Tag:ATSC AC3Descriptor (0x81)
    |   |           |   +- • Lenght:6
    |   |           |   +- • Content
    |   |           |          +- • Bytes: 0x08,0x3C,0x05,0x00,0x1F,0x01
    |   |           |
    |   |           + Descriptor
    |   |               +- • Tag:ISO639LanguageDescriptor (0x0A)
    |   |               +- • Lenght:4
    |   |               +- • Content
    |   |                      +- • Language
    |   |                             +- • LanguageCode:eng
    |   |                             +- • AudioType:Undefinied (0)
    |   |
    |   +- • ES (Track Audio 2)
    |        +- • StreamType:User Private Stream (0x81)
    |        +- • ElementaryPID:0x01E3
    |        +- • DescriptorLoop
    |               + Descriptor
    |               |   +- • Tag:RegistrationDescriptor (0x05)
    |               |   +- • Lenght:4
    |               |   +- • Content
    |               |          +- • FormatIdentifier:AC-3 (0x41432D33)
    |               |          +- • AdditionalIdentificationInfo:
    |               |
    |               + Descriptor
    |               |   +- • Tag:ATSC AC3Descriptor (0x81)
    |               |   +- • Lenght:6
    |               |   +- • Content
    |               |          +- • Bytes: 0x08,0x3C,0x05,0x00,0x1F,0x01
    |               |
    |               + Descriptor
    |                   +- • Tag:ISO639LanguageDescriptor (0x0A)
    |                   +- • Lenght:4
    |                   +- • Content
    |                          +- • Language
    |                                 +- • LanguageCode:por
    |                                 +- • AudioType:Undefinied (0)
    • CRC:OK


=== FFMPEG WITH ATSC REMUX ===
• SDT
    • TableId:0x42
    • SectionSyntaxIndicator:1
    • PID:0x0011
    • TransportStreamId:0x0001
    • VersionNumber:0
    • ValidNow:TRUE
    • OriginalNetworkId:0xFF01
    • TotalSections:1
    • TotalExpectedSections:1
    • TotalBytes:40
    • TotalServices:1
    • ServicesLoop
    |   +- • Service
    |        +- • ServiceId:1
    |        +- • EITScheduleFlag:0
    |        +- • EITpf:0
    |        +- • RunningStatus:running(4)
    |        +- • ServiceType:digital television service (0x01)
    |        +- • FreeCA:not scrambled (0)
    |        +- • DescriptorLoop
    |               + Descriptor
    |                   +- • Tag:ServiceDescriptor (0x48)
    |                   +- • Lenght:18
    |                   +- • Content
    |                          +- • Type:digital television service (0x01)
    |                          +- • ProviderName
    |                          |      +- • ShortName:
    |                          |      +- • Name:FFmpeg
    |                          +- • ServiceName
    |                                 +- • ShortName:
    |                                 +- • Name:Service01
    • CRC:OK

• PAT
    • TableId:0x00
    • SectionSyntaxIndicator:1
    • PID:0x0000
    • TransportStreamId:0x0001
    • VersionNumber:0
    • ValidNow:TRUE
    • TotalSections:1
    • TotalExpectedSections:1
    • TotalBytes:16
    • TotalPrograms:1
    • ProgramMaps
    |   +- • Map
    |        +- • ProgramNumber:1
    |        +- • PID:0x1000
    • CRC:OK

• PMT program:1
    • TableId:0x02
    • SectionSyntaxIndicator:1
    • PID:0x1000
    • ProgramNumber:1
    • VersionNumber:0
    • ValidNow:TRUE
    • TotalSections:1
    • TotalExpectedSections:1
    • TotalBytes:43
    • PcrPid:0x0100
    • hasRCT:FALSE
    • hasInteractiveApp:FALSE
    • hasMetadata:FALSE
    • DescriptorLoop
    • ElementaryStreams
    |   +- • ES (Track Video 1)
    |   |    +- • StreamType:MPEG-2 Video Stream (0x2)
    |   |    +- • ElementaryPID:0x0100
    |   |    +- • DescriptorLoop
    |   |
    |   +- • ES (Track Audio 1)
    |   |    +- • StreamType:User Private Stream (0x81)
    |   |    +- • ElementaryPID:0x0101
    |   |    +- • DescriptorLoop
    |   |           + Descriptor
    |   |               +- • Tag:ISO639LanguageDescriptor (0x0A)
    |   |               +- • Lenght:4
    |   |               +- • Content
    |   |                      +- • Language
    |   |                             +- • LanguageCode:eng
    |   |                             +- • AudioType:Undefinied (0)
    |   |
    |   +- • ES (Track Audio 2)
    |        +- • StreamType:User Private Stream (0x81)
    |        +- • ElementaryPID:0x0102
    |               + Descriptor
    |                   +- • Tag:ISO639LanguageDescriptor (0x0A)
    |                   +- • Lenght:4
    |                   +- • Content
    |                          +- • Language
    |                                 +- • LanguageCode:por
    |                                 +- • AudioType:Undefinied (0)
    • CRC:OK


=== FFMPEG WITH DVB REMUX ===
• SDT
    • TableId:0x42
    • SectionSyntaxIndicator:1
    • PID:0x0011
    • TransportStreamId:0x0001
    • VersionNumber:0
    • ValidNow:TRUE
    • OriginalNetworkId:0xFF01
    • TotalSections:1
    • TotalExpectedSections:1
    • TotalBytes:40
    • TotalServices:1
    • ServicesLoop
    |   +- • Service
    |        +- • ServiceId:1
    |        +- • EITScheduleFlag:0
    |        +- • EITpf:0
    |        +- • RunningStatus:running(4)
    |        +- • ServiceType:digital television service (0x01)
    |        +- • FreeCA:not scrambled (0)
    |        +- • DescriptorLoop
    |               + Descriptor
    |                   +- • Tag:ServiceDescriptor (0x48)
    |                   +- • Lenght:18
    |                   +- • Content
    |                          +- • Type:digital television service (0x01)
    |                          +- • ProviderName
    |                          |      +- • ShortName:
    |                          |      +- • Name:FFmpeg
    |                          +- • ServiceName
    |                                 +- • ShortName:
    |                                 +- • Name:Service01
    • CRC:OK

• PAT
    • TableId:0x00
    • SectionSyntaxIndicator:1
    • PID:0x0000
    • TransportStreamId:0x0001
    • VersionNumber:0
    • ValidNow:TRUE
    • TotalSections:1
    • TotalExpectedSections:1
    • TotalBytes:16
    • TotalPrograms:1
    • ProgramMaps
    |   +- • Map
    |        +- • ProgramNumber:1
    |        +- • PID:0x1000
    • CRC:OK

• PMT program:1
    • TableId:0x02
    • SectionSyntaxIndicator:1
    • PID:0x1000
    • ProgramNumber:1
    • VersionNumber:0
    • ValidNow:TRUE
    • TotalSections:1
    • TotalExpectedSections:1
    • TotalBytes:49
    • PcrPid:0x0100
    • hasRCT:FALSE
    • hasInteractiveApp:FALSE
    • hasMetadata:FALSE
    • DescriptorLoop
    • ElementaryStreams
    |   +- • ES (Track Video 1)
    |   |    +- • StreamType:MPEG-2 Video Stream (0x2)
    |   |    +- • ElementaryPID:0x0100
    |   |    +- • DescriptorLoop
    |   |
    |   +- • ES (Track Audio 1)
    |   |    +- • StreamType:MPEG-2 PES Packets Private Data (0x6)
    |   |    +- • ElementaryPID:0x0101
    |   |    +- • DescriptorLoop
    |   |           + Descriptor
    |   |           |   +- • Tag:AC3Descriptor(0x06A)
    |   |           |   +- • Lenght:1
    |   |           |   +- • Content
    |   |           |          +- • ComponentTypeFlag:FALSE
    |   |           |          +- • BsidFlag:FALSE
    |   |           |          +- • MainidFlag:FALSE
    |   |           |          +- • AsvcFlag:FALSE
    |   |           |          +- • Bsid:
    |   |           |          +- • AdditionalInfoBytes:
    |   |           |
    |   |           + Descriptor
    |   |               +- • Tag:ISO639LanguageDescriptor (0x0A)
    |   |               +- • Lenght:4
    |   |               +- • Content
    |   |                      +- • Language
    |   |                             +- • LanguageCode:eng
    |   |                             +- • AudioType:Undefinied (0)
    |   |
    |   +- • ES (Track Audio 2)
    |        +- • StreamType:MPEG-2 PES Packets Private Data (0x6)
    |        +- • ElementaryPID:0x0102
    |        +- • DescriptorLoop
    |               + Descriptor
    |               |   +- • Tag:AC3Descriptor(0x06A)
    |               |   +- • Lenght:1
    |               |   +- • Content
    |               |          +- • ComponentTypeFlag:FALSE
    |               |          +- • BsidFlag:FALSE
    |               |          +- • MainidFlag:FALSE
    |               |          +- • AsvcFlag:FALSE
    |               |          +- • Bsid:
    |               |          +- • AdditionalInfoBytes:
    |               |
    |               + Descriptor
    |                   +- • Tag:ISO639LanguageDescriptor (0x0A)
    |                   +- • Lenght:4
    |                   +- • Content
    |                          +- • Language
    |                                 +- • LanguageCode:por
    |                                 +- • AudioType:Undefinied (0)
    • CRC:OK


More information about the ffmpeg-user mailing list