6

Can I use ffmpeg to record my Xorg desktop (without audio) at one frame a second into a video file that will play back the frames at 30 frames per second without requiring a conversion process?

The following command records my left display at 1 frame per second but the resulting video will advance the video frame once per second.

ffmpeg -r 1 -f x11grab -s 1920,1080 -i :0.0+0,0 -vcodec libx264 -crf 0 -preset ultrafast -threads 0 out.mkv

Known alternatives:

  1. Make screenshots at an interval, then combine videos using mencoder
  2. As #1 but using ffmpeg
  3. Record a video of the desktop with ffmpeg at 1 fps or less, if the encoder supports such numbers and speed up the video afterwards via ffmpeg.

If it is not possible with ffmpeg alone, would a combination of import and ffmpeg or some other tools allow the time-leap video to be ready as quickly as possible after ending the recording?

  • Is there a super need for this, like making sped up demo or how-to videos or something? – Xen2050 Dec 9 '15 at 7:24
5

This should work:

ffmpeg -framerate 1 -f x11grab -s 1920,1080 -i :0.0+0,0 -vf settb=\(1/30\),setpts=N/TB/30 -r 30 -vcodec libx264 -crf 0 -preset ultrafast -threads 0 out.mkv

EDIT: escaped parentheses from the shell

  • With the command from this answer will be 1 screenshot per second taken, shown later at 30 fps - resulting in 30x speedup. In case you want more, you can e.g. use -framerate 0.5, resulting in a 60x speedup, still shown at 30 fps. – Zaroth May 23 at 21:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.