title: Identify and modify H264 I, P, B frames
body: <p>I use VLC to stream H264 video file in MPEG TS container through UDP over LAN. I capture packets in client side with Wireshark and here you can find pcap file: <a href="http://www.sendspace.com/file/w0sf36" rel="nofollow">http://www.sendspace.com/file/w0sf36</a></p>
  
  <p>Is it true that I need to work with MPEG PES to identify I, P or B frames? If so, how can I do that? Here is data of one MPEG PES packet: <a href="http://pastebin.com/NayLBx5w" rel="nofollow">http://pastebin.com/NayLBx5w</a> . It starts with bytes 0x00 0x00 0x00 0x01. Which bytes should I use to reach my goal?</p>
  
  <p>In pcap file you can see that MPEG PES packets take only 2% of all stream and others packets are simple UDP. Is it enough to work with MPEG PES packets? What information UDP packets carry in this case?</p>
  
  <p>EDIT: This is the typical output I get in Windows using ffprobe. </p>
  
  <pre><code>[PACKET]
  codec_type=audio
  stream_index=1
  pts=54010800
  pts_time=600.120000
  dts=54010800
  dts_time=600.120000
  duration=2160
  duration_time=0.024000
  convergence_duration=N/A
  convergence_duration_time=N/A
  size=96
  pos=1460384
  flags=K
  [/PACKET]
  [PACKET]
  codec_type=video
  stream_index=0
  pts=54012012
  pts_time=600.133467
  dts=54006006
  dts_time=600.066733
  duration=3003
  duration_time=0.033367
  convergence_duration=N/A
  convergence_duration_time=N/A
  size=207953
  pos=1098672
  flags=_
  [/PACKET]
  [PACKET]
  codec_type=video
  stream_index=0
  pts=54009009
  pts_time=600.100100
  dts=54009009
  dts_time=600.100100
  duration=3003
  duration_time=0.033367
  convergence_duration=N/A
  convergence_duration_time=N/A
  size=145530
  pos=1311676
  flags=_
  [/PACKET]
  [PACKET]
  codec_type=audio
  stream_index=1
  pts=54012960
  pts_time=600.144000
  dts=54012960
  dts_time=600.144000
  duration=2160
  duration_time=0.024000
  convergence_duration=N/A
  convergence_duration_time=N/A
  size=96
  pos=1507948
  flags=K
  [/PACKET]
  [PACKET]
  codec_type=video
  stream_index=0
  pts=54018018
  pts_time=600.200200
  dts=54012012
  dts_time=600.133467
  duration=3003
  duration_time=0.033367
  convergence_duration=N/A
  convergence_duration_time=N/A
  size=46173
  pos=1460572
  flags=_
  [/PACKET]
  </code></pre>