Answers.Body: <blockquote>
  <p>&quot;Q: Is it <strong>better</strong> to have more B-frames or more P-frame for video streaming?&quot;.</p>
  </blockquote>
  <p>From: <a href="https://en.wikipedia.org/wiki/Video_compression_picture_types" rel="noreferrer">https://en.wikipedia.org/wiki/Video_compression_picture_types</a></p>
  <blockquote>
  <p>The three major picture types used in the different video algorithms are I, P and B. They are different in the following characteristics:</p>
  <p>I‑frames are the least compressible but don't require other video frames to decode.</p>
  <p>P‑frames can use data from previous frames to decompress and are more compressible than I‑frames.</p>
  <p>B‑frames can use both previous and forward frames for data reference to get the highest amount of data compression.</p>
  </blockquote>
  <p>So for the sake of <strong>better</strong> compression and equal quality: B Frames are better.</p>
  <p>In <em>your</em> case <strong>better</strong> means that your TV better be able to decode and properly play your videos after spending hours/days transcoding them.</p>
  <p>So try one video using B-Frames, if there are glitches or you can't rewind properly use P-Frames. Be careful using a large number of B-Frames as that will use more Buffer.</p>
  <p>The &quot;CPU time&quot; you refer to applies on your computer, for the TV's Hardware decoding ASIC it shouldn't be a problem. As for Memory the reverse is true, your computer will have enough memory for many B-Frames but your TV might only have enough memory for a few.</p>
  <p>Blu-Ray uses 3 B-Frames so your TV ought to accept that many.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-19T05:40:53.223Z
Answers.LastActivityDate: 2017-11-19T05:40:53.223Z
Answers.LastEditDate: 2020-06-17T09:53:03.607Z
Answers.UserDisplayName: Rob
Body: <p>I'm trying to re-encode (H.264) some videos from my movie library in order to put them on a NAS and stream them to a smartTV through WiFi.</p>
  
  <p>In order to do so, I'm using <em>HandBrake</em> on MacOS and – among my experiments – I noticed that it promotes more B-frames.</p>
  
  <p>If I have understood correctly, those B-frames needs more CPU time and a larger buffer in memory in order to be properly elaborated and I'm not sure if a device such as a general smartTV (of few years) can take advantage of that (with 1080p sources, I used the 4.1 high profile).</p>
  
  <p>Here is an example plotted from <em>FFprobe</em> on the same video source (1080p) before and after re-encoding (and a little filter to reduce noise) at the target bitrate (2-pass VBR):
  <a href="https://i.sstatic.net/1zIkm.png" rel="noreferrer"><img src="https://i.sstatic.net/1zIkm.png" alt="Before"></a>
  <a href="https://i.sstatic.net/rGEVG.png" rel="noreferrer"><img src="https://i.sstatic.net/rGEVG.png" alt="After"></a></p>
  
  <p>What do you think or suggest ?</p>
  
  <p>I ask because the resulting file size is very similar and I can't really notice a difference (apart from the noisier frames).</p>
  
  <p>Thanks in advance!</p>
  
Tags: <streaming><h.264><handbrake><bitrate>
Title: It is better to have more B-frames or more P-frame for video streaming?
UserDisplayName: dezzeus
ThreadText: # It is better to have more B-frames or more P-frame for video streaming?
  
  (Asked by: username_0 on 2017-11-10)
  
  I'm trying to re-encode (H.264) some videos from my movie library in order to put them on a NAS and stream them to a smartTV through WiFi.
  
  In order to do so, I'm using *HandBrake* on MacOS and – among my experiments – I noticed that it promotes more B-frames.
  
  If I have understood correctly, those B-frames needs more CPU time and a larger buffer in memory in order to be properly elaborated and I'm not sure if a device such as a general smartTV (of few years) can take advantage of that (with 1080p sources, I used the 4.1 high profile).
  
  Here is an example plotted from *FFprobe* on the same video source (1080p) before and after re-encoding (and a little filter to reduce noise) at the target bitrate (2-pass VBR):
  [![Before](https://i.sstatic.net/1zIkm.png)](https://i.sstatic.net/1zIkm.png)
  [![After](https://i.sstatic.net/rGEVG.png)](https://i.sstatic.net/rGEVG.png)
  
  What do you think or suggest ?
  
  I ask because the resulting file size is very similar and I can't really notice a difference (apart from the noisier frames).
  
  Thanks in advance!
  
  **Tags:** streaming, h.264, handbrake, bitrate
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-11-19. Score: 6 | Accepted answer
  
  > "Q: Is it **better** to have more B-frames or more P-frame for video streaming?".
  
  From: <https://en.wikipedia.org/wiki/Video_compression_picture_types>
  
  > The three major picture types used in the different video algorithms are I, P and B. They are different in the following characteristics:
  >
  > I‑frames are the least compressible but don't require other video frames to decode.
  >
  > P‑frames can use data from previous frames to decompress and are more compressible than I‑frames.
  >
  > B‑frames can use both previous and forward frames for data reference to get the highest amount of data compression.
  
  So for the sake of **better** compression and equal quality: B Frames are better.
  
  In *your* case **better** means that your TV better be able to decode and properly play your videos after spending hours/days transcoding them.
  
  So try one video using B-Frames, if there are glitches or you can't rewind properly use P-Frames. Be careful using a large number of B-Frames as that will use more Buffer.
  
  The "CPU time" you refer to applies on your computer, for the TV's Hardware decoding ASIC it shouldn't be a problem. As for Memory the reverse is true, your computer will have enough memory for many B-Frames but your TV might only have enough memory for a few.
  
  Blu-Ray uses 3 B-Frames so your TV ought to accept that many.
  
  
  ---
  
  