Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2499 closed defect (duplicate)

gif -> mp4: wrong timestamps / duration

Reported by: sgehlich Owned by:
Priority: normal Component: avformat
Version: unspecified Keywords: fps
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
When converting .GIFs with different frame durations, the mp4 muxer (same with mpeg2) generates a wrong video with wrong frame durations.

first frame is rendered with default duration
second frame is rendered with the duration the first frame should have
third frame is rendered with the duratino the second frame should have
etc.

How to reproduce:

% wget http://forgif.me/system/image/4759/image.gif
% ffmpeg -i image.gif -pix_fmt yuv420p ghost.mp4

Attachments (1)

image.gif (480.1 KB ) - added by Carl Eugen Hoyos 11 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by Carl Eugen Hoyos, 11 years ago

Keywords: fps added; gif mp4 muxer removed
Resolution: duplicate
Status: newclosed

Duplicate of ticket #1578 and the tickets related to the mov muxer that only supports constant frame rate and therefore defaults to "-r x", work-around is to use -vf fps

For future tickets: Please always post your command line together with the complete, uncut console output.

by Carl Eugen Hoyos, 11 years ago

Attachment: image.gif added

comment:2 by sgehlich, 11 years ago

Please remove this comment, I was wrong. Sorry! Thanks for the workaround.

Last edited 11 years ago by sgehlich (previous) (diff)

comment:3 by Carl Eugen Hoyos, 11 years ago

But if you encode to mov, you have to choose a constant frame rate because the mov muxer only supports constant frame rate (if you do not select it yourself with -vf fps, ffmpeg will automatically choose a constant frame rate as if you selected "-r" leading to the bad timestamps that you observed).
Or in other words: The output file in your command line also has constant frame rate (but with incorrect / displaced frame duplication). You can immediately see that when looking at the console output.

comment:4 by Cigaes, 11 years ago

The point of -r leading to invalid rounding still stands, though.

Note: See TracTickets for help on using tickets.