title: FFprobe, how to get frame rate of animated gif as a decimal in JSON format
body: <p>When I used ffprobe against an animated gif, I get, among other things,  this:</p>
  
  <pre><code>&gt; ffprobe.exe  foo.gif
  . . . 
  Stream #0:0: Video: gif, bgra, 500x372, 6.67 fps, 6.67 tbr, 100 tbn, 100 tbc
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>&gt; ffprobe.exe -show_streams -of json foo.gif
  </code></pre>
  
  <p>The json shows:</p>
  
  <pre><code>"r_frame_rate": "20/3",
  "avg_frame_rate": "20/3",
  </code></pre>
  
  <p>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.</p>
  
  <p>My platform is Windows; FFProbe is version N-68482-g92a596f.</p>
  
  <p>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 &amp; FFProbe handle it just fine.</p>
  
  <p>Addition: this is kind of academic now; I just used (in Python):</p>
  
  <pre><code>framerate_as_decimal = "%4.2f" % (float(fractions.Fraction(framerate_as_fraction)))
  </code></pre>
  
  <p>But I'm still kind of curious if there's an answer.</p>