How to create a video from images using FFmpeg?












84















Is it possible to use ffmpeg create a video from a set of sequences, where the number does not start from zero?



For example, I have some images [test_100.jpg, test_101.jpg, test_102.jpg, ..., test_200.jpg], and I want to convert them to a video. I tried the following command, but it didn't work (it seems the number should start from zero):




ffmpeg -i test_%d.jpg -vcodec mpeg4 test.avi




Any advise?










share|improve this question















migrated from stackoverflow.com Jul 26 '13 at 13:48


This question came from our site for professional and enthusiast programmers.



















  • It's been a while since you asked this, but if you're still interested in the question, the answer is YES -- I've posted the details and an example below: stackoverflow.com/a/12160155/181638

    – Assad Ebrahim
    Aug 28 '12 at 13:20











  • @casperOne would be useful to have an idea why this is off topic. It seems like a specific programming problem. The FFmpeg tag has 3.7k followers, and with 27k views clearly people find it useful..

    – geotheory
    May 20 '13 at 10:36






  • 2





    @geotheory The tag stats are irrelevant. ffmpeg is a program much in the way of say, WinRar. While you can program against the libraries in ffmpeg, this question is not about that. Using ffmpeg from the command line is to be asked on Super User, where it's on topic.

    – casperOne
    May 20 '13 at 11:45
















84















Is it possible to use ffmpeg create a video from a set of sequences, where the number does not start from zero?



For example, I have some images [test_100.jpg, test_101.jpg, test_102.jpg, ..., test_200.jpg], and I want to convert them to a video. I tried the following command, but it didn't work (it seems the number should start from zero):




ffmpeg -i test_%d.jpg -vcodec mpeg4 test.avi




Any advise?










share|improve this question















migrated from stackoverflow.com Jul 26 '13 at 13:48


This question came from our site for professional and enthusiast programmers.



















  • It's been a while since you asked this, but if you're still interested in the question, the answer is YES -- I've posted the details and an example below: stackoverflow.com/a/12160155/181638

    – Assad Ebrahim
    Aug 28 '12 at 13:20











  • @casperOne would be useful to have an idea why this is off topic. It seems like a specific programming problem. The FFmpeg tag has 3.7k followers, and with 27k views clearly people find it useful..

    – geotheory
    May 20 '13 at 10:36






  • 2





    @geotheory The tag stats are irrelevant. ffmpeg is a program much in the way of say, WinRar. While you can program against the libraries in ffmpeg, this question is not about that. Using ffmpeg from the command line is to be asked on Super User, where it's on topic.

    – casperOne
    May 20 '13 at 11:45














84












84








84


30






Is it possible to use ffmpeg create a video from a set of sequences, where the number does not start from zero?



For example, I have some images [test_100.jpg, test_101.jpg, test_102.jpg, ..., test_200.jpg], and I want to convert them to a video. I tried the following command, but it didn't work (it seems the number should start from zero):




ffmpeg -i test_%d.jpg -vcodec mpeg4 test.avi




Any advise?










share|improve this question
















Is it possible to use ffmpeg create a video from a set of sequences, where the number does not start from zero?



For example, I have some images [test_100.jpg, test_101.jpg, test_102.jpg, ..., test_200.jpg], and I want to convert them to a video. I tried the following command, but it didn't work (it seems the number should start from zero):




ffmpeg -i test_%d.jpg -vcodec mpeg4 test.avi




Any advise?







linux ffmpeg






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 5 '17 at 13:35









JakeGould

31.4k1096138




31.4k1096138










asked May 13 '10 at 17:58







vailen











migrated from stackoverflow.com Jul 26 '13 at 13:48


This question came from our site for professional and enthusiast programmers.









migrated from stackoverflow.com Jul 26 '13 at 13:48


This question came from our site for professional and enthusiast programmers.















  • It's been a while since you asked this, but if you're still interested in the question, the answer is YES -- I've posted the details and an example below: stackoverflow.com/a/12160155/181638

    – Assad Ebrahim
    Aug 28 '12 at 13:20











  • @casperOne would be useful to have an idea why this is off topic. It seems like a specific programming problem. The FFmpeg tag has 3.7k followers, and with 27k views clearly people find it useful..

    – geotheory
    May 20 '13 at 10:36






  • 2





    @geotheory The tag stats are irrelevant. ffmpeg is a program much in the way of say, WinRar. While you can program against the libraries in ffmpeg, this question is not about that. Using ffmpeg from the command line is to be asked on Super User, where it's on topic.

    – casperOne
    May 20 '13 at 11:45



















  • It's been a while since you asked this, but if you're still interested in the question, the answer is YES -- I've posted the details and an example below: stackoverflow.com/a/12160155/181638

    – Assad Ebrahim
    Aug 28 '12 at 13:20











  • @casperOne would be useful to have an idea why this is off topic. It seems like a specific programming problem. The FFmpeg tag has 3.7k followers, and with 27k views clearly people find it useful..

    – geotheory
    May 20 '13 at 10:36






  • 2





    @geotheory The tag stats are irrelevant. ffmpeg is a program much in the way of say, WinRar. While you can program against the libraries in ffmpeg, this question is not about that. Using ffmpeg from the command line is to be asked on Super User, where it's on topic.

    – casperOne
    May 20 '13 at 11:45

















It's been a while since you asked this, but if you're still interested in the question, the answer is YES -- I've posted the details and an example below: stackoverflow.com/a/12160155/181638

– Assad Ebrahim
Aug 28 '12 at 13:20





It's been a while since you asked this, but if you're still interested in the question, the answer is YES -- I've posted the details and an example below: stackoverflow.com/a/12160155/181638

– Assad Ebrahim
Aug 28 '12 at 13:20













@casperOne would be useful to have an idea why this is off topic. It seems like a specific programming problem. The FFmpeg tag has 3.7k followers, and with 27k views clearly people find it useful..

– geotheory
May 20 '13 at 10:36





@casperOne would be useful to have an idea why this is off topic. It seems like a specific programming problem. The FFmpeg tag has 3.7k followers, and with 27k views clearly people find it useful..

– geotheory
May 20 '13 at 10:36




2




2





@geotheory The tag stats are irrelevant. ffmpeg is a program much in the way of say, WinRar. While you can program against the libraries in ffmpeg, this question is not about that. Using ffmpeg from the command line is to be asked on Super User, where it's on topic.

– casperOne
May 20 '13 at 11:45





@geotheory The tag stats are irrelevant. ffmpeg is a program much in the way of say, WinRar. While you can program against the libraries in ffmpeg, this question is not about that. Using ffmpeg from the command line is to be asked on Super User, where it's on topic.

– casperOne
May 20 '13 at 11:45










12 Answers
12






active

oldest

votes


















73














There is no need to rename files if using the -start_number switch like so:



ffmpeg -start_number n -i test_%d.jpg -vcodec mpeg4 test.avi


where n is the start of the sequence of stills.



Note, this will work as long as the sequence is unbroken once it starts. If there are gaps and you want all of the stills included, then renumbering may be necessary to fill the gaps.



There are some other switches you might find useful.



I use the following one liner to get a slower frame rate and to compress the images and have a smaller resulting video:



ffmpeg.exe -f image2 -framerate 25 -pattern_type sequence -start_number 1234 
-r 3 -i Imgp%04d.jpg -s 720x480 test.avi


The -r 3 option sets the framerate of the resulting video to 3 frames per second so that I can see each still for a short period of time. The -s option rescales the pictures to the desired resolution to manage the size of the resulting video.



(In the Windows shell, replace -i Imgp%04d.jpg with -i "Imgp%%04d.jpg". Credit for this to Mike Fitzpatrick https://superuser.com/a/344178/153054)






share|improve this answer





















  • 4





    what's the difference between -r and -framerate?

    – nuno_cruz
    Oct 24 '12 at 20:21






  • 1





    they're the same IIRC

    – rogerdpack
    Feb 18 '13 at 16:34






  • 21





    No need for numbering nonsense, as long as you're happy to accept the order they appear in (say) 'ls'... just use: ffmpeg -pattern_type glob -i '*.jpg' movie.mp4

    – Orwellophile
    Nov 3 '13 at 5:32








  • 2





    Is there any switch to control the time gap between images,say, I'd like to show the first image 13s,the second 15s,24s for the third,time gap is user defined,is that possible?

    – zionpi
    Feb 26 '16 at 8:00








  • 2





    see also trac.ffmpeg.org/wiki/…

    – d3vid
    Apr 20 '16 at 8:43



















35














you can use this below code snippet:



 cat *.jpg | ffmpeg -f image2pipe -r 1 -vcodec mjpeg -i - -vcodec libx264 out.mp4





share|improve this answer
























  • This does not rotate JPGs to the rotation stated in metadata.

    – Erik Johansson
    Oct 13 '15 at 8:16



















17














You can find an example script in the ffmpeg documentation:




3.2 How do I encode single pictures into movies?



If you have large number of pictures to rename, you can use the following command to ease the burden. The command, using the bourne shell syntax, symbolically links all files in the current directory that match *jpg to the /tmp' directory in the sequence ofimg001.jpg', `img002.jpg' and so on.




x=1; for i in *jpg; do counter=$(printf %03d $x); ln "$i" /tmp/img"$counter".jpg; x=$(($x+1)); done



Then run:




ffmpeg -f image2 -i /tmp/img%03d.jpg /tmp/a.mpg





share|improve this answer



















  • 2





    You'd be better making x=0 to start so the image name's start img000.jpg as this is what ffmpeg expects. Also symlinking didn't work for me as ffmpeg couldn't find the files so I had to use cp instead (obvious speed and space draw backs but I rm them after anyway). mv would also work if you don't mind losing the originals.

    – RyanfaeScotland
    Mar 28 '13 at 14:21











  • Note that in this answer, the command provided creates hardlinks, not symlinks. Regarding the use of cp if linking doesn't work, if your filesystem supports it cp --reflink=auto will achieve much better speed/space usage.

    – Félix Saparelli
    Jun 5 '15 at 1:00



















12














From ffmpeg's docs:



Using a glob pattern



ffmpeg also supports bash-style globbing (* represents any number of any characters).



This is useful if your images are sequential but not necessarily in a numerically sequential order as in the previous examples.



ffmpeg -r 1 -pattern_type glob -i 'test_*.jpg' -c:v libx264 out.mp4


So, as long as your files are sorted, using the -pattern_type glob switch should work for you.






share|improve this answer
























  • Note that this glob is more limited than regular shell globs: trac.ffmpeg.org/ticket/3620 apparently because image type is deduced from the extension.

    – Ciro Santilli 新疆改造中心 六四事件 法轮功
    Dec 17 '16 at 17:02



















11














As far as I know, you cannot start the sequence in random numbers (I don't remember if you should start it at 0 or 1), plus, it cannot have gaps, if it does, ffmpeg will assume the sequence is over and stop adding more images.



Also, as stated in the comments to my answer, remember you need to specify the width of your index. Like:



image%03d.jpg



And if you use a %03d index type, you need to pad your filenames with 0, like :



image001.jpg
image002.jpg
image003.jpg



etc.






share|improve this answer



















  • 1





    If the image file names have leading zeros then the format string must also specify the width like "%03d".

    – Hudson
    May 13 '10 at 18:17






  • 1





    If that's the only obstacle, you could just write a script to either rename or symlink your images to a properly reindexed set.

    – Cascabel
    May 13 '10 at 18:18






  • 1





    Yes, I've worked with this before, I wrote a wrapper in Ruby a while ago where you called instance.addImage(), then instance.processVideo() and it would create a temporal directory, copy/rename the images with proper indices and create the video. It is quite easy.

    – Francisco Soto
    May 13 '10 at 18:25











  • @Jefromi I have created a symlink but how do I give the path of the symlink file to ffmpeg? It just assumes the symlink file is the image I am trying to convert? I'm on win7 btw

    – Jared Glass
    Apr 12 '12 at 16:13











  • The sequence can start anywhere from 0 to 4 inclusive.

    – Assad Ebrahim
    Aug 28 '12 at 12:11



















5














I agree with Francisco, but as a workaround you could just write a quick script to move or create symbolic links to the files with the sequence numbers that ffmpeg needs. The script could then call ffmpeg and then remove the links or move the files back to their original locations.






share|improve this answer































    1














    look up



    x=1; for i in *jpg; do counter=$(printf %03d $x); ln "$i"
    /tmp/img"$counter".jpg; x=$(($x+1)); done





    share|improve this answer































      0














      I used the flv encoder since my video was going in a flash player (Jwplayer)



      ffmpeg -i %d.jpg -vcodec flv test.flv






      share|improve this answer































        0














        From the documentation, it seems you can simply use *



        For example, for creating a video from filenames matching the glob pattern foo-*.jpeg:

        ffmpeg -f image2 -pattern_type glob -framerate 12 -i 'foo-*.jpeg' -s WxH foo.avi


        As a note, to improve affect the quality, the rate/fps might be important (eg, first specifying very low/high frame rate and then pass from a second filter that will make the slow motion video to normal?)






        share|improve this answer































          0














          I know this is an old question but I came across it in Google while looking for the same answer. None of the answers here satisfied me completely so I did more searching and reading and this is a command that I came up with for my own problem.



          cat {0032..1501}*.png | ffmpeg -f image2pipe -framerate 5 -i - -s 720x480 test2.avi


          The reason why i'd use a command like this is...




          1. Cat and -f image2pipe give you finer control over what images you
            use. For example it allows you to use bash features like bracket
            expansion and other commands like grep to fine-tune your results
            should you choose.

          2. Fewer switches to remember.

          3. I recommend NOT using -r, and just use -framerate instead. In my
            experience -r tends to drop frames more often.

          4. Less complex, no unnecessary switches in use and it will work as-is.
            You may add more complexity (for example, specifying encoder) and
            fine tune to suit your needs.






          share|improve this answer
























          • For the OP's question, -start_number is all that's needed.

            – Gyan
            Aug 4 '16 at 5:29



















          0














          In my case, it was a little trickier because of the numbers in the files. Here's how my images look like:



          $ ls | head -5
          2014_aq_unprocessed 001.jpg
          2014_aq_unprocessed 002.jpg
          2014_aq_unprocessed 003.jpg
          2014_aq_unprocessed 004.jpg
          2014_aq_unprocessed 005.jpg


          and here's the command I used:



          ffmpeg -i 2014_aq_unprocessed %3d.jpg  -vcodec mpeg4 test.avi





          share|improve this answer































            0














            You can do this with convert -morph:



            convert *.jpg -delay 10 -morph 10 %05d.jpg


            If you want to use ffmpeg, I used



            ffmpeg -pattern_type glob -i '*.jpg' -vf "setpts=10*PTS" movie.mp4


            where the 10*PTS tells ffmpeg to slow it down 10 times. You can also have fractions there to speed it up.






            share|improve this answer


























            • This is just interpolating your original image sequence to a new space, it doesn't create a video file like the OP asked.

              – f0ster
              Mar 18 '16 at 17:13











            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',
            autoActivateHeartbeat: false,
            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%2f624567%2fhow-to-create-a-video-from-images-using-ffmpeg%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown
























            12 Answers
            12






            active

            oldest

            votes








            12 Answers
            12






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            73














            There is no need to rename files if using the -start_number switch like so:



            ffmpeg -start_number n -i test_%d.jpg -vcodec mpeg4 test.avi


            where n is the start of the sequence of stills.



            Note, this will work as long as the sequence is unbroken once it starts. If there are gaps and you want all of the stills included, then renumbering may be necessary to fill the gaps.



            There are some other switches you might find useful.



            I use the following one liner to get a slower frame rate and to compress the images and have a smaller resulting video:



            ffmpeg.exe -f image2 -framerate 25 -pattern_type sequence -start_number 1234 
            -r 3 -i Imgp%04d.jpg -s 720x480 test.avi


            The -r 3 option sets the framerate of the resulting video to 3 frames per second so that I can see each still for a short period of time. The -s option rescales the pictures to the desired resolution to manage the size of the resulting video.



            (In the Windows shell, replace -i Imgp%04d.jpg with -i "Imgp%%04d.jpg". Credit for this to Mike Fitzpatrick https://superuser.com/a/344178/153054)






            share|improve this answer





















            • 4





              what's the difference between -r and -framerate?

              – nuno_cruz
              Oct 24 '12 at 20:21






            • 1





              they're the same IIRC

              – rogerdpack
              Feb 18 '13 at 16:34






            • 21





              No need for numbering nonsense, as long as you're happy to accept the order they appear in (say) 'ls'... just use: ffmpeg -pattern_type glob -i '*.jpg' movie.mp4

              – Orwellophile
              Nov 3 '13 at 5:32








            • 2





              Is there any switch to control the time gap between images,say, I'd like to show the first image 13s,the second 15s,24s for the third,time gap is user defined,is that possible?

              – zionpi
              Feb 26 '16 at 8:00








            • 2





              see also trac.ffmpeg.org/wiki/…

              – d3vid
              Apr 20 '16 at 8:43
















            73














            There is no need to rename files if using the -start_number switch like so:



            ffmpeg -start_number n -i test_%d.jpg -vcodec mpeg4 test.avi


            where n is the start of the sequence of stills.



            Note, this will work as long as the sequence is unbroken once it starts. If there are gaps and you want all of the stills included, then renumbering may be necessary to fill the gaps.



            There are some other switches you might find useful.



            I use the following one liner to get a slower frame rate and to compress the images and have a smaller resulting video:



            ffmpeg.exe -f image2 -framerate 25 -pattern_type sequence -start_number 1234 
            -r 3 -i Imgp%04d.jpg -s 720x480 test.avi


            The -r 3 option sets the framerate of the resulting video to 3 frames per second so that I can see each still for a short period of time. The -s option rescales the pictures to the desired resolution to manage the size of the resulting video.



            (In the Windows shell, replace -i Imgp%04d.jpg with -i "Imgp%%04d.jpg". Credit for this to Mike Fitzpatrick https://superuser.com/a/344178/153054)






            share|improve this answer





















            • 4





              what's the difference between -r and -framerate?

              – nuno_cruz
              Oct 24 '12 at 20:21






            • 1





              they're the same IIRC

              – rogerdpack
              Feb 18 '13 at 16:34






            • 21





              No need for numbering nonsense, as long as you're happy to accept the order they appear in (say) 'ls'... just use: ffmpeg -pattern_type glob -i '*.jpg' movie.mp4

              – Orwellophile
              Nov 3 '13 at 5:32








            • 2





              Is there any switch to control the time gap between images,say, I'd like to show the first image 13s,the second 15s,24s for the third,time gap is user defined,is that possible?

              – zionpi
              Feb 26 '16 at 8:00








            • 2





              see also trac.ffmpeg.org/wiki/…

              – d3vid
              Apr 20 '16 at 8:43














            73












            73








            73







            There is no need to rename files if using the -start_number switch like so:



            ffmpeg -start_number n -i test_%d.jpg -vcodec mpeg4 test.avi


            where n is the start of the sequence of stills.



            Note, this will work as long as the sequence is unbroken once it starts. If there are gaps and you want all of the stills included, then renumbering may be necessary to fill the gaps.



            There are some other switches you might find useful.



            I use the following one liner to get a slower frame rate and to compress the images and have a smaller resulting video:



            ffmpeg.exe -f image2 -framerate 25 -pattern_type sequence -start_number 1234 
            -r 3 -i Imgp%04d.jpg -s 720x480 test.avi


            The -r 3 option sets the framerate of the resulting video to 3 frames per second so that I can see each still for a short period of time. The -s option rescales the pictures to the desired resolution to manage the size of the resulting video.



            (In the Windows shell, replace -i Imgp%04d.jpg with -i "Imgp%%04d.jpg". Credit for this to Mike Fitzpatrick https://superuser.com/a/344178/153054)






            share|improve this answer















            There is no need to rename files if using the -start_number switch like so:



            ffmpeg -start_number n -i test_%d.jpg -vcodec mpeg4 test.avi


            where n is the start of the sequence of stills.



            Note, this will work as long as the sequence is unbroken once it starts. If there are gaps and you want all of the stills included, then renumbering may be necessary to fill the gaps.



            There are some other switches you might find useful.



            I use the following one liner to get a slower frame rate and to compress the images and have a smaller resulting video:



            ffmpeg.exe -f image2 -framerate 25 -pattern_type sequence -start_number 1234 
            -r 3 -i Imgp%04d.jpg -s 720x480 test.avi


            The -r 3 option sets the framerate of the resulting video to 3 frames per second so that I can see each still for a short period of time. The -s option rescales the pictures to the desired resolution to manage the size of the resulting video.



            (In the Windows shell, replace -i Imgp%04d.jpg with -i "Imgp%%04d.jpg". Credit for this to Mike Fitzpatrick https://superuser.com/a/344178/153054)







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 20 '17 at 10:04









            Community

            1




            1










            answered Aug 28 '12 at 13:19









            Assad EbrahimAssad Ebrahim

            1,41111523




            1,41111523








            • 4





              what's the difference between -r and -framerate?

              – nuno_cruz
              Oct 24 '12 at 20:21






            • 1





              they're the same IIRC

              – rogerdpack
              Feb 18 '13 at 16:34






            • 21





              No need for numbering nonsense, as long as you're happy to accept the order they appear in (say) 'ls'... just use: ffmpeg -pattern_type glob -i '*.jpg' movie.mp4

              – Orwellophile
              Nov 3 '13 at 5:32








            • 2





              Is there any switch to control the time gap between images,say, I'd like to show the first image 13s,the second 15s,24s for the third,time gap is user defined,is that possible?

              – zionpi
              Feb 26 '16 at 8:00








            • 2





              see also trac.ffmpeg.org/wiki/…

              – d3vid
              Apr 20 '16 at 8:43














            • 4





              what's the difference between -r and -framerate?

              – nuno_cruz
              Oct 24 '12 at 20:21






            • 1





              they're the same IIRC

              – rogerdpack
              Feb 18 '13 at 16:34






            • 21





              No need for numbering nonsense, as long as you're happy to accept the order they appear in (say) 'ls'... just use: ffmpeg -pattern_type glob -i '*.jpg' movie.mp4

              – Orwellophile
              Nov 3 '13 at 5:32








            • 2





              Is there any switch to control the time gap between images,say, I'd like to show the first image 13s,the second 15s,24s for the third,time gap is user defined,is that possible?

              – zionpi
              Feb 26 '16 at 8:00








            • 2





              see also trac.ffmpeg.org/wiki/…

              – d3vid
              Apr 20 '16 at 8:43








            4




            4





            what's the difference between -r and -framerate?

            – nuno_cruz
            Oct 24 '12 at 20:21





            what's the difference between -r and -framerate?

            – nuno_cruz
            Oct 24 '12 at 20:21




            1




            1





            they're the same IIRC

            – rogerdpack
            Feb 18 '13 at 16:34





            they're the same IIRC

            – rogerdpack
            Feb 18 '13 at 16:34




            21




            21





            No need for numbering nonsense, as long as you're happy to accept the order they appear in (say) 'ls'... just use: ffmpeg -pattern_type glob -i '*.jpg' movie.mp4

            – Orwellophile
            Nov 3 '13 at 5:32







            No need for numbering nonsense, as long as you're happy to accept the order they appear in (say) 'ls'... just use: ffmpeg -pattern_type glob -i '*.jpg' movie.mp4

            – Orwellophile
            Nov 3 '13 at 5:32






            2




            2





            Is there any switch to control the time gap between images,say, I'd like to show the first image 13s,the second 15s,24s for the third,time gap is user defined,is that possible?

            – zionpi
            Feb 26 '16 at 8:00







            Is there any switch to control the time gap between images,say, I'd like to show the first image 13s,the second 15s,24s for the third,time gap is user defined,is that possible?

            – zionpi
            Feb 26 '16 at 8:00






            2




            2





            see also trac.ffmpeg.org/wiki/…

            – d3vid
            Apr 20 '16 at 8:43





            see also trac.ffmpeg.org/wiki/…

            – d3vid
            Apr 20 '16 at 8:43













            35














            you can use this below code snippet:



             cat *.jpg | ffmpeg -f image2pipe -r 1 -vcodec mjpeg -i - -vcodec libx264 out.mp4





            share|improve this answer
























            • This does not rotate JPGs to the rotation stated in metadata.

              – Erik Johansson
              Oct 13 '15 at 8:16
















            35














            you can use this below code snippet:



             cat *.jpg | ffmpeg -f image2pipe -r 1 -vcodec mjpeg -i - -vcodec libx264 out.mp4





            share|improve this answer
























            • This does not rotate JPGs to the rotation stated in metadata.

              – Erik Johansson
              Oct 13 '15 at 8:16














            35












            35








            35







            you can use this below code snippet:



             cat *.jpg | ffmpeg -f image2pipe -r 1 -vcodec mjpeg -i - -vcodec libx264 out.mp4





            share|improve this answer













            you can use this below code snippet:



             cat *.jpg | ffmpeg -f image2pipe -r 1 -vcodec mjpeg -i - -vcodec libx264 out.mp4






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 8 '12 at 14:33







            kuanghaibin




















            • This does not rotate JPGs to the rotation stated in metadata.

              – Erik Johansson
              Oct 13 '15 at 8:16



















            • This does not rotate JPGs to the rotation stated in metadata.

              – Erik Johansson
              Oct 13 '15 at 8:16

















            This does not rotate JPGs to the rotation stated in metadata.

            – Erik Johansson
            Oct 13 '15 at 8:16





            This does not rotate JPGs to the rotation stated in metadata.

            – Erik Johansson
            Oct 13 '15 at 8:16











            17














            You can find an example script in the ffmpeg documentation:




            3.2 How do I encode single pictures into movies?



            If you have large number of pictures to rename, you can use the following command to ease the burden. The command, using the bourne shell syntax, symbolically links all files in the current directory that match *jpg to the /tmp' directory in the sequence ofimg001.jpg', `img002.jpg' and so on.




            x=1; for i in *jpg; do counter=$(printf %03d $x); ln "$i" /tmp/img"$counter".jpg; x=$(($x+1)); done



            Then run:




            ffmpeg -f image2 -i /tmp/img%03d.jpg /tmp/a.mpg





            share|improve this answer



















            • 2





              You'd be better making x=0 to start so the image name's start img000.jpg as this is what ffmpeg expects. Also symlinking didn't work for me as ffmpeg couldn't find the files so I had to use cp instead (obvious speed and space draw backs but I rm them after anyway). mv would also work if you don't mind losing the originals.

              – RyanfaeScotland
              Mar 28 '13 at 14:21











            • Note that in this answer, the command provided creates hardlinks, not symlinks. Regarding the use of cp if linking doesn't work, if your filesystem supports it cp --reflink=auto will achieve much better speed/space usage.

              – Félix Saparelli
              Jun 5 '15 at 1:00
















            17














            You can find an example script in the ffmpeg documentation:




            3.2 How do I encode single pictures into movies?



            If you have large number of pictures to rename, you can use the following command to ease the burden. The command, using the bourne shell syntax, symbolically links all files in the current directory that match *jpg to the /tmp' directory in the sequence ofimg001.jpg', `img002.jpg' and so on.




            x=1; for i in *jpg; do counter=$(printf %03d $x); ln "$i" /tmp/img"$counter".jpg; x=$(($x+1)); done



            Then run:




            ffmpeg -f image2 -i /tmp/img%03d.jpg /tmp/a.mpg





            share|improve this answer



















            • 2





              You'd be better making x=0 to start so the image name's start img000.jpg as this is what ffmpeg expects. Also symlinking didn't work for me as ffmpeg couldn't find the files so I had to use cp instead (obvious speed and space draw backs but I rm them after anyway). mv would also work if you don't mind losing the originals.

              – RyanfaeScotland
              Mar 28 '13 at 14:21











            • Note that in this answer, the command provided creates hardlinks, not symlinks. Regarding the use of cp if linking doesn't work, if your filesystem supports it cp --reflink=auto will achieve much better speed/space usage.

              – Félix Saparelli
              Jun 5 '15 at 1:00














            17












            17








            17







            You can find an example script in the ffmpeg documentation:




            3.2 How do I encode single pictures into movies?



            If you have large number of pictures to rename, you can use the following command to ease the burden. The command, using the bourne shell syntax, symbolically links all files in the current directory that match *jpg to the /tmp' directory in the sequence ofimg001.jpg', `img002.jpg' and so on.




            x=1; for i in *jpg; do counter=$(printf %03d $x); ln "$i" /tmp/img"$counter".jpg; x=$(($x+1)); done



            Then run:




            ffmpeg -f image2 -i /tmp/img%03d.jpg /tmp/a.mpg





            share|improve this answer













            You can find an example script in the ffmpeg documentation:




            3.2 How do I encode single pictures into movies?



            If you have large number of pictures to rename, you can use the following command to ease the burden. The command, using the bourne shell syntax, symbolically links all files in the current directory that match *jpg to the /tmp' directory in the sequence ofimg001.jpg', `img002.jpg' and so on.




            x=1; for i in *jpg; do counter=$(printf %03d $x); ln "$i" /tmp/img"$counter".jpg; x=$(($x+1)); done



            Then run:




            ffmpeg -f image2 -i /tmp/img%03d.jpg /tmp/a.mpg






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jul 18 '10 at 17:02









            gaizkagaizka

            27122




            27122








            • 2





              You'd be better making x=0 to start so the image name's start img000.jpg as this is what ffmpeg expects. Also symlinking didn't work for me as ffmpeg couldn't find the files so I had to use cp instead (obvious speed and space draw backs but I rm them after anyway). mv would also work if you don't mind losing the originals.

              – RyanfaeScotland
              Mar 28 '13 at 14:21











            • Note that in this answer, the command provided creates hardlinks, not symlinks. Regarding the use of cp if linking doesn't work, if your filesystem supports it cp --reflink=auto will achieve much better speed/space usage.

              – Félix Saparelli
              Jun 5 '15 at 1:00














            • 2





              You'd be better making x=0 to start so the image name's start img000.jpg as this is what ffmpeg expects. Also symlinking didn't work for me as ffmpeg couldn't find the files so I had to use cp instead (obvious speed and space draw backs but I rm them after anyway). mv would also work if you don't mind losing the originals.

              – RyanfaeScotland
              Mar 28 '13 at 14:21











            • Note that in this answer, the command provided creates hardlinks, not symlinks. Regarding the use of cp if linking doesn't work, if your filesystem supports it cp --reflink=auto will achieve much better speed/space usage.

              – Félix Saparelli
              Jun 5 '15 at 1:00








            2




            2





            You'd be better making x=0 to start so the image name's start img000.jpg as this is what ffmpeg expects. Also symlinking didn't work for me as ffmpeg couldn't find the files so I had to use cp instead (obvious speed and space draw backs but I rm them after anyway). mv would also work if you don't mind losing the originals.

            – RyanfaeScotland
            Mar 28 '13 at 14:21





            You'd be better making x=0 to start so the image name's start img000.jpg as this is what ffmpeg expects. Also symlinking didn't work for me as ffmpeg couldn't find the files so I had to use cp instead (obvious speed and space draw backs but I rm them after anyway). mv would also work if you don't mind losing the originals.

            – RyanfaeScotland
            Mar 28 '13 at 14:21













            Note that in this answer, the command provided creates hardlinks, not symlinks. Regarding the use of cp if linking doesn't work, if your filesystem supports it cp --reflink=auto will achieve much better speed/space usage.

            – Félix Saparelli
            Jun 5 '15 at 1:00





            Note that in this answer, the command provided creates hardlinks, not symlinks. Regarding the use of cp if linking doesn't work, if your filesystem supports it cp --reflink=auto will achieve much better speed/space usage.

            – Félix Saparelli
            Jun 5 '15 at 1:00











            12














            From ffmpeg's docs:



            Using a glob pattern



            ffmpeg also supports bash-style globbing (* represents any number of any characters).



            This is useful if your images are sequential but not necessarily in a numerically sequential order as in the previous examples.



            ffmpeg -r 1 -pattern_type glob -i 'test_*.jpg' -c:v libx264 out.mp4


            So, as long as your files are sorted, using the -pattern_type glob switch should work for you.






            share|improve this answer
























            • Note that this glob is more limited than regular shell globs: trac.ffmpeg.org/ticket/3620 apparently because image type is deduced from the extension.

              – Ciro Santilli 新疆改造中心 六四事件 法轮功
              Dec 17 '16 at 17:02
















            12














            From ffmpeg's docs:



            Using a glob pattern



            ffmpeg also supports bash-style globbing (* represents any number of any characters).



            This is useful if your images are sequential but not necessarily in a numerically sequential order as in the previous examples.



            ffmpeg -r 1 -pattern_type glob -i 'test_*.jpg' -c:v libx264 out.mp4


            So, as long as your files are sorted, using the -pattern_type glob switch should work for you.






            share|improve this answer
























            • Note that this glob is more limited than regular shell globs: trac.ffmpeg.org/ticket/3620 apparently because image type is deduced from the extension.

              – Ciro Santilli 新疆改造中心 六四事件 法轮功
              Dec 17 '16 at 17:02














            12












            12








            12







            From ffmpeg's docs:



            Using a glob pattern



            ffmpeg also supports bash-style globbing (* represents any number of any characters).



            This is useful if your images are sequential but not necessarily in a numerically sequential order as in the previous examples.



            ffmpeg -r 1 -pattern_type glob -i 'test_*.jpg' -c:v libx264 out.mp4


            So, as long as your files are sorted, using the -pattern_type glob switch should work for you.






            share|improve this answer













            From ffmpeg's docs:



            Using a glob pattern



            ffmpeg also supports bash-style globbing (* represents any number of any characters).



            This is useful if your images are sequential but not necessarily in a numerically sequential order as in the previous examples.



            ffmpeg -r 1 -pattern_type glob -i 'test_*.jpg' -c:v libx264 out.mp4


            So, as long as your files are sorted, using the -pattern_type glob switch should work for you.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jul 13 '14 at 7:11









            Nevin WilliamsNevin Williams

            3,3751129




            3,3751129













            • Note that this glob is more limited than regular shell globs: trac.ffmpeg.org/ticket/3620 apparently because image type is deduced from the extension.

              – Ciro Santilli 新疆改造中心 六四事件 法轮功
              Dec 17 '16 at 17:02



















            • Note that this glob is more limited than regular shell globs: trac.ffmpeg.org/ticket/3620 apparently because image type is deduced from the extension.

              – Ciro Santilli 新疆改造中心 六四事件 法轮功
              Dec 17 '16 at 17:02

















            Note that this glob is more limited than regular shell globs: trac.ffmpeg.org/ticket/3620 apparently because image type is deduced from the extension.

            – Ciro Santilli 新疆改造中心 六四事件 法轮功
            Dec 17 '16 at 17:02





            Note that this glob is more limited than regular shell globs: trac.ffmpeg.org/ticket/3620 apparently because image type is deduced from the extension.

            – Ciro Santilli 新疆改造中心 六四事件 法轮功
            Dec 17 '16 at 17:02











            11














            As far as I know, you cannot start the sequence in random numbers (I don't remember if you should start it at 0 or 1), plus, it cannot have gaps, if it does, ffmpeg will assume the sequence is over and stop adding more images.



            Also, as stated in the comments to my answer, remember you need to specify the width of your index. Like:



            image%03d.jpg



            And if you use a %03d index type, you need to pad your filenames with 0, like :



            image001.jpg
            image002.jpg
            image003.jpg



            etc.






            share|improve this answer



















            • 1





              If the image file names have leading zeros then the format string must also specify the width like "%03d".

              – Hudson
              May 13 '10 at 18:17






            • 1





              If that's the only obstacle, you could just write a script to either rename or symlink your images to a properly reindexed set.

              – Cascabel
              May 13 '10 at 18:18






            • 1





              Yes, I've worked with this before, I wrote a wrapper in Ruby a while ago where you called instance.addImage(), then instance.processVideo() and it would create a temporal directory, copy/rename the images with proper indices and create the video. It is quite easy.

              – Francisco Soto
              May 13 '10 at 18:25











            • @Jefromi I have created a symlink but how do I give the path of the symlink file to ffmpeg? It just assumes the symlink file is the image I am trying to convert? I'm on win7 btw

              – Jared Glass
              Apr 12 '12 at 16:13











            • The sequence can start anywhere from 0 to 4 inclusive.

              – Assad Ebrahim
              Aug 28 '12 at 12:11
















            11














            As far as I know, you cannot start the sequence in random numbers (I don't remember if you should start it at 0 or 1), plus, it cannot have gaps, if it does, ffmpeg will assume the sequence is over and stop adding more images.



            Also, as stated in the comments to my answer, remember you need to specify the width of your index. Like:



            image%03d.jpg



            And if you use a %03d index type, you need to pad your filenames with 0, like :



            image001.jpg
            image002.jpg
            image003.jpg



            etc.






            share|improve this answer



















            • 1





              If the image file names have leading zeros then the format string must also specify the width like "%03d".

              – Hudson
              May 13 '10 at 18:17






            • 1





              If that's the only obstacle, you could just write a script to either rename or symlink your images to a properly reindexed set.

              – Cascabel
              May 13 '10 at 18:18






            • 1





              Yes, I've worked with this before, I wrote a wrapper in Ruby a while ago where you called instance.addImage(), then instance.processVideo() and it would create a temporal directory, copy/rename the images with proper indices and create the video. It is quite easy.

              – Francisco Soto
              May 13 '10 at 18:25











            • @Jefromi I have created a symlink but how do I give the path of the symlink file to ffmpeg? It just assumes the symlink file is the image I am trying to convert? I'm on win7 btw

              – Jared Glass
              Apr 12 '12 at 16:13











            • The sequence can start anywhere from 0 to 4 inclusive.

              – Assad Ebrahim
              Aug 28 '12 at 12:11














            11












            11








            11







            As far as I know, you cannot start the sequence in random numbers (I don't remember if you should start it at 0 or 1), plus, it cannot have gaps, if it does, ffmpeg will assume the sequence is over and stop adding more images.



            Also, as stated in the comments to my answer, remember you need to specify the width of your index. Like:



            image%03d.jpg



            And if you use a %03d index type, you need to pad your filenames with 0, like :



            image001.jpg
            image002.jpg
            image003.jpg



            etc.






            share|improve this answer













            As far as I know, you cannot start the sequence in random numbers (I don't remember if you should start it at 0 or 1), plus, it cannot have gaps, if it does, ffmpeg will assume the sequence is over and stop adding more images.



            Also, as stated in the comments to my answer, remember you need to specify the width of your index. Like:



            image%03d.jpg



            And if you use a %03d index type, you need to pad your filenames with 0, like :



            image001.jpg
            image002.jpg
            image003.jpg



            etc.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered May 13 '10 at 18:15









            Francisco SotoFrancisco Soto

            22713




            22713








            • 1





              If the image file names have leading zeros then the format string must also specify the width like "%03d".

              – Hudson
              May 13 '10 at 18:17






            • 1





              If that's the only obstacle, you could just write a script to either rename or symlink your images to a properly reindexed set.

              – Cascabel
              May 13 '10 at 18:18






            • 1





              Yes, I've worked with this before, I wrote a wrapper in Ruby a while ago where you called instance.addImage(), then instance.processVideo() and it would create a temporal directory, copy/rename the images with proper indices and create the video. It is quite easy.

              – Francisco Soto
              May 13 '10 at 18:25











            • @Jefromi I have created a symlink but how do I give the path of the symlink file to ffmpeg? It just assumes the symlink file is the image I am trying to convert? I'm on win7 btw

              – Jared Glass
              Apr 12 '12 at 16:13











            • The sequence can start anywhere from 0 to 4 inclusive.

              – Assad Ebrahim
              Aug 28 '12 at 12:11














            • 1





              If the image file names have leading zeros then the format string must also specify the width like "%03d".

              – Hudson
              May 13 '10 at 18:17






            • 1





              If that's the only obstacle, you could just write a script to either rename or symlink your images to a properly reindexed set.

              – Cascabel
              May 13 '10 at 18:18






            • 1





              Yes, I've worked with this before, I wrote a wrapper in Ruby a while ago where you called instance.addImage(), then instance.processVideo() and it would create a temporal directory, copy/rename the images with proper indices and create the video. It is quite easy.

              – Francisco Soto
              May 13 '10 at 18:25











            • @Jefromi I have created a symlink but how do I give the path of the symlink file to ffmpeg? It just assumes the symlink file is the image I am trying to convert? I'm on win7 btw

              – Jared Glass
              Apr 12 '12 at 16:13











            • The sequence can start anywhere from 0 to 4 inclusive.

              – Assad Ebrahim
              Aug 28 '12 at 12:11








            1




            1





            If the image file names have leading zeros then the format string must also specify the width like "%03d".

            – Hudson
            May 13 '10 at 18:17





            If the image file names have leading zeros then the format string must also specify the width like "%03d".

            – Hudson
            May 13 '10 at 18:17




            1




            1





            If that's the only obstacle, you could just write a script to either rename or symlink your images to a properly reindexed set.

            – Cascabel
            May 13 '10 at 18:18





            If that's the only obstacle, you could just write a script to either rename or symlink your images to a properly reindexed set.

            – Cascabel
            May 13 '10 at 18:18




            1




            1





            Yes, I've worked with this before, I wrote a wrapper in Ruby a while ago where you called instance.addImage(), then instance.processVideo() and it would create a temporal directory, copy/rename the images with proper indices and create the video. It is quite easy.

            – Francisco Soto
            May 13 '10 at 18:25





            Yes, I've worked with this before, I wrote a wrapper in Ruby a while ago where you called instance.addImage(), then instance.processVideo() and it would create a temporal directory, copy/rename the images with proper indices and create the video. It is quite easy.

            – Francisco Soto
            May 13 '10 at 18:25













            @Jefromi I have created a symlink but how do I give the path of the symlink file to ffmpeg? It just assumes the symlink file is the image I am trying to convert? I'm on win7 btw

            – Jared Glass
            Apr 12 '12 at 16:13





            @Jefromi I have created a symlink but how do I give the path of the symlink file to ffmpeg? It just assumes the symlink file is the image I am trying to convert? I'm on win7 btw

            – Jared Glass
            Apr 12 '12 at 16:13













            The sequence can start anywhere from 0 to 4 inclusive.

            – Assad Ebrahim
            Aug 28 '12 at 12:11





            The sequence can start anywhere from 0 to 4 inclusive.

            – Assad Ebrahim
            Aug 28 '12 at 12:11











            5














            I agree with Francisco, but as a workaround you could just write a quick script to move or create symbolic links to the files with the sequence numbers that ffmpeg needs. The script could then call ffmpeg and then remove the links or move the files back to their original locations.






            share|improve this answer




























              5














              I agree with Francisco, but as a workaround you could just write a quick script to move or create symbolic links to the files with the sequence numbers that ffmpeg needs. The script could then call ffmpeg and then remove the links or move the files back to their original locations.






              share|improve this answer


























                5












                5








                5







                I agree with Francisco, but as a workaround you could just write a quick script to move or create symbolic links to the files with the sequence numbers that ffmpeg needs. The script could then call ffmpeg and then remove the links or move the files back to their original locations.






                share|improve this answer













                I agree with Francisco, but as a workaround you could just write a quick script to move or create symbolic links to the files with the sequence numbers that ffmpeg needs. The script could then call ffmpeg and then remove the links or move the files back to their original locations.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 13 '10 at 18:23









                Jason BJason B

                1513




                1513























                    1














                    look up



                    x=1; for i in *jpg; do counter=$(printf %03d $x); ln "$i"
                    /tmp/img"$counter".jpg; x=$(($x+1)); done





                    share|improve this answer




























                      1














                      look up



                      x=1; for i in *jpg; do counter=$(printf %03d $x); ln "$i"
                      /tmp/img"$counter".jpg; x=$(($x+1)); done





                      share|improve this answer


























                        1












                        1








                        1







                        look up



                        x=1; for i in *jpg; do counter=$(printf %03d $x); ln "$i"
                        /tmp/img"$counter".jpg; x=$(($x+1)); done





                        share|improve this answer













                        look up



                        x=1; for i in *jpg; do counter=$(printf %03d $x); ln "$i"
                        /tmp/img"$counter".jpg; x=$(($x+1)); done






                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Aug 14 '11 at 21:09







                        owcc






























                            0














                            I used the flv encoder since my video was going in a flash player (Jwplayer)



                            ffmpeg -i %d.jpg -vcodec flv test.flv






                            share|improve this answer




























                              0














                              I used the flv encoder since my video was going in a flash player (Jwplayer)



                              ffmpeg -i %d.jpg -vcodec flv test.flv






                              share|improve this answer


























                                0












                                0








                                0







                                I used the flv encoder since my video was going in a flash player (Jwplayer)



                                ffmpeg -i %d.jpg -vcodec flv test.flv






                                share|improve this answer













                                I used the flv encoder since my video was going in a flash player (Jwplayer)



                                ffmpeg -i %d.jpg -vcodec flv test.flv







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered Nov 11 '11 at 18:04







                                nick phillips






























                                    0














                                    From the documentation, it seems you can simply use *



                                    For example, for creating a video from filenames matching the glob pattern foo-*.jpeg:

                                    ffmpeg -f image2 -pattern_type glob -framerate 12 -i 'foo-*.jpeg' -s WxH foo.avi


                                    As a note, to improve affect the quality, the rate/fps might be important (eg, first specifying very low/high frame rate and then pass from a second filter that will make the slow motion video to normal?)






                                    share|improve this answer




























                                      0














                                      From the documentation, it seems you can simply use *



                                      For example, for creating a video from filenames matching the glob pattern foo-*.jpeg:

                                      ffmpeg -f image2 -pattern_type glob -framerate 12 -i 'foo-*.jpeg' -s WxH foo.avi


                                      As a note, to improve affect the quality, the rate/fps might be important (eg, first specifying very low/high frame rate and then pass from a second filter that will make the slow motion video to normal?)






                                      share|improve this answer


























                                        0












                                        0








                                        0







                                        From the documentation, it seems you can simply use *



                                        For example, for creating a video from filenames matching the glob pattern foo-*.jpeg:

                                        ffmpeg -f image2 -pattern_type glob -framerate 12 -i 'foo-*.jpeg' -s WxH foo.avi


                                        As a note, to improve affect the quality, the rate/fps might be important (eg, first specifying very low/high frame rate and then pass from a second filter that will make the slow motion video to normal?)






                                        share|improve this answer













                                        From the documentation, it seems you can simply use *



                                        For example, for creating a video from filenames matching the glob pattern foo-*.jpeg:

                                        ffmpeg -f image2 -pattern_type glob -framerate 12 -i 'foo-*.jpeg' -s WxH foo.avi


                                        As a note, to improve affect the quality, the rate/fps might be important (eg, first specifying very low/high frame rate and then pass from a second filter that will make the slow motion video to normal?)







                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered Jan 29 '16 at 12:05









                                        ntgntg

                                        1928




                                        1928























                                            0














                                            I know this is an old question but I came across it in Google while looking for the same answer. None of the answers here satisfied me completely so I did more searching and reading and this is a command that I came up with for my own problem.



                                            cat {0032..1501}*.png | ffmpeg -f image2pipe -framerate 5 -i - -s 720x480 test2.avi


                                            The reason why i'd use a command like this is...




                                            1. Cat and -f image2pipe give you finer control over what images you
                                              use. For example it allows you to use bash features like bracket
                                              expansion and other commands like grep to fine-tune your results
                                              should you choose.

                                            2. Fewer switches to remember.

                                            3. I recommend NOT using -r, and just use -framerate instead. In my
                                              experience -r tends to drop frames more often.

                                            4. Less complex, no unnecessary switches in use and it will work as-is.
                                              You may add more complexity (for example, specifying encoder) and
                                              fine tune to suit your needs.






                                            share|improve this answer
























                                            • For the OP's question, -start_number is all that's needed.

                                              – Gyan
                                              Aug 4 '16 at 5:29
















                                            0














                                            I know this is an old question but I came across it in Google while looking for the same answer. None of the answers here satisfied me completely so I did more searching and reading and this is a command that I came up with for my own problem.



                                            cat {0032..1501}*.png | ffmpeg -f image2pipe -framerate 5 -i - -s 720x480 test2.avi


                                            The reason why i'd use a command like this is...




                                            1. Cat and -f image2pipe give you finer control over what images you
                                              use. For example it allows you to use bash features like bracket
                                              expansion and other commands like grep to fine-tune your results
                                              should you choose.

                                            2. Fewer switches to remember.

                                            3. I recommend NOT using -r, and just use -framerate instead. In my
                                              experience -r tends to drop frames more often.

                                            4. Less complex, no unnecessary switches in use and it will work as-is.
                                              You may add more complexity (for example, specifying encoder) and
                                              fine tune to suit your needs.






                                            share|improve this answer
























                                            • For the OP's question, -start_number is all that's needed.

                                              – Gyan
                                              Aug 4 '16 at 5:29














                                            0












                                            0








                                            0







                                            I know this is an old question but I came across it in Google while looking for the same answer. None of the answers here satisfied me completely so I did more searching and reading and this is a command that I came up with for my own problem.



                                            cat {0032..1501}*.png | ffmpeg -f image2pipe -framerate 5 -i - -s 720x480 test2.avi


                                            The reason why i'd use a command like this is...




                                            1. Cat and -f image2pipe give you finer control over what images you
                                              use. For example it allows you to use bash features like bracket
                                              expansion and other commands like grep to fine-tune your results
                                              should you choose.

                                            2. Fewer switches to remember.

                                            3. I recommend NOT using -r, and just use -framerate instead. In my
                                              experience -r tends to drop frames more often.

                                            4. Less complex, no unnecessary switches in use and it will work as-is.
                                              You may add more complexity (for example, specifying encoder) and
                                              fine tune to suit your needs.






                                            share|improve this answer













                                            I know this is an old question but I came across it in Google while looking for the same answer. None of the answers here satisfied me completely so I did more searching and reading and this is a command that I came up with for my own problem.



                                            cat {0032..1501}*.png | ffmpeg -f image2pipe -framerate 5 -i - -s 720x480 test2.avi


                                            The reason why i'd use a command like this is...




                                            1. Cat and -f image2pipe give you finer control over what images you
                                              use. For example it allows you to use bash features like bracket
                                              expansion and other commands like grep to fine-tune your results
                                              should you choose.

                                            2. Fewer switches to remember.

                                            3. I recommend NOT using -r, and just use -framerate instead. In my
                                              experience -r tends to drop frames more often.

                                            4. Less complex, no unnecessary switches in use and it will work as-is.
                                              You may add more complexity (for example, specifying encoder) and
                                              fine tune to suit your needs.







                                            share|improve this answer












                                            share|improve this answer



                                            share|improve this answer










                                            answered Aug 3 '16 at 23:44









                                            David BobbDavid Bobb

                                            11




                                            11













                                            • For the OP's question, -start_number is all that's needed.

                                              – Gyan
                                              Aug 4 '16 at 5:29



















                                            • For the OP's question, -start_number is all that's needed.

                                              – Gyan
                                              Aug 4 '16 at 5:29

















                                            For the OP's question, -start_number is all that's needed.

                                            – Gyan
                                            Aug 4 '16 at 5:29





                                            For the OP's question, -start_number is all that's needed.

                                            – Gyan
                                            Aug 4 '16 at 5:29











                                            0














                                            In my case, it was a little trickier because of the numbers in the files. Here's how my images look like:



                                            $ ls | head -5
                                            2014_aq_unprocessed 001.jpg
                                            2014_aq_unprocessed 002.jpg
                                            2014_aq_unprocessed 003.jpg
                                            2014_aq_unprocessed 004.jpg
                                            2014_aq_unprocessed 005.jpg


                                            and here's the command I used:



                                            ffmpeg -i 2014_aq_unprocessed %3d.jpg  -vcodec mpeg4 test.avi





                                            share|improve this answer




























                                              0














                                              In my case, it was a little trickier because of the numbers in the files. Here's how my images look like:



                                              $ ls | head -5
                                              2014_aq_unprocessed 001.jpg
                                              2014_aq_unprocessed 002.jpg
                                              2014_aq_unprocessed 003.jpg
                                              2014_aq_unprocessed 004.jpg
                                              2014_aq_unprocessed 005.jpg


                                              and here's the command I used:



                                              ffmpeg -i 2014_aq_unprocessed %3d.jpg  -vcodec mpeg4 test.avi





                                              share|improve this answer


























                                                0












                                                0








                                                0







                                                In my case, it was a little trickier because of the numbers in the files. Here's how my images look like:



                                                $ ls | head -5
                                                2014_aq_unprocessed 001.jpg
                                                2014_aq_unprocessed 002.jpg
                                                2014_aq_unprocessed 003.jpg
                                                2014_aq_unprocessed 004.jpg
                                                2014_aq_unprocessed 005.jpg


                                                and here's the command I used:



                                                ffmpeg -i 2014_aq_unprocessed %3d.jpg  -vcodec mpeg4 test.avi





                                                share|improve this answer













                                                In my case, it was a little trickier because of the numbers in the files. Here's how my images look like:



                                                $ ls | head -5
                                                2014_aq_unprocessed 001.jpg
                                                2014_aq_unprocessed 002.jpg
                                                2014_aq_unprocessed 003.jpg
                                                2014_aq_unprocessed 004.jpg
                                                2014_aq_unprocessed 005.jpg


                                                and here's the command I used:



                                                ffmpeg -i 2014_aq_unprocessed %3d.jpg  -vcodec mpeg4 test.avi






                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered Oct 30 '17 at 18:28









                                                Mona JalalMona Jalal

                                                169514




                                                169514























                                                    0














                                                    You can do this with convert -morph:



                                                    convert *.jpg -delay 10 -morph 10 %05d.jpg


                                                    If you want to use ffmpeg, I used



                                                    ffmpeg -pattern_type glob -i '*.jpg' -vf "setpts=10*PTS" movie.mp4


                                                    where the 10*PTS tells ffmpeg to slow it down 10 times. You can also have fractions there to speed it up.






                                                    share|improve this answer


























                                                    • This is just interpolating your original image sequence to a new space, it doesn't create a video file like the OP asked.

                                                      – f0ster
                                                      Mar 18 '16 at 17:13
















                                                    0














                                                    You can do this with convert -morph:



                                                    convert *.jpg -delay 10 -morph 10 %05d.jpg


                                                    If you want to use ffmpeg, I used



                                                    ffmpeg -pattern_type glob -i '*.jpg' -vf "setpts=10*PTS" movie.mp4


                                                    where the 10*PTS tells ffmpeg to slow it down 10 times. You can also have fractions there to speed it up.






                                                    share|improve this answer


























                                                    • This is just interpolating your original image sequence to a new space, it doesn't create a video file like the OP asked.

                                                      – f0ster
                                                      Mar 18 '16 at 17:13














                                                    0












                                                    0








                                                    0







                                                    You can do this with convert -morph:



                                                    convert *.jpg -delay 10 -morph 10 %05d.jpg


                                                    If you want to use ffmpeg, I used



                                                    ffmpeg -pattern_type glob -i '*.jpg' -vf "setpts=10*PTS" movie.mp4


                                                    where the 10*PTS tells ffmpeg to slow it down 10 times. You can also have fractions there to speed it up.






                                                    share|improve this answer















                                                    You can do this with convert -morph:



                                                    convert *.jpg -delay 10 -morph 10 %05d.jpg


                                                    If you want to use ffmpeg, I used



                                                    ffmpeg -pattern_type glob -i '*.jpg' -vf "setpts=10*PTS" movie.mp4


                                                    where the 10*PTS tells ffmpeg to slow it down 10 times. You can also have fractions there to speed it up.







                                                    share|improve this answer














                                                    share|improve this answer



                                                    share|improve this answer








                                                    edited Jan 22 at 15:27

























                                                    answered Jan 14 '16 at 23:22









                                                    Martin ThomaMartin Thoma

                                                    1,49782348




                                                    1,49782348













                                                    • This is just interpolating your original image sequence to a new space, it doesn't create a video file like the OP asked.

                                                      – f0ster
                                                      Mar 18 '16 at 17:13



















                                                    • This is just interpolating your original image sequence to a new space, it doesn't create a video file like the OP asked.

                                                      – f0ster
                                                      Mar 18 '16 at 17:13

















                                                    This is just interpolating your original image sequence to a new space, it doesn't create a video file like the OP asked.

                                                    – f0ster
                                                    Mar 18 '16 at 17:13





                                                    This is just interpolating your original image sequence to a new space, it doesn't create a video file like the OP asked.

                                                    – f0ster
                                                    Mar 18 '16 at 17:13


















                                                    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.




                                                    draft saved


                                                    draft discarded














                                                    StackExchange.ready(
                                                    function () {
                                                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f624567%2fhow-to-create-a-video-from-images-using-ffmpeg%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

                                                    Probability when a professor distributes a quiz and homework assignment to a class of n students.

                                                    Aardman Animations

                                                    Are they similar matrix