Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
[request] Variable Frame Duration Gif Input
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
Runer112
Posted: Feb 10 2013, 02:26 AM


Newbie


Group: Members
Posts: 3
Member No.: 36071
Joined: 10-February 13



I (and a number of others on whose behalf I am also posting) often work with software that produces animated GIFs. A friend of mine asked if I had any suggestions for how to upscale the tiny resolution GIFs to large resolution videos for uploading to YouTube to avoid the smooth upscaling. I remembered having used VirtualDub in the past and checked, and sure enough it accepted GIFs as input, and I thought I had found the perfect solution for him!

However, it turns out there is a problem. The software we use produces animated GIFs that use the variable frame duration feature of the specification. It appears that VirtualDub does not support this, and instead gives each frame the same duration.

I see two general ways to add support for this. The first: outright supporting variable frame durations. But I imagine this could greatly complicate things internally, so it's probably best to give that one a pass. Instead, when opening a GIF, could you use the lowest common multiple of the frame durations as the input frame duration and then convert each source frame into itself and zero or more null frames such that the original timing is kept?


Thanks in advance for your consideration.


P.S. I've used VirtualDub for years now and I love its raw and powerful approach to video editing and converting. Even if you don't implement this, I want to say thanks for all the other awesome work you've put into it!
 
     Top
GrofLuigi
Posted: Feb 10 2013, 07:20 PM


Advanced Member


Group: Members
Posts: 148
Member No.: 340
Joined: 22-September 02



As always, Avisynth is a good companion to VirtualDub for video processing.

Here might be a good start.

GL
 
     Top
Runer112
Posted: Feb 10 2013, 07:46 PM


Newbie


Group: Members
Posts: 3
Member No.: 36071
Joined: 10-February 13



I looked into Avisynth, and found (on this page) the following information about using GIF animations:

QUOTE
ImageSourceAnim (added in v2.60; requires 1.7.8 DevIL.dll) lets you import animations (gif, ppm, tiff or psd). If there is a delay between the first and second image in the animation, the framerate is set accordingly.


As far as I can tell, this means that Avisynth does not really support source GIFs with variable frame duration, as it only grabs the delay between the first two frames and uses that to give the whole animation a constant speed.

As for the link you posted about variable frame rate sources, it appears that this usually requires a timecodes text file. However I don't see any mention of a tool to create such a file from animated GIFs (and I really doubt I have enough skill to make such a tool) so I still seem to be stuck.
 
     Top
phaeron
Posted: Feb 16 2013, 07:46 PM


Virtualdub Developer


Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02



VirtualDub has to remap the variable timestamps to a fixed frame rate for output, as the formats it uses do not support VFR. However, it analyzes the timestamps and attempts to duplicate frames to maintain the relative timing between frames. Do you have some examples of the frame delay values that are being output by your application? I'd like to see this to determine if there is an unusual pattern that might be tripping up the analysis algorithm.
 
    Top
Runer112
Posted: Mar 27 2013, 06:30 AM


Newbie


Group: Members
Posts: 3
Member No.: 36071
Joined: 10-February 13



Whoops, I sort of let this thread slip my mind...

Anyways I figured that VirtualDub wouldn't support actually operating with variable frame rate sources, but it sounds like you're saying that it does intelligently duplicate frames to fill out the correct timing. However, I don't see this being the case for most of the GIF files I've tried.

Here's a good example of a GIF with a variable frame rate:
user posted image

And here it is after ran through VirtualDub and back into a GIF format (might have a slightly messed up palette, but the timing should be corresponding to what VirtualDub produced):
user posted image

It seems almost as if each source frame was given the same duration. Or maybe not, I can't quite tell from just eyeballing it. But the timing is definitely off. You can definitely see that some of the long frames have become a lot shorter, and some of the short frames have become a fair amount longer.
 
     Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
4 replies since Feb 10 2013, 02:26 AM Track this topic | Email this topic | Print this topic

<< Back to VirtualDub Development Forum