diff mbox series

[FFmpeg-devel,7/8] avformat/mpegtsenc: add registration descriptor for AC-3 and EAC3

Message ID 1595431659-664-7-git-send-email-lance.lmwang@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,1/8] avformat/mpegts: add dvb ac3 descriptor metadata | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Lance Wang July 22, 2020, 3:27 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

copy the atsc ac3 audio in ts like below:
./ffmpeg -i atsc_audio.ts -c:v copy -c:a copy out.ts
Stream #0:6[0x64](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s

./ffmpeg -i out.ts
Before:
Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s

After applied patch:
Stream #0:1[0x101](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavformat/mpegtsenc.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Marton Balint Aug. 22, 2020, 5:27 p.m. UTC | #1
On Sat, 22 Aug 2020, lance.lmwang@gmail.com wrote:

> On Wed, Jul 22, 2020 at 11:27:38PM +0800, lance.lmwang@gmail.com wrote:
>> From: Limin Wang <lance.lmwang@gmail.com>
>> 
>> copy the atsc ac3 audio in ts like below:
>> ./ffmpeg -i atsc_audio.ts -c:v copy -c:a copy out.ts
>> Stream #0:6[0x64](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
>> 
>> ./ffmpeg -i out.ts
>> Before:
>> Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
>> 
>> After applied patch:
>> Stream #0:1[0x101](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
>> 
>> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
>> ---
>>  libavformat/mpegtsenc.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>> 
>> diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
>> index a5b45fb..f060ea6 100644
>> --- a/libavformat/mpegtsenc.c
>> +++ b/libavformat/mpegtsenc.c
>> @@ -535,6 +535,11 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
>>                      *q++=1; // 1 byte, all flags sets to 0
>>                      *q++=0; // omit all fields...
>>                  }
>> +            } else {
>> +                if (codec_id == AV_CODEC_ID_AC3)
>> +                    put_registration_descriptor(&q, MKTAG('A', 'C', '-', '3'));
>> +                else if (codec_id == AV_CODEC_ID_EAC3)
>> +                    put_registration_descriptor(&q, MKTAG('E', 'A', 'C', '3'));
>>              }
>>              if (codec_id == AV_CODEC_ID_S302M)
>>                  put_registration_descriptor(&q, MKTAG('B', 'S', 'S', 'D'));
>> -- 
>> 1.8.3.1
>> 
>
> ping the patch, as I'll submit patch to support atsc ac3 descriptor after that.

Why is this patch needed?

https://www.atsc.org/wp-content/uploads/2015/03/A52-2018-1.pdf

does not seem to require the use of MPEG2 registration descriptor for 
ATSC.

I am not saying this is patch is bad, but some valid reason should be 
found to justify it, and the fact that AC3 fourcc is reported is 
irrelevant, that is just fourcc, it can be anything.

Thanks,
Marton
Lance Wang Aug. 22, 2020, 11:34 p.m. UTC | #2
On Sat, Aug 22, 2020 at 07:27:30PM +0200, Marton Balint wrote:
> 
> 
> On Sat, 22 Aug 2020, lance.lmwang@gmail.com wrote:
> 
> > On Wed, Jul 22, 2020 at 11:27:38PM +0800, lance.lmwang@gmail.com wrote:
> > > From: Limin Wang <lance.lmwang@gmail.com>
> > > 
> > > copy the atsc ac3 audio in ts like below:
> > > ./ffmpeg -i atsc_audio.ts -c:v copy -c:a copy out.ts
> > > Stream #0:6[0x64](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
> > > 
> > > ./ffmpeg -i out.ts
> > > Before:
> > > Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
> > > 
> > > After applied patch:
> > > Stream #0:1[0x101](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
> > > 
> > > Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> > > ---
> > >  libavformat/mpegtsenc.c | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > > 
> > > diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
> > > index a5b45fb..f060ea6 100644
> > > --- a/libavformat/mpegtsenc.c
> > > +++ b/libavformat/mpegtsenc.c
> > > @@ -535,6 +535,11 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
> > >                      *q++=1; // 1 byte, all flags sets to 0
> > >                      *q++=0; // omit all fields...
> > >                  }
> > > +            } else {
> > > +                if (codec_id == AV_CODEC_ID_AC3)
> > > +                    put_registration_descriptor(&q, MKTAG('A', 'C', '-', '3'));
> > > +                else if (codec_id == AV_CODEC_ID_EAC3)
> > > +                    put_registration_descriptor(&q, MKTAG('E', 'A', 'C', '3'));
> > >              }
> > >              if (codec_id == AV_CODEC_ID_S302M)
> > >                  put_registration_descriptor(&q, MKTAG('B', 'S', 'S', 'D'));
> > > -- 
> > > 1.8.3.1
> > > 
> > 
> > ping the patch, as I'll submit patch to support atsc ac3 descriptor after that.
> 
> Why is this patch needed?
> 
> https://www.atsc.org/wp-content/uploads/2015/03/A52-2018-1.pdf
> 
> does not seem to require the use of MPEG2 registration descriptor for ATSC.
> 
> I am not saying this is patch is bad, but some valid reason should be found
> to justify it, and the fact that AC3 fourcc is reported is irrelevant, that
> is just fourcc, it can be anything.

Most of my atsc ac3 sample write the mpeg2 descriptor, so I want to keep it when copy
the audio stream. By "ATSC Usage of the MPEG-2 Registration Descriptor" by astc:
https://smpte-ra.org/registered-mpeg-ts-ids

It provides a method to uniquely  and unambiguously identify formats of private data.
SMPTE is the registration authority for the 32 bit format identifier field, 
guaranteeing that every assigned value will be unique.
https://www.atsc.org/wp-content/uploads/2015/04/t3_548r1.pdf


> 
> Thanks,
> Marton
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Marton Balint Aug. 23, 2020, 8:17 a.m. UTC | #3
On Sun, 23 Aug 2020, lance.lmwang@gmail.com wrote:

> On Sat, Aug 22, 2020 at 07:27:30PM +0200, Marton Balint wrote:
>> 
>> 
>> On Sat, 22 Aug 2020, lance.lmwang@gmail.com wrote:
>> 
>> > On Wed, Jul 22, 2020 at 11:27:38PM +0800, lance.lmwang@gmail.com wrote:
>> > > From: Limin Wang <lance.lmwang@gmail.com>
>> > > 
>> > > copy the atsc ac3 audio in ts like below:
>> > > ./ffmpeg -i atsc_audio.ts -c:v copy -c:a copy out.ts
>> > > Stream #0:6[0x64](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
>> > > 
>> > > ./ffmpeg -i out.ts
>> > > Before:
>> > > Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
>> > > 
>> > > After applied patch:
>> > > Stream #0:1[0x101](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
>> > > 
>> > > Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
>> > > ---
>> > >  libavformat/mpegtsenc.c | 5 +++++
>> > >  1 file changed, 5 insertions(+)
>> > > 
>> > > diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
>> > > index a5b45fb..f060ea6 100644
>> > > --- a/libavformat/mpegtsenc.c
>> > > +++ b/libavformat/mpegtsenc.c
>> > > @@ -535,6 +535,11 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
>> > >                      *q++=1; // 1 byte, all flags sets to 0
>> > >                      *q++=0; // omit all fields...
>> > >                  }
>> > > +            } else {
>> > > +                if (codec_id == AV_CODEC_ID_AC3)
>> > > +                    put_registration_descriptor(&q, MKTAG('A', 'C', '-', '3'));
>> > > +                else if (codec_id == AV_CODEC_ID_EAC3)
>> > > +                    put_registration_descriptor(&q, MKTAG('E', 'A', 'C', '3'));
>> > >              }
>> > >              if (codec_id == AV_CODEC_ID_S302M)
>> > >                  put_registration_descriptor(&q, MKTAG('B', 'S', 'S', 'D'));
>> > > -- 
>> > > 1.8.3.1
>> > > 
>> > 
>> > ping the patch, as I'll submit patch to support atsc ac3 descriptor after that.
>> 
>> Why is this patch needed?
>> 
>> https://www.atsc.org/wp-content/uploads/2015/03/A52-2018-1.pdf
>> 
>> does not seem to require the use of MPEG2 registration descriptor for ATSC.
>> 
>> I am not saying this is patch is bad, but some valid reason should be found
>> to justify it, and the fact that AC3 fourcc is reported is irrelevant, that
>> is just fourcc, it can be anything.
>
> Most of my atsc ac3 sample write the mpeg2 descriptor, so I want to keep it when copy
> the audio stream.

There are system B samples out there which also has the descriptor. So why 
not write it to system B as well by that reasoning?

Thanks,
Marton
Lance Wang Aug. 23, 2020, 9:26 a.m. UTC | #4
On Sun, Aug 23, 2020 at 10:17:01AM +0200, Marton Balint wrote:
> 
> 
> On Sun, 23 Aug 2020, lance.lmwang@gmail.com wrote:
> 
> > On Sat, Aug 22, 2020 at 07:27:30PM +0200, Marton Balint wrote:
> > > 
> > > 
> > > On Sat, 22 Aug 2020, lance.lmwang@gmail.com wrote:
> > > 
> > > > On Wed, Jul 22, 2020 at 11:27:38PM +0800, lance.lmwang@gmail.com wrote:
> > > > > From: Limin Wang <lance.lmwang@gmail.com>
> > > > > > > copy the atsc ac3 audio in ts like below:
> > > > > ./ffmpeg -i atsc_audio.ts -c:v copy -c:a copy out.ts
> > > > > Stream #0:6[0x64](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
> > > > > > > ./ffmpeg -i out.ts
> > > > > Before:
> > > > > Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
> > > > > > > After applied patch:
> > > > > Stream #0:1[0x101](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
> > > > > > > Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> > > > > ---
> > > > >  libavformat/mpegtsenc.c | 5 +++++
> > > > >  1 file changed, 5 insertions(+)
> > > > > > > diff --git a/libavformat/mpegtsenc.c
> > > b/libavformat/mpegtsenc.c
> > > > > index a5b45fb..f060ea6 100644
> > > > > --- a/libavformat/mpegtsenc.c
> > > > > +++ b/libavformat/mpegtsenc.c
> > > > > @@ -535,6 +535,11 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
> > > > >                      *q++=1; // 1 byte, all flags sets to 0
> > > > >                      *q++=0; // omit all fields...
> > > > >                  }
> > > > > +            } else {
> > > > > +                if (codec_id == AV_CODEC_ID_AC3)
> > > > > +                    put_registration_descriptor(&q, MKTAG('A', 'C', '-', '3'));
> > > > > +                else if (codec_id == AV_CODEC_ID_EAC3)
> > > > > +                    put_registration_descriptor(&q, MKTAG('E', 'A', 'C', '3'));
> > > > >              }
> > > > >              if (codec_id == AV_CODEC_ID_S302M)
> > > > >                  put_registration_descriptor(&q, MKTAG('B', 'S', 'S', 'D'));
> > > > > -- > > 1.8.3.1
> > > > > > > ping the patch, as I'll submit patch to support atsc ac3
> > > descriptor after that.
> > > 
> > > Why is this patch needed?
> > > 
> > > https://www.atsc.org/wp-content/uploads/2015/03/A52-2018-1.pdf
> > > 
> > > does not seem to require the use of MPEG2 registration descriptor for ATSC.
> > > 
> > > I am not saying this is patch is bad, but some valid reason should be found
> > > to justify it, and the fact that AC3 fourcc is reported is irrelevant, that
> > > is just fourcc, it can be anything.
> > 
> > Most of my atsc ac3 sample write the mpeg2 descriptor, so I want to keep it when copy
> > the audio stream.
> 
> There are system B samples out there which also has the descriptor. So why
> not write it to system B as well by that reasoning?

Where to download such samples, most of my system sample don't write the
mpeg2 descriptor, that's why I haven't add it for system B.

> 
> Thanks,
> Marton
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Marton Balint Aug. 23, 2020, 1:04 p.m. UTC | #5
On Sun, 23 Aug 2020, lance.lmwang@gmail.com wrote:

> On Sun, Aug 23, 2020 at 10:17:01AM +0200, Marton Balint wrote:
>> 
>> 
>> On Sun, 23 Aug 2020, lance.lmwang@gmail.com wrote:
>> 
>> > On Sat, Aug 22, 2020 at 07:27:30PM +0200, Marton Balint wrote:
>> > > 
>> > > 
>> > > On Sat, 22 Aug 2020, lance.lmwang@gmail.com wrote:
>> > > 
>> > > > On Wed, Jul 22, 2020 at 11:27:38PM +0800, lance.lmwang@gmail.com wrote:
>> > > > > From: Limin Wang <lance.lmwang@gmail.com>
>> > > > > > > copy the atsc ac3 audio in ts like below:
>> > > > > ./ffmpeg -i atsc_audio.ts -c:v copy -c:a copy out.ts
>> > > > > Stream #0:6[0x64](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
>> > > > > > > ./ffmpeg -i out.ts
>> > > > > Before:
>> > > > > Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
>> > > > > > > After applied patch:
>> > > > > Stream #0:1[0x101](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
>> > > > > > > Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
>> > > > > ---
>> > > > >  libavformat/mpegtsenc.c | 5 +++++
>> > > > >  1 file changed, 5 insertions(+)
>> > > > > > > diff --git a/libavformat/mpegtsenc.c
>> > > b/libavformat/mpegtsenc.c
>> > > > > index a5b45fb..f060ea6 100644
>> > > > > --- a/libavformat/mpegtsenc.c
>> > > > > +++ b/libavformat/mpegtsenc.c
>> > > > > @@ -535,6 +535,11 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
>> > > > >                      *q++=1; // 1 byte, all flags sets to 0
>> > > > >                      *q++=0; // omit all fields...
>> > > > >                  }
>> > > > > +            } else {
>> > > > > +                if (codec_id == AV_CODEC_ID_AC3)
>> > > > > +                    put_registration_descriptor(&q, MKTAG('A', 'C', '-', '3'));
>> > > > > +                else if (codec_id == AV_CODEC_ID_EAC3)
>> > > > > +                    put_registration_descriptor(&q, MKTAG('E', 'A', 'C', '3'));
>> > > > >              }
>> > > > >              if (codec_id == AV_CODEC_ID_S302M)
>> > > > >                  put_registration_descriptor(&q, MKTAG('B', 'S', 'S', 'D'));
>> > > > > -- > > 1.8.3.1
>> > > > > > > ping the patch, as I'll submit patch to support atsc ac3
>> > > descriptor after that.
>> > > 
>> > > Why is this patch needed?
>> > > 
>> > > https://www.atsc.org/wp-content/uploads/2015/03/A52-2018-1.pdf
>> > > 
>> > > does not seem to require the use of MPEG2 registration descriptor for ATSC.
>> > > 
>> > > I am not saying this is patch is bad, but some valid reason should be found
>> > > to justify it, and the fact that AC3 fourcc is reported is irrelevant, that
>> > > is just fourcc, it can be anything.
>> > 
>> > Most of my atsc ac3 sample write the mpeg2 descriptor, so I want to keep it when copy
>> > the audio stream.
>> 
>> There are system B samples out there which also has the descriptor. So why
>> not write it to system B as well by that reasoning?
>
> Where to download such samples, most of my system sample don't write the
> mpeg2 descriptor, that's why I haven't add it for system B.

A lot of samples are in http://samples.ffmpeg.org:

MPEG2/subcc/HK_DVB_w_subtitle.ts
MPEG2/subcc/HK_DVB_sample.ts
ffmpeg-bugs/trac/ticket2086/teletextsubtitles.ts
ffmpeg-bugs/trac/ticket5453/vlc_cut.ts
ffmpeg-bugs/trac/ticket2838/BDAV recorded video sample.ts
samples/ffmpeg-bugs/trac/ticket3186/Lilyhammer_sample.ts
samples/ffmpeg-bugs/trac/ticket5453/vlc_cut.ts
ffmpeg-bugs/trac/ticket4469/Kodi-Reports-Error-with-DVB-Multilanguage-Subtitles.ts
ffmpeg-bugs/roundup/issue1294/hd_from_ksng_090726b.ts
V-codecs/h264/PAFF/Grey.ts

These should all be 25 fps, so most likely not ATSC...
The Hungarian DVB-T broadcaster also uses the descriptor.

Regards,
Marton
Lance Wang Aug. 23, 2020, 2:24 p.m. UTC | #6
On Sun, Aug 23, 2020 at 03:04:10PM +0200, Marton Balint wrote:
> 
> 
> On Sun, 23 Aug 2020, lance.lmwang@gmail.com wrote:
> 
> > On Sun, Aug 23, 2020 at 10:17:01AM +0200, Marton Balint wrote:
> > > 
> > > 
> > > On Sun, 23 Aug 2020, lance.lmwang@gmail.com wrote:
> > > 
> > > > On Sat, Aug 22, 2020 at 07:27:30PM +0200, Marton Balint wrote:
> > > > > > > > > On Sat, 22 Aug 2020, lance.lmwang@gmail.com wrote:
> > > > > > > > On Wed, Jul 22, 2020 at 11:27:38PM +0800,
> > > lance.lmwang@gmail.com wrote:
> > > > > > > From: Limin Wang <lance.lmwang@gmail.com>
> > > > > > > > > copy the atsc ac3 audio in ts like below:
> > > > > > > ./ffmpeg -i atsc_audio.ts -c:v copy -c:a copy out.ts
> > > > > > > Stream #0:6[0x64](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
> > > > > > > > > ./ffmpeg -i out.ts
> > > > > > > Before:
> > > > > > > Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
> > > > > > > > > After applied patch:
> > > > > > > Stream #0:1[0x101](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
> > > > > > > > > Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> > > > > > > ---
> > > > > > >  libavformat/mpegtsenc.c | 5 +++++
> > > > > > >  1 file changed, 5 insertions(+)
> > > > > > > > > diff --git a/libavformat/mpegtsenc.c
> > > > > b/libavformat/mpegtsenc.c
> > > > > > > index a5b45fb..f060ea6 100644
> > > > > > > --- a/libavformat/mpegtsenc.c
> > > > > > > +++ b/libavformat/mpegtsenc.c
> > > > > > > @@ -535,6 +535,11 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
> > > > > > >                      *q++=1; // 1 byte, all flags sets to 0
> > > > > > >                      *q++=0; // omit all fields...
> > > > > > >                  }
> > > > > > > +            } else {
> > > > > > > +                if (codec_id == AV_CODEC_ID_AC3)
> > > > > > > +                    put_registration_descriptor(&q, MKTAG('A', 'C', '-', '3'));
> > > > > > > +                else if (codec_id == AV_CODEC_ID_EAC3)
> > > > > > > +                    put_registration_descriptor(&q, MKTAG('E', 'A', 'C', '3'));
> > > > > > >              }
> > > > > > >              if (codec_id == AV_CODEC_ID_S302M)
> > > > > > >                  put_registration_descriptor(&q, MKTAG('B', 'S', 'S', 'D'));
> > > > > > > -- > > 1.8.3.1
> > > > > > > > > ping the patch, as I'll submit patch to support atsc ac3
> > > > > descriptor after that.
> > > > > > > Why is this patch needed?
> > > > > > >
> > > https://www.atsc.org/wp-content/uploads/2015/03/A52-2018-1.pdf
> > > > > > > does not seem to require the use of MPEG2 registration
> > > descriptor for ATSC.
> > > > > > > I am not saying this is patch is bad, but some valid reason
> > > should be found
> > > > > to justify it, and the fact that AC3 fourcc is reported is irrelevant, that
> > > > > is just fourcc, it can be anything.
> > > > > Most of my atsc ac3 sample write the mpeg2 descriptor, so I want
> > > to keep it when copy
> > > > the audio stream.
> > > 
> > > There are system B samples out there which also has the descriptor. So why
> > > not write it to system B as well by that reasoning?
> > 
> > Where to download such samples, most of my system sample don't write the
> > mpeg2 descriptor, that's why I haven't add it for system B.
> 
> A lot of samples are in http://samples.ffmpeg.org:
> 
> MPEG2/subcc/HK_DVB_w_subtitle.ts
> MPEG2/subcc/HK_DVB_sample.ts
> ffmpeg-bugs/trac/ticket2086/teletextsubtitles.ts
> ffmpeg-bugs/trac/ticket5453/vlc_cut.ts
> ffmpeg-bugs/trac/ticket2838/BDAV recorded video sample.ts
> samples/ffmpeg-bugs/trac/ticket3186/Lilyhammer_sample.ts
> samples/ffmpeg-bugs/trac/ticket5453/vlc_cut.ts
> ffmpeg-bugs/trac/ticket4469/Kodi-Reports-Error-with-DVB-Multilanguage-Subtitles.ts
> ffmpeg-bugs/roundup/issue1294/hd_from_ksng_090726b.ts
> V-codecs/h264/PAFF/Grey.ts
> 
> These should all be 25 fps, so most likely not ATSC...
> The Hungarian DVB-T broadcaster also uses the descriptor.

OK, I'll update to add the descriptor for both system B and ATSC.

> 
> Regards,
> Marton
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index a5b45fb..f060ea6 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -535,6 +535,11 @@  static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
                     *q++=1; // 1 byte, all flags sets to 0
                     *q++=0; // omit all fields...
                 }
+            } else {
+                if (codec_id == AV_CODEC_ID_AC3)
+                    put_registration_descriptor(&q, MKTAG('A', 'C', '-', '3'));
+                else if (codec_id == AV_CODEC_ID_EAC3)
+                    put_registration_descriptor(&q, MKTAG('E', 'A', 'C', '3'));
             }
             if (codec_id == AV_CODEC_ID_S302M)
                 put_registration_descriptor(&q, MKTAG('B', 'S', 'S', 'D'));