Skip to content

Instantly share code, notes, and snippets.

@clementnuss
Last active March 21, 2022 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clementnuss/97471a33c2f2517adb93c1cc67980200 to your computer and use it in GitHub Desktop.
Save clementnuss/97471a33c2f2517adb93c1cc67980200 to your computer and use it in GitHub Desktop.

the following ffmpeg permits to save images in highest quality to generate a timelapse:

export RTSP_STREAM='rtsps://abcdeffhijklmnop:1234/asdlfkjasdlf'
ffmpeg -loglevel error -rtsp_transport tcp \
  -i $RTSP_STREAM \
  -vf fps=1/120 \
  -q:v 1 -strftime 1 \
  "%Y-%m-%d_%H-%M-%S.jpg"
  • the vf (videofilter) fps=1/120 selects one image every 120 second, adjust as needed
  • q:v 1 selects the highest video setting for the exported images
  • -strftime 1 permits to have the timestamp in the file name, as described here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment