Create more than 999 images?

Phlerb

n3wb
Joined
Dec 2, 2014
Messages
13
Reaction score
3
I am trying to create a time lapse from a webcam I have hooked up to BI.

I do have it set to record 1 pic a minute and create an MP4 file, but the file is not available until it finishes recording at the end of the day...

So.... I am posting a picture a minute to a folder, and having ffmpeg batch a new movie once an hour and then batch upload it to my website. This way every hour today's timelapse is updated to include from sunrise to when the movie was created.

The problem is every 1 minute is a but too long, but what happens when I do every 20 seconds, and it gets to SkyCam_999.jpg? I need it to go start at SkyCam_0001 and use 4 digits, not 3.

10 hours of Daylight = 600 images for one per minute, but 1200 every 30 seconds, or 1800 every 20 seconds... ffmpeg need to have the format stable, so it has to ALL be 3 digit or all be 4 digit....

Is there anyway to set this up to use four digits in the naming?

Thanks
Phil
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,007
Location
USA
I apologize, I do not currently have easy access to a Blue Iris install; but have you looked in the help file for Blue Iris to find the file naming conventions? It seems like Blue Iris should be able to produce the file names you need.
 

Phlerb

n3wb
Joined
Dec 2, 2014
Messages
13
Reaction score
3
I ended up doing a %H%M%S to get a hierarchical name that sorts correctly, then run a bat file that changes the names to a SkyCam_0001.jpg format . I run this 1 minute before I run the ffmpeg to create the timelapse movie. The code checks to see if it has already been 'fixed' with the correct naming convention and skips it. This way I can take images every 20 seconds, and then 5 times a day change the names of the jpgs, then run the movie creation script, and upload the movie created and replace what is already on the server. Since it has the same name the page still points at it.

Code:
cd /D D:\Blue Iris\SkyCamPics
@echo off
setlocal enabledelayedexpansion
set "index=0000"
for /f "delims=" %%a in ('dir /a-d /b *.jpg^|findstr /rxc:"......[0-9][0-9][0-9][0-9]\.jpg"') do (
  set "name=%%~na"
  if "!name:~-4!" gtr "!index!" set "index=!name:~-4!"
)

set /a i=1%index%
for /f "delims=" %%a in ('dir /a-d /b *.jpg^|findstr /rxvc:"......[0-9][0-9][0-9][0-9]\.jpg"') do (
  set /a i+=1
  set "name=%%~na"
  ren "%%~a" "!name:~,6!!i:~-4!%%~xa"
)
exit
and my ffmpeg code:

Code:
cd /D D:\Blue Iris\SkyCamPics
ffmpeg -i SkyCam%%04d.JPG -vcodec libx264 -b:v 1800k SkyCamToday.mp4 -y
I then upload using the same bat file and a text file with the login info and directory where the mp4 is to be placed.
 
Top