View Single Post
chucker
 
Join Date: May 2004
Location: near Bremen, Germany
Send a message via ICQ to chucker Send a message via AIM to chucker Send a message via MSN to chucker Send a message via Yahoo to chucker Send a message via Skype™ to chucker 
2020-09-22, 16:12

Quote:
Originally Posted by turtle View Post
The scripting part only gets "complicated" in a few points and those are the ones I'm iffy on of course. Like, how do I get ffmpeg to only look at images from yesterday with the date changing every day. So programmatically, how to I script it to use only the day before's images?
You can use `date` as before, but change the relative date:

Code:
echo (date -v-1d +%Y%m%d_%H%M%S)
`-v` means "adjust". `-1d` means "subtract 1 day". You can also do `1d`, which sets the day to 1 (so, September 1st). Or `+1d`, i.e. tomorrow.

Quote:
Originally Posted by turtle View Post
I can list out the day before using find, but how do I translate that into something ffmpeg can use?
You may need xargs here. It lets you take a collection of data, then call something for each item in it.

For example:

Code:
find Downloads -name '*.txt' -print0 | xargs -0 ls -l
This recursively looks through Downloads for names ending with .txt, and calls `ls -l` for each of them. The output will look as though it's all just one big dir, but it's not.

The `-print0` bit here means "don't end these items in a linebreak, but rather with a \0". It's a safer way (if, say, you have some funny characters in your file names) that isn't human-readable, but fine for machine-processing. Then we pipe that to `xargs`, which also gets told to expect \0, using `-0`. And then we tell xargs what to do with each item: call `ls -l`.

It sounds like for this use case, though, you need something more like concatenating multiple files and passing those to ffmpeg? Not sure.

I'm not really sure how you're planning to actually create this timelapse from a series of images. I'm guessing you've already figured that part out.
  quote