2

I have a CCTV camera that uploads JPEG images (.jpg) to an FTP server when it detects movement. We seem to get quite a few images, so I would like to make them into a video to ease viewing.

I've done several Google searches, but nothing quite produces what I expect to see. The folder I am using has over 2000 images which are named AyyMMddhhmmssff.jpg. If I need to rename, I can do that since I already find I need to for FFMPEG to work.

I'd like an image per second, or maybe 2 per second so the images are easy to view when playing the video back. Yes, I know that will result in a 20/40min+ video!

I'm happy with a Windows, macOS or Ubuntu solution! My preference would be Windows (since that is where the FTP server is).

ImageMagick

convert *.jpg video.mpg

This sounded great, nice and simple. However, I have tried on my Mac (installed via brew) and Ubuntu and both grind performance of the relative system to a halt and after 20 minutes, still not finished. I had to reboot the Mac as I couldn't do anything!

FFMPEG

ffmpeg -y -r 6 -f image2 -s 1920x1080 -i <path>\%06d.jpg -vcodec libx264 -pix_fmt yuv420p <path>/video.mp4

I'm no expert when it comes to using FFMPEG, but I have used it for several tasks and found it to be a great utility to have around. The above command does produce a video, but the images display too quickly removing the point of the video. I tried tweaking the values and can get it better, but not exactly what I am after. One attempt (setting -r 1 IIRC) resulted in a single image for the entire video! Its clear I don't understand the various arguments in the FFMPEG command even though I have looked at the manual!

3

If you rename the images to be consecutively numbered, then you can use

ffmpeg -y -framerate 1 -i <path>\%06d.jpg -r 5 -c:v libx264 -pix_fmt yuv420p <path>/video.mp4

Consecutively numbered, as in 000001.jpg,000002.jpg,000003.jpg... Note that there are exactly 6 characters in each name, which satisfies the %06d passed on to ffmpeg.

If you don't want to rename, then create a text file of the form,

file first.jpg
file second.jpg
file third.jpg
...
file last.jpg

and then

ffmpeg -f concat -r 1 -i list.txt -r 5 -c:v libx264 -pix_fmt yuv420p <path>/video.mp4
  • I have already been renaming the images in the format "yyyyMMdd_000001.jpg" etc. but when I run your command, I get the same result I have seen previously with FFMPEG of a single image throughout the video (41mins). Would the name be causing this or something else?! – neildeadman Nov 28 '18 at 15:50
  • Add -report to your execution and paste or link to he report in your Q. – Gyan Nov 28 '18 at 15:52
  • With that number of images the log was too long to post to pastebin, so I reduced the number of images processed, same result: pastebin.com/03CTErCu – neildeadman Nov 29 '18 at 9:34
  • The log shows no errors; it is as expected. Can you share the output? – Gyan Nov 29 '18 at 10:34
  • 1
    There was a long standing bug with low framerates in VLC. Fixed a few months back. – Gyan Nov 29 '18 at 11:56

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.