escrotum icon indicating copy to clipboard operation
escrotum copied to clipboard

Video capture filename in --exec does not use the same time as the file

Open dyeo opened this issue 4 years ago • 0 comments

Occurred on Linux 5.15.7-xanmod1-tt-1 using xorg and i3wm

Steps to reproduce

  1. Start a video capture using the following command: escrotum -r '~/img/screenshots/%Y-%m-%d_%H-%M-%S.webm' -e 'echo $f'
  2. Wait 5 seconds and then end the video capture using Ctrl-Alt-s
  3. Notice that the echo'd video filename will have the seconds field be 5 seconds later than that of the actual saved file.

Possible cause

It seems as though the filename's substitutions are getting expanded once at the beginning of capture, and then expanded a second time when the command executes, which means that the strftime(2) evaluation will be different each time. By capturing the strftime once at the beginning of program execution we can ensure that this discrepancy will not exist.

dyeo avatar Dec 11 '21 23:12 dyeo