RASL frames in open-gop HEVC videos

Started by Alex2308, July 06, 2021, 06:33:47 PM

Previous topic - Next topic

Alex2308

Hello guys,

I'd like to ask developers is it possible to implement discarding of RASL b-frames when cutting HEVC open-gop streams?

Although RASL frames are coded just after CRA frame (in my case 7 RASL b-frames in hierarchical coding), in display order they are viewed before CRA I-frame and depend on previous GOP that is no longer present (removed). I noticed that when I remove RASL frames manually, using HEVC stream analyzer and HEX editor from elementary stream those files are played without small "jump" or "pause" in player and the timecode on cut point in Avidemux is correct (goes for example from 00:00:02.140 to 00:00:02.160 instead of 00:00:02.140 to 00:00:02.380 or whatever.

Also is it possible to show IDR frame types as IDR in the gui and not I frame?

Sorry if this is too much to ask but the issue with RASL frames is bugging me for quite some time.

eumagga0x2a

Thank you for the hint, I'll try to investigate our options. With H.264, we know from NAL whether we may safely drop a particular early B-frame (we never drop early B-frames which are used for reference, albeit we cannot tell which frames use them as reference). At my current level of ignorance, I am not aware of a similar simple and secure indicator for HEVC. The question is whether your finding about RASL (N, R or both?) being droppable is universal or specific to a particular HEVC encoder configuration.

Quote from: Alex2308 on July 06, 2021, 06:33:47 PMAlso is it possible to show IDR frame types as IDR in the gui and not I frame?

It is not just GUI, the backend lies about frame type. Only when checking cut point in-depth in copy mode, the real frame type is determined.

Last but not least, IDR as a term is pretty specific to H.264 and HEVC, so no matter which path Avidemux chooses, it will contribute to confusion (e.g. with VP9, not calling intra frames "IDR" would make them appear less suitable for cut points while doing the opposite would use a term alien to this codec).

Alex2308

Quote from: eumagga0x2a on July 06, 2021, 08:35:39 PMThank you for the hint, I'll try to investigate our options. With H.264, we know from NAL whether we may safely drop a particular early B-frame (we never drop early B-frames which are used for reference, albeit we cannot tell which frames use them as reference). At my current level of ignorance, I am not aware of a similar simple and secure indicator for HEVC. The question is whether your finding about RASL (N, R or both?) being droppable is universal or specific to a particular HEVC encoder configuration.

Quote from: Alex2308 on July 06, 2021, 06:33:47 PMAlso is it possible to show IDR frame types as IDR in the gui and not I frame?

It is not just GUI, the backend lies about frame type. Only when checking cut point in-depth in copy mode, the real frame type is determined.

Last but not least, IDR as a term is pretty specific to H.264 and HEVC, so no matter which path Avidemux chooses, it will contribute to confusion (e.g. with VP9, not calling intra frames "IDR" would make them appear less suitable for cut points while doing the opposite would use a term alien to this codec).


Thanks for answering,

I wish I can tell you that it's safe to remove them in majority of cases but I don't have as much samples for proper testing. And as you know, different encoders do stuff differently. From my experience, in sample videos that I have, there was no additional problems when I removed them manually (both reference and non-reference) and when I played them using Nvidia decoder. Can it be implemented as some config option for advanced users? I will try to find out more about this when I have more different hevc samples and I'll let you know. 

As for the thing with frame types, you are right, I forgot that Avidemux works with other codecs too. It's perfectly understandable. It's probably too much problem to implement that properly for all codecs.