Create video from bunch of JPEGs











up vote
2
down vote

favorite












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!










share|improve this question


























    up vote
    2
    down vote

    favorite












    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!










    share|improve this question
























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      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!










      share|improve this question













      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!







      ffmpeg jpeg






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 28 at 12:31









      neildeadman

      2471321




      2471321






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          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





          share|improve this answer





















          • 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 at 15:50










          • Add -report to your execution and paste or link to he report in your Q.
            – Gyan
            Nov 28 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 at 9:34










          • The log shows no errors; it is as expected. Can you share the output?
            – Gyan
            Nov 29 at 10:34












          • You mean the actual video?
            – neildeadman
            Nov 29 at 11:00











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1379071%2fcreate-video-from-bunch-of-jpegs%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote



          accepted










          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





          share|improve this answer





















          • 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 at 15:50










          • Add -report to your execution and paste or link to he report in your Q.
            – Gyan
            Nov 28 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 at 9:34










          • The log shows no errors; it is as expected. Can you share the output?
            – Gyan
            Nov 29 at 10:34












          • You mean the actual video?
            – neildeadman
            Nov 29 at 11:00















          up vote
          2
          down vote



          accepted










          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





          share|improve this answer





















          • 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 at 15:50










          • Add -report to your execution and paste or link to he report in your Q.
            – Gyan
            Nov 28 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 at 9:34










          • The log shows no errors; it is as expected. Can you share the output?
            – Gyan
            Nov 29 at 10:34












          • You mean the actual video?
            – neildeadman
            Nov 29 at 11:00













          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          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





          share|improve this answer












          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






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 28 at 13:09









          Gyan

          14.2k21643




          14.2k21643












          • 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 at 15:50










          • Add -report to your execution and paste or link to he report in your Q.
            – Gyan
            Nov 28 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 at 9:34










          • The log shows no errors; it is as expected. Can you share the output?
            – Gyan
            Nov 29 at 10:34












          • You mean the actual video?
            – neildeadman
            Nov 29 at 11:00


















          • 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 at 15:50










          • Add -report to your execution and paste or link to he report in your Q.
            – Gyan
            Nov 28 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 at 9:34










          • The log shows no errors; it is as expected. Can you share the output?
            – Gyan
            Nov 29 at 10:34












          • You mean the actual video?
            – neildeadman
            Nov 29 at 11:00
















          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 at 15:50




          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 at 15:50












          Add -report to your execution and paste or link to he report in your Q.
          – Gyan
          Nov 28 at 15:52




          Add -report to your execution and paste or link to he report in your Q.
          – Gyan
          Nov 28 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 at 9:34




          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 at 9:34












          The log shows no errors; it is as expected. Can you share the output?
          – Gyan
          Nov 29 at 10:34






          The log shows no errors; it is as expected. Can you share the output?
          – Gyan
          Nov 29 at 10:34














          You mean the actual video?
          – neildeadman
          Nov 29 at 11:00




          You mean the actual video?
          – neildeadman
          Nov 29 at 11:00


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1379071%2fcreate-video-from-bunch-of-jpegs%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          If I really need a card on my start hand, how many mulligans make sense? [duplicate]

          Alcedinidae

          Can an atomic nucleus contain both particles and antiparticles? [duplicate]