Why does ffmpeg extracts a lot more frames than the actual?











up vote
0
down vote

favorite












I'm using ffmpeg to extract frames from a gif file. When I use python PIL it shows that the file has 135 frames. Even the properties window in the mac shoes the same number of frames. However, ffmpeg, for some reason extracts >50000 frames. A lot of them are duplicates.



Gif file - https://78.media.tumblr.com/dd7f01acad444ca85bea050afd15afaf/tumblr_nof6lmxQLC1utshuoo1_250.gif



I'm using the following command ffmpeg -i input_gif.gif output/%d.jpg Log - https://pastebin.com/HBt58yKq



However, I found that when I run the following command it works perfectly ffmpeg -i input_gif.gif -vsync 0 output/%d.jpg
Log - https://pastebin.com/Ykb7WkKA










share|improve this question


























    up vote
    0
    down vote

    favorite












    I'm using ffmpeg to extract frames from a gif file. When I use python PIL it shows that the file has 135 frames. Even the properties window in the mac shoes the same number of frames. However, ffmpeg, for some reason extracts >50000 frames. A lot of them are duplicates.



    Gif file - https://78.media.tumblr.com/dd7f01acad444ca85bea050afd15afaf/tumblr_nof6lmxQLC1utshuoo1_250.gif



    I'm using the following command ffmpeg -i input_gif.gif output/%d.jpg Log - https://pastebin.com/HBt58yKq



    However, I found that when I run the following command it works perfectly ffmpeg -i input_gif.gif -vsync 0 output/%d.jpg
    Log - https://pastebin.com/Ykb7WkKA










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm using ffmpeg to extract frames from a gif file. When I use python PIL it shows that the file has 135 frames. Even the properties window in the mac shoes the same number of frames. However, ffmpeg, for some reason extracts >50000 frames. A lot of them are duplicates.



      Gif file - https://78.media.tumblr.com/dd7f01acad444ca85bea050afd15afaf/tumblr_nof6lmxQLC1utshuoo1_250.gif



      I'm using the following command ffmpeg -i input_gif.gif output/%d.jpg Log - https://pastebin.com/HBt58yKq



      However, I found that when I run the following command it works perfectly ffmpeg -i input_gif.gif -vsync 0 output/%d.jpg
      Log - https://pastebin.com/Ykb7WkKA










      share|improve this question













      I'm using ffmpeg to extract frames from a gif file. When I use python PIL it shows that the file has 135 frames. Even the properties window in the mac shoes the same number of frames. However, ffmpeg, for some reason extracts >50000 frames. A lot of them are duplicates.



      Gif file - https://78.media.tumblr.com/dd7f01acad444ca85bea050afd15afaf/tumblr_nof6lmxQLC1utshuoo1_250.gif



      I'm using the following command ffmpeg -i input_gif.gif output/%d.jpg Log - https://pastebin.com/HBt58yKq



      However, I found that when I run the following command it works perfectly ffmpeg -i input_gif.gif -vsync 0 output/%d.jpg
      Log - https://pastebin.com/Ykb7WkKA







      ffmpeg video-conversion






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 11 at 23:59









      simar

      133




      133






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote













          The GIF is detected as having a frame rate of 6.67 but the individual frame delays are set as 65535 in 1/100th second units so 655.35 seconds per frame. That gives a total duration in excess of 24 hrs for 135 input frames.



          The image sequence muxer is set to constant frame rate mode. So ffmpeg will probe the input's frame rate (6.67 fps) and drop or duplicate frames to match that rate if the input supplies a different number of frames (per-second). So, in recreating a 24 hr output sequence at 6.67 fps, ffmpeg will seek to produce over 500K frames. Almost all of which will be duplicates.



          -vsync vfr or -vsync 0 disables the frame drop/dup behaviour.






          share|improve this answer























          • 1. Why are the individual frame delays invalid? 2. Why does ffmpeg set it to this strange value which produces lots of duplicate frames? Shouldn't it do something smarter? 3. Does it mean that the gif as a problem while creating it? So i can safely use -vsync 0 for all my files (both valid and invalid right)?
            – simar
            2 days ago










          • I amended my answer. 1&2. The delays are maxed out which indicates a broken GIF creation. 3. Yes, -vsync 0 is safe for extracting images.
            – Gyan
            2 days ago











          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%2f1374584%2fwhy-does-ffmpeg-extracts-a-lot-more-frames-than-the-actual%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













          The GIF is detected as having a frame rate of 6.67 but the individual frame delays are set as 65535 in 1/100th second units so 655.35 seconds per frame. That gives a total duration in excess of 24 hrs for 135 input frames.



          The image sequence muxer is set to constant frame rate mode. So ffmpeg will probe the input's frame rate (6.67 fps) and drop or duplicate frames to match that rate if the input supplies a different number of frames (per-second). So, in recreating a 24 hr output sequence at 6.67 fps, ffmpeg will seek to produce over 500K frames. Almost all of which will be duplicates.



          -vsync vfr or -vsync 0 disables the frame drop/dup behaviour.






          share|improve this answer























          • 1. Why are the individual frame delays invalid? 2. Why does ffmpeg set it to this strange value which produces lots of duplicate frames? Shouldn't it do something smarter? 3. Does it mean that the gif as a problem while creating it? So i can safely use -vsync 0 for all my files (both valid and invalid right)?
            – simar
            2 days ago










          • I amended my answer. 1&2. The delays are maxed out which indicates a broken GIF creation. 3. Yes, -vsync 0 is safe for extracting images.
            – Gyan
            2 days ago















          up vote
          2
          down vote













          The GIF is detected as having a frame rate of 6.67 but the individual frame delays are set as 65535 in 1/100th second units so 655.35 seconds per frame. That gives a total duration in excess of 24 hrs for 135 input frames.



          The image sequence muxer is set to constant frame rate mode. So ffmpeg will probe the input's frame rate (6.67 fps) and drop or duplicate frames to match that rate if the input supplies a different number of frames (per-second). So, in recreating a 24 hr output sequence at 6.67 fps, ffmpeg will seek to produce over 500K frames. Almost all of which will be duplicates.



          -vsync vfr or -vsync 0 disables the frame drop/dup behaviour.






          share|improve this answer























          • 1. Why are the individual frame delays invalid? 2. Why does ffmpeg set it to this strange value which produces lots of duplicate frames? Shouldn't it do something smarter? 3. Does it mean that the gif as a problem while creating it? So i can safely use -vsync 0 for all my files (both valid and invalid right)?
            – simar
            2 days ago










          • I amended my answer. 1&2. The delays are maxed out which indicates a broken GIF creation. 3. Yes, -vsync 0 is safe for extracting images.
            – Gyan
            2 days ago













          up vote
          2
          down vote










          up vote
          2
          down vote









          The GIF is detected as having a frame rate of 6.67 but the individual frame delays are set as 65535 in 1/100th second units so 655.35 seconds per frame. That gives a total duration in excess of 24 hrs for 135 input frames.



          The image sequence muxer is set to constant frame rate mode. So ffmpeg will probe the input's frame rate (6.67 fps) and drop or duplicate frames to match that rate if the input supplies a different number of frames (per-second). So, in recreating a 24 hr output sequence at 6.67 fps, ffmpeg will seek to produce over 500K frames. Almost all of which will be duplicates.



          -vsync vfr or -vsync 0 disables the frame drop/dup behaviour.






          share|improve this answer














          The GIF is detected as having a frame rate of 6.67 but the individual frame delays are set as 65535 in 1/100th second units so 655.35 seconds per frame. That gives a total duration in excess of 24 hrs for 135 input frames.



          The image sequence muxer is set to constant frame rate mode. So ffmpeg will probe the input's frame rate (6.67 fps) and drop or duplicate frames to match that rate if the input supplies a different number of frames (per-second). So, in recreating a 24 hr output sequence at 6.67 fps, ffmpeg will seek to produce over 500K frames. Almost all of which will be duplicates.



          -vsync vfr or -vsync 0 disables the frame drop/dup behaviour.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 2 days ago

























          answered Nov 12 at 8:56









          Gyan

          13.8k21641




          13.8k21641












          • 1. Why are the individual frame delays invalid? 2. Why does ffmpeg set it to this strange value which produces lots of duplicate frames? Shouldn't it do something smarter? 3. Does it mean that the gif as a problem while creating it? So i can safely use -vsync 0 for all my files (both valid and invalid right)?
            – simar
            2 days ago










          • I amended my answer. 1&2. The delays are maxed out which indicates a broken GIF creation. 3. Yes, -vsync 0 is safe for extracting images.
            – Gyan
            2 days ago


















          • 1. Why are the individual frame delays invalid? 2. Why does ffmpeg set it to this strange value which produces lots of duplicate frames? Shouldn't it do something smarter? 3. Does it mean that the gif as a problem while creating it? So i can safely use -vsync 0 for all my files (both valid and invalid right)?
            – simar
            2 days ago










          • I amended my answer. 1&2. The delays are maxed out which indicates a broken GIF creation. 3. Yes, -vsync 0 is safe for extracting images.
            – Gyan
            2 days ago
















          1. Why are the individual frame delays invalid? 2. Why does ffmpeg set it to this strange value which produces lots of duplicate frames? Shouldn't it do something smarter? 3. Does it mean that the gif as a problem while creating it? So i can safely use -vsync 0 for all my files (both valid and invalid right)?
          – simar
          2 days ago




          1. Why are the individual frame delays invalid? 2. Why does ffmpeg set it to this strange value which produces lots of duplicate frames? Shouldn't it do something smarter? 3. Does it mean that the gif as a problem while creating it? So i can safely use -vsync 0 for all my files (both valid and invalid right)?
          – simar
          2 days ago












          I amended my answer. 1&2. The delays are maxed out which indicates a broken GIF creation. 3. Yes, -vsync 0 is safe for extracting images.
          – Gyan
          2 days ago




          I amended my answer. 1&2. The delays are maxed out which indicates a broken GIF creation. 3. Yes, -vsync 0 is safe for extracting images.
          – Gyan
          2 days ago


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1374584%2fwhy-does-ffmpeg-extracts-a-lot-more-frames-than-the-actual%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

          flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

          Mangá

           ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕