[FFmpeg-devel] [PATCH] Add optional NIT table generation

Ubaldo Porcheddu ubaldo at eja.it
Wed May 12 14:09:22 EEST 2021


Hi Marton,

>> +    }
>> +
>> +    //private data
>> +    desc_len += 6 + 2;
>> +    *q++ = 0x5F;
>> +    *q++ = 4;
>> +    *q++ = 0x00;
>> +    *q++ = 0x00;
>> +    put16(&q, 40);
> 
> What are these?

I didn't find any official document about it but this seems to be the 
way many national (FR,IT,UK) broadcasters are writing the virtual 
channel private data header and the one recognized by many popular tv on 
the market.

>> +    ts->nit_period = av_rescale(ts->nit_period_us, PCR_TIME_BASE,
> AV_TIME_BASE);
>> 
>>     if (ts->mux_rate == 1)
>>         av_log(s, AV_LOG_VERBOSE, "muxrate VBR, ");
>> @@ -1154,12 +1237,14 @@ static int mpegts_init(AVFormatContext *s)
>>            "sdt every %"PRId64" ms, pat/pmt every %"PRId64" ms\n",
>>            av_rescale(ts->sdt_period, 1000, PCR_TIME_BASE),
>>            av_rescale(ts->pat_period, 1000, PCR_TIME_BASE));
>> +    if (ts->nit_enable > 0)
>> +        av_log(s, AV_LOG_VERBOSE, "nit every %"PRId64" ms\n",
> av_rescale(ts->nit_period, 1000, PCR_TIME_BASE));
> 
> Maybe you should continue the last log line which already describes
> the
> interval of various tables, and not start a new line.

The idea is to have the NIT emission optional so I don't know if is a 
good idea to stat its periodical transmission on the same line, when 
disabled?

>> +    { "nit_enable", "Enable NIT transmission",
>> +      OFFSET(nit_enable), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, ENC
> },
> 
> As I wrote earlier, instead of a separate option, you should introduce
> a
> new flag in mpegts_flags.

ok almost ready also with this

> Also docs/muxers.texi update is missing for the new feature.

is there any guide on what an how to add it? :)



More information about the ffmpeg-devel mailing list