title: FFmpeg - How to trim with high precision?
body: <p>I am pretty stucked with the way that FFmpeg trims videos, so I would be really grateful if someone could help me. 
  Basically, what I am trying to do is: I have a video sequence and I want it to stop in a certain second, freeze the image some seconds (like a pause), and then reproduce again from the same exact frame. I could say that I am dealing with three videos: <strong>A.mp4</strong> (first part of the video sequence), B.mp4 (frozen image) and <strong>C.mp4</strong> (second part of the video sequence). Besides, I also perform an overlay with filter_complex.</p>
  
  <p>The part of generating a video from a static image is not a problem, my main concern is to find the way to trim and concatenate videos accurately. From other posts and sources, I discovered that FFmpeg trims from those Frames that are Keyframes, which can be forced. However, the result I obtain is not the appropriate one, because my video <strong>A</strong> ends in a frame different from the one in the beginning of <strong>C</strong>. </p>
  
  <p>The commands I am using are the following ones:</p>
  
  <pre><code>ffmpeg -y -i VideoSequence.mp4 -c:v libx264 -pix_fmt yuv420p \
  -force_key_frames "expr: gte(t,n_forced * 15)" -t 30 VideoOut.mp4
  </code></pre>
  
  <p>[Note that everything inside Filter Complex is about an Overlay, which works fine] </p>
  
  <p>As far as I know, the resulting video should have a Keyframe every 15 seconds. Now, I want to cut the video into 2 parts ("before second 15" and "after second 15"): </p>
  
  <pre><code>ffmpeg -y -ss 00:00:01 -i VideoOut.mp4 -t 14 -c copy A.mp4
  
  ffmpeg -y -ss 00:00:15 -i VideoOut.mp4 -t 5 -c copy C.mp4 
  </code></pre>
  
  <p>As mentioned, I expect the end of A.mp4 to "match" with the beginning of C.mp4 (at a frame precision), but the result I obtain is far from being perfect. </p>
  
  <p>Thank you very much, any kind of help will be appreciated!</p>