ffmpeg: gif to video conversion does not keep gif time delay between frames.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ffmpeg: gif to video conversion does not keep gif time delay between frames.

Email Me
Hi,


I am using ffmpeg to convert the attached gif to a video file.


My command is:

ffmpeg -f gif -i test.gif -pix_fmt yuv420p -c:v libx264 -f mp4 out1.mp4


to simplify the command:

ffmpeg -f gif -i test.gif -f mp4 out2.mp4


The input gif has variable frame delays:

Frame 1 - no delay

Frame 2 - 1 sec

Frame 3 - 2 sec

Frame 4 - 4 sec


The generated video file does not maintain these time delay between the
frames.


I found a similar ticket from past

https://trac.ffmpeg.org/ticket/4235


Appreciate your help.


Thanks,

E

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

test.gif (16K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg: gif to video conversion does not keep gif time delay between frames.

Cley Faye
2017-05-07 18:16 GMT+02:00 Email Me <[hidden email]>:

> ffmpeg -f gif -i test.gif -f mp4 out2.mp4


‚ÄčIt's hard to tell without seeing the full output from ffmpeg, but there's
a distinct possibility you need to specify a framerate for the output using
-r.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg: gif to video conversion does not keep gif time delay between frames.

Carl Eugen Hoyos-2
In reply to this post by Email Me
2017-05-07 18:16 GMT+02:00 Email Me <[hidden email]>:

> ffmpeg -f gif -i test.gif -pix_fmt yuv420p -c:v libx264 -f mp4 out1.mp4

> ffmpeg -f gif -i test.gif -f mp4 out2.mp4

Complete, uncut console output missing.

> The input gif has variable frame delays:
>
> Frame 1 - no delay
> Frame 2 - 1 sec
> Frame 3 - 2 sec
> Frame 4 - 4 sec
>
> The generated video file does not maintain these time delay
> between the frames.

It is impossible to show the first frame for "no" time, and this
has an effect on the following frames.

Only constant frame rate mp4 output files are supported by libavformat,
since you didn't provide an output frame rate, FFmpeg tries to
guess one which is not easy for a gif file: It guesses -r 1 because
this is the granularity of the given gif file. Choose a higher frame rate
like -r 10 or -r 25 to show the first frame for a shorter amount of time.
Output frame rates lower than -r 6 will trigger timestamp issues,
the fps filter avoids them but fails outputting the last frame.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".