PR #22862 opened by sasha URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22862 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22862.patch
The key point is to make ffprobe detect ac4 in mpegts, other 2 commits are complementary >From bc44b5d6ae6129ed526dc465b015fed8e7c35bd3 Mon Sep 17 00:00:00 2001 From: Alexander Slobodeniuk <[email protected]> Date: Thu, 16 Apr 2026 19:52:12 +0200 Subject: [PATCH 1/3] avformat/mpegts: don't check impossible branches Quit dvb extension handling when the descriptor have been processed --- libavformat/mpegts.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 8eb3bae720..25497e8486 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -2280,6 +2280,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type sti->need_parsing = AVSTREAM_PARSE_FULL; sti->need_context_update = 1; } + break; } if (ext_desc_tag == SUPPLEMENTARY_AUDIO_DESCRIPTOR) { int flags; @@ -2317,6 +2318,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type if (language[0]) av_dict_set(&st->metadata, "language", language, 0); } + break; } break; case AC3_DESCRIPTOR: -- 2.52.0 >From 2c7160b9bcc163ab215b359e04890b772b8ec72d Mon Sep 17 00:00:00 2001 From: Alexander Slobodeniuk <[email protected]> Date: Thu, 16 Apr 2026 19:56:17 +0200 Subject: [PATCH 2/3] avformat/mpegts: simplify ac3/eac3 descriptor handling those lines are literally the same, so removing the code duplication --- libavformat/mpegts.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 25497e8486..0380b7dcd9 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -2322,19 +2322,6 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type } break; case AC3_DESCRIPTOR: - { - int component_type_flag = get8(pp, desc_end) & (1 << 7); - if (component_type_flag) { - int component_type = get8(pp, desc_end); - int service_type_mask = 0x38; // 0b00111000 - int service_type = ((component_type & service_type_mask) >> 3); - if (service_type == 0x02 /* 0b010 */) { - st->disposition |= AV_DISPOSITION_DESCRIPTIONS; - av_log(ts ? ts->stream : fc, AV_LOG_DEBUG, "New track disposition for id %u: %u\n", st->id, st->disposition); - } - } - } - break; case ENHANCED_AC3_DESCRIPTOR: { int component_type_flag = get8(pp, desc_end) & (1 << 7); -- 2.52.0 >From c5035081a9b66d669f9fc64bebfa1f1be677be91 Mon Sep 17 00:00:00 2001 From: Alexander Slobodeniuk <[email protected]> Date: Thu, 16 Apr 2026 19:30:20 +0200 Subject: [PATCH 3/3] avformat/mpegts: handle AC-4 descriptor in DVB extension as defined in ETSI EN 300 468 (Table 109). This allows ffprobe to recognize that .ts file has an ac4 stream. Checked on the files downloaded from https://ott.dolby.com/OnDelKits/AC-4/Download_v15.html --- libavformat/mpegts.c | 4 ++++ libavformat/mpegts.h | 1 + 2 files changed, 5 insertions(+) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 0380b7dcd9..9b3c5a794e 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -2320,6 +2320,10 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type } break; } + if (ext_desc_tag == AC4_DESCRIPTOR) { + st->codecpar->codec_id = AV_CODEC_ID_AC4; + st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; + } break; case AC3_DESCRIPTOR: case ENHANCED_AC3_DESCRIPTOR: diff --git a/libavformat/mpegts.h b/libavformat/mpegts.h index 18f326b8bf..13f958429b 100644 --- a/libavformat/mpegts.h +++ b/libavformat/mpegts.h @@ -228,6 +228,7 @@ https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/ /* DVB descriptor_tag_extension values from ETSI EN 300 468 Table 109: Possible locations of extended descriptors */ #define SUPPLEMENTARY_AUDIO_DESCRIPTOR 0x06 +#define AC4_DESCRIPTOR 0x15 /** see "Dolby Vision Streams Within the MPEG-2 Transport Stream Format" https://professional.dolby.com/siteassets/content-creation/dolby-vision-for-content-creators/dolby-vision-bitstreams-in-mpeg-2-transport-stream-multiplex-v1.2.pdf */ -- 2.52.0 _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
