When I used ffprobe against an animated gif, I get, among other things, this:
> ffprobe.exe foo.gif
. . .
Stream #0:0: Video: gif, bgra, 500x372, 6.67 fps, 6.67 tbr, 100 tbn, 100 tbc
Great; this tells me the frame rate is 6.67 frames per second. But I'm going to be using this in a program and want it in a parsed format. ffprobe does json, but when I use it:
> ffprobe.exe -show_streams -of json foo.gif
The json shows:
"r_frame_rate": "20/3",
"avg_frame_rate": "20/3",
But I want the decimal form 6.67 instead of 20/3. Is there a way to have FFProbe produce its JSON output in decimal? I can't seem to find it in the docs.
My platform is Windows; FFProbe is version N-68482-g92a596f.
I did look into using ImageMagick, but the GIF file in question is corrupted (I'm working on a simple repair program); IM's "identify" command halts on it, while FFMpeg & FFProbe handle it just fine.
Addition: this is kind of academic now; I just used (in Python):
framerate_as_decimal = "%4.2f" % (float(fractions.Fraction(framerate_as_fraction)))
But I'm still kind of curious if there's an answer.