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
ffmpeg video-conversion
add a comment |
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
ffmpeg video-conversion
add a comment |
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
ffmpeg video-conversion
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
ffmpeg video-conversion
asked Nov 11 at 23:59
simar
133
133
add a comment |
add a comment |
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.
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
add a comment |
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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