diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c old mode 100644 new mode 100755 index aba266b..7ccc183 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -568,7 +568,17 @@ static int mpegts_write_header(AVFormatContext *s) /* MPEG pid values < 16 are reserved. Applications which set st->id in * this range are assigned a calculated pid. */ if (st->id < 16) { + +#if CONFIG_AV_PID_NUMBER_PASSTHRU + // If ingest is TS: pid numbers from input + // Other than TS: pid number starts with start_pid i.e 256 + if(s->pids_num[i] == 0x2000) + ts_st->pid = ts->start_pid + i; + else + ts_st->pid = s->pids_num[i]; +#else ts_st->pid = ts->start_pid + i; +#endif } else if (st->id < 0x1FFF) { ts_st->pid = st->id; } else {