title: Getting frames rate from CMFormatDescription
body: <p>I am trying to calculate frame rate of a video format based on CMFormatDescription but I'm getting strange output that I do not know what to do with. According to the documentation, &quot;value/timescale = seconds&quot;. This is also the answer in this <a href="https://stackoverflow.com/questions/4001755/trying-to-understand-cmtime-and-cmtimemake">question</a>.</p>
  <p>The code is being called while getting a video stream from FaceTime camera:</p>
  <pre><code>let av = device.activeFormat
  let fd = av.formatDescription
  print(&quot;time scale&quot;,fd.frameDuration.timescale)
  print(&quot;value&quot;,fd.frameDuration.value)  
  print(&quot;value/timescale=&quot;,fd.frameDuration.value)/Int64(fd.frameDuration.timescale))
  </code></pre>
  <p>This is the output:</p>
  <p>time scale 480<br />
  value 2749654773878<br />
  value/timescale= 5728447445.579166</p>
  <p>What am I missing? What is the frames rate?</p>
  <p><em><strong>EDIT</strong></em>: It seems that there is a bug or perhaps something is terribly wrong. time scale is always == height (of the format description). I tried it with a usb camera and they are always equal.</p>