title: How to embed pic_timing SEI wallclock timecodes in RTMP streaming?
body: <p>I need to stream my desktop to the AWS MediaLive service and, as a requirement, I must include wallclock timecodes in the stream. The AWS support kindly informed me that for h.264 encoded streams, I need to provide timecodes as "pic_timing SEI messages".</p>
  
  <p>I'm streaming with FFmpeg via the RTMP protocol on Windows 10 so, I tried adding the <code>use_wallclock_as_timestamps</code> and <code>copyts</code> flags to my command.</p>
  
  <pre><code>ffmpeg -f gdigrab -framerate 30 -offset_x 0 -offset_y 0 -video_size 1920x1080 -show_region 1 -use_wallclock_as_timestamps 1 -i desktop -vf scale=320:240 -c:v libx264 -c:a aac -profile:v main -level 3.1 -pix_fmt yuv420p -copyts -f flv rtmp://&lt;ip&gt;:1935/&lt;app&gt;/&lt;stream&gt;
  </code></pre>
  
  <p>However, the timecodes are not picked up by AWS MediaLive. </p>
  
  <p>My questions are:</p>
  
  <ul>
  <li>Does the <code>use_wallclock_as_timestamps</code> flag actually create timecodes as "pic_timing SEI messages" as required?</li>
  <li>If not, how do I add wallclock timecodes as "pic_timing SEI messages"? It doesn't have to be every frame. Every 2 or 3 seconds would suffice.</li>
  </ul>
  
  <p>I'm stumped. I couldn't find the answer in the FFmpeg documentation.</p>
  
  <p>Thanks for your help.</p>