3

For random access, I am under the impression that we need IDR (nal_unit_type=5), instead of non-IDR Iframe (nal_unit_type=1). Is this true? If so, what's point to have GOP start with a non-IDR Iframe, since a non-IDR Iframe is not enough to decode the remainder of a GOP?

VC.One
  • 14,790
  • 4
  • 25
  • 57
Rio Wing
  • 662
  • 5
  • 12

1 Answers1

2

You are right. An open GOP (starts with non IDR) is not independently decode-able anymore. Typically the first couple B-frames reference frames from the previous GOP. If your use case is playing the stream start to finish without seeking - than an open GOP with non-IDR is more efficient (fewer bits for the same quality). If your application seeks a lot it gets more complicated. Typically you can either discard the B frames referencing the previous frame or start decoding two non IDRs backwards. This doesn't solve the general case but works for most well behaved AVC streams.

Markus Schumann
  • 7,636
  • 1
  • 21
  • 27
  • 1
    Would you say the significance of non-IDR IFrame is to at least partially decode the GOP? – Rio Wing Aug 21 '18 at 16:29
  • Yes. Let's assume your GOP in storage order is: | non-IDR | B | B | P | ... | - you would have to discard the two B-frames since they likely reference something prior to the non-IDR but the rest should be decode-able. Keep in mind this is true for most AVC streams but not for all. – Markus Schumann Aug 21 '18 at 16:50
  • 1
    I marked this as answer unless something else comes up. nonIDR I-Frame can help generate thumbnails when seeking if that's considered important. – Rio Wing Aug 23 '18 at 18:14