title: How can i stop ffmpeg screen recording correctly?
body: <p>I am recording my screen and saving it to a *.mkv container (I am not sure it is what i really need, i have chosen it because a matadata in start of the file, and had hoped the file will be OK if simething will be wrong) using command:</p>
  
  <pre><code>ffmpeg -f x11grab -r 7 -s 1920x1080 -i :0.0 -vcodec png -f segment -segment_time 20 Video_%02d.mkv
  </code></pre>
  
  <p>I have problem: When a shut down my pc, using the hardware button :), i have 0 size video file segment, i don't know why it happens.</p>