spacepaste

  1.  
  2. TMP=.
  3. SRC=countdown.mp4
  4. DST=output.mp4
  5. FREEZE_S=10
  6. cd "$TMP"
  7. FRAMERATE=$(ffprobe -v 0 -of csv=p=0 -select_streams 0 -show_entries stream=r_frame_rate "$SRC")
  8. ffmpeg -i "$SRC" -vf "select='eq(n,364)'" -vframes 1 LAST_FRAME.PNG
  9. ffmpeg -loop 1 -framerate 1 -i LAST_FRAME.png -r "$FRAMERATE" -t "$FREEZE_S" -pix_fmt yuv420p LAST_FRAME.mp4
  10. printf "file %q\n" "$SRC" LAST_FRAME.mp4 > list.txt
  11. ffmpeg -y -f concat -safe 0 -i list.txt -c copy "$DST"
  12.