title: H264 to TS : Distribution of NAL Units in TS Packets
body: <p>I am trying to write ts file without using any library(like ffmpeg or etc.). I added a PAT, then PMT and then all the PES packets. The input-source I am using is a .264 file containing the bit-streams only. There I noticed that, a NAL Unit is generally greater than 184 Bytes in size. But in PES packets I have to make the payload fit in 184 Byte. So what I am doing is, getting 170 Bytes(raw data), adding the header and payload(that 170 Bytes) to form PES Packet of 188 Bytes.</p>
  
  <ol>
  <li>Is it the correct way to do that? If not, what should I do?</li>
  <li>VLC can't play that. That can be a PTS/DTS issue. How should I assign the PTS, DTS and SCR data?</li>
  <li>I only added PAT and PMT table with only 1 section. Is that enough?</li>
  </ol>