Answers.Body: <p>The following answer is compiled from comments on the question made by Gantendo.</p>
  <p>A helpful resource for understanding video compression is <a href="https://imagekit.io/blog/video-compression-techniques/" rel="nofollow noreferrer"><em>A Detailed Overview Of Popular Video Compression Techniques</em></a> by ImageKit.</p>
  <ul>
  <li><p>Is there a way to tell if a file is using inter-frame prediction?</p>
  <ul>
  <li>Yes, you can look at which codec is used. If it is a codec that does not use inter-frame prediction then it is not used and vice versa.
  <ul>
  <li>(This part of the answer is not entirely helpful. How can I know if a particular codec uses it? I have not found a place with this information.)</li>
  </ul>
  </li>
  </ul>
  </li>
  <li><p>Is there a way to tell if a file is using inter-frame prediction optimally?</p>
  <ul>
  <li>&quot;Optimal&quot; is a difficult word in this context because, since there is a tradeoff between space (and even gpu/cpu used) and quality. Use H.265 and it is pretty damn good.</li>
  </ul>
  </li>
  <li><p>If a file is not using inter-frame prediction, is there a way to convert it to one that does?</p>
  <ul>
  <li>Yes, you can convert videos from one codec to another. Check out <a href="https://handbrake.fr/docs/en/1.7.0/introduction/about.html" rel="nofollow noreferrer">Handbrake</a> and <a href="https://docs.tdarr.io/docs/welcome/what" rel="nofollow noreferrer">Tdarr</a>.
  <ul>
  <li>In addition to those, it appears that <a href="https://imagekit.io" rel="nofollow noreferrer">ImageKit</a> also does this. The <a href="https://imagekit.io/blog/video-compression-techniques/" rel="nofollow noreferrer">ImageKit article</a> also says VLC and Adobe Media Encoder can be used.</li>
  </ul>
  </li>
  </ul>
  </li>
  <li><p>If a file is using inter-frame prediction, but not optimally, is there a way to convert it to a file that uses the technique better?</p>
  <ul>
  <li>If a file is H.264 you can convert it to H.265 which should improve compression. See <a href="https://www.boxcast.com/blog/hevc-h.265-vs.-h.264-avc-whats-the-difference" rel="nofollow noreferrer"><em>HEVC (H.265) vs. AVC (H.264): What’s the Difference?</em></a> by BoxCast.</li>
  </ul>
  </li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-22T16:04:19.343Z
Answers.LastActivityDate: 2024-02-25T00:35:40.293Z
Answers.LastEditDate: 2024-02-25T00:35:40.293Z
Answers.UserDisplayName: NewSites
Body: <p>Over on Super User, I asked the question, <a href="https://superuser.com/questions/1830199/what-file-properties-affect-the-size-of-a-video-file">&quot;What file properties affect the size of a video file?&quot;</a>. A comment from Gantendo taught me about <a href="https://en.wikipedia.org/wiki/Video_compression_picture_types" rel="nofollow noreferrer">picture types</a> and the apparently equivalent <a href="https://en.wikipedia.org/wiki/Inter_frame" rel="nofollow noreferrer">frame types</a>. Another comment from him taught me that I can inspect a file to observe the use of these techniques by installing <a href="https://ffmpeg.org/" rel="nofollow noreferrer">FFmpeg</a> and running:</p>
  <pre><code>FFmpeg -i &lt;filespec&gt; -vf &quot;showinfo&quot; -f null -
  </code></pre>
  <p>and then looking at the values of the field <code>type</code> in the output.</p>
  <p>I did that on one of my files and if I understand the output, it has some introductory data followed by a line of data for every frame, including a field <code>type</code>. From a quick look at that output, it appears that there are a few I frames, while most of the frames are of type P. So it seems that the file is using &quot;<a href="https://en.wikipedia.org/wiki/Inter_frame" rel="nofollow noreferrer">inter-frame prediction</a>&quot; a lot.</p>
  <p>My question has four parts:</p>
  <ul>
  <li>Is there a way to tell if a file is using inter-frame prediction without having to inspect thousands of lines of output from FFmpeg?</li>
  <li>Is there a way to tell if a file is using inter-frame prediction optimally, so that I know whether this type of compression is being done as well as possible or could be improved?</li>
  <li>If a file is not using inter-frame prediction, is there a way to convert it to one that does?</li>
  <li>If a file is using inter-frame prediction, but not optimally, is there a way to convert it to a file that uses the technique better?</li>
  </ul>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-02-21T19:06:49.423Z
Comments.Text: @Gantendo - Thank you. You answered all four parts of my question. Is there a reason you don't want to post that as an answer? If you do, I would like to accept it.
Comments.UserDisplayName: NewSites
Tags: <compression>
Title: How to find out if a video file has picture types P and/or B and uses inter-frame prediction optimally?
UserDisplayName: NewSites
ThreadText: # How to find out if a video file has picture types P and/or B and uses inter-frame prediction optimally?
  
  (Asked by: username_0 on 2024-02-20)
  
  Over on Super User, I asked the question, ["What file properties affect the size of a video file?"](https://superuser.com/questions/1830199/what-file-properties-affect-the-size-of-a-video-file). A comment from Gantendo taught me about [picture types](https://en.wikipedia.org/wiki/Video_compression_picture_types) and the apparently equivalent [frame types](https://en.wikipedia.org/wiki/Inter_frame). Another comment from him taught me that I can inspect a file to observe the use of these techniques by installing [FFmpeg](https://ffmpeg.org/) and running:
  
  ```
  FFmpeg -i <filespec> -vf "showinfo" -f null -
  
  ```
  
  and then looking at the values of the field `type` in the output.
  
  I did that on one of my files and if I understand the output, it has some introductory data followed by a line of data for every frame, including a field `type`. From a quick look at that output, it appears that there are a few I frames, while most of the frames are of type P. So it seems that the file is using "[inter-frame prediction](https://en.wikipedia.org/wiki/Inter_frame)" a lot.
  
  My question has four parts:
  
  * Is there a way to tell if a file is using inter-frame prediction without having to inspect thousands of lines of output from FFmpeg?
  * Is there a way to tell if a file is using inter-frame prediction optimally, so that I know whether this type of compression is being done as well as possible or could be improved?
  * If a file is not using inter-frame prediction, is there a way to convert it to one that does?
  * If a file is using inter-frame prediction, but not optimally, is there a way to convert it to a file that uses the technique better?
  
  **Tags:** compression
  
  > **Comments:**
  > **username_0**: @Gantendo - Thank you. You answered all four parts of my question. Is there a reason you don't want to post that as an answer? If you do, I would like to accept it.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2024-02-22. Score: 0
  
  The following answer is compiled from comments on the question made by Gantendo.
  
  A helpful resource for understanding video compression is [*A Detailed Overview Of Popular Video Compression Techniques*](https://imagekit.io/blog/video-compression-techniques/) by ImageKit.
  
  * Is there a way to tell if a file is using inter-frame prediction?
  
    + Yes, you can look at which codec is used. If it is a codec that does not use inter-frame prediction then it is not used and vice versa.
      - (This part of the answer is not entirely helpful. How can I know if a particular codec uses it? I have not found a place with this information.)
  * Is there a way to tell if a file is using inter-frame prediction optimally?
  
    + "Optimal" is a difficult word in this context because, since there is a tradeoff between space (and even gpu/cpu used) and quality. Use H.265 and it is pretty damn good.
  * If a file is not using inter-frame prediction, is there a way to convert it to one that does?
  
    + Yes, you can convert videos from one codec to another. Check out [Handbrake](https://handbrake.fr/docs/en/1.7.0/introduction/about.html) and [Tdarr](https://docs.tdarr.io/docs/welcome/what).
      - In addition to those, it appears that [ImageKit](https://imagekit.io) also does this. The [ImageKit article](https://imagekit.io/blog/video-compression-techniques/) also says VLC and Adobe Media Encoder can be used.
  * If a file is using inter-frame prediction, but not optimally, is there a way to convert it to a file that uses the technique better?
  
    + If a file is H.264 you can convert it to H.265 which should improve compression. See [*HEVC (H.265) vs. AVC (H.264): What’s the Difference?*](https://www.boxcast.com/blog/hevc-h.265-vs.-h.264-avc-whats-the-difference) by BoxCast.
  
  
  ---
  
  