Skip to content

Commit

Permalink
ts muxer video key frame add pat and pmt
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongguangjie committed Oct 19, 2022
1 parent 15ecded commit f975524
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libmpeg/source/mpeg-ts-enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ int mpeg_ts_write(void* ts, int pid, int flags, int64_t pts, int64_t dts, const
stream->dts = dts;
stream->data_alignment_indicator = (flags & MPEG_FLAG_IDR_FRAME) ? 1 : 0; // idr frame
tsctx->h264_h265_with_aud = (flags & MPEG_FLAG_H264_H265_WITH_AUD) ? 1 : 0;


// Add PAT and PMT for video IDR frame
tsctx->pat_period = ((flags & MPEG_FLAG_IDR_FRAME) && mpeg_stream_type_video(stream->codecid)) ? 0 : tsctx->pat_period;
// set PCR_PID
//assert(1 == tsctx->pat.pmt_count);
if (0x1FFF == pmt->PCR_PID || (PES_SID_VIDEO == (stream->sid & PES_SID_VIDEO) && pmt->PCR_PID != stream->pid))
Expand Down

0 comments on commit f975524

Please sign in to comment.