[Live-devel] NAL Unit FU header

Ross Finlayson finlayson at live555.com
Fri Mar 31 09:43:09 PDT 2023



> On Mar 31, 2023, at 9:33 PM, Milos Jakovljevic <milos.jakovljevic at nittbit.com> wrote:
> 
> I'm currently using LIVE555 as an RTSP client in my library, and I'm experiencing an issue with HEVC 4K streams. Specifically, when I decode NAL units, I'm only able to view 1/3 of the picture, while the remaining 2/3 is green (you can view an example here: https://ibb.co/C8yFygm).
> 
> Upon further investigation, I discovered that I'm receiving three NAL units with the same timestamp, which I assume are fragments of the same picture.

It’s better (and more common) to describe these NAL units as “slices" rather than “fragments”.  (The word “fragment” is usually used to describe parts of a single NAL unit that are transmitted using more than one RTP packet.  As I noted earlier, the LIVE555 code automatically handles RTP fragmentation/defragmentation.  Your use of the word “fragment” was confusing.)


> However, I'm having trouble figuring out how to recognize if the NAL units are [slices] and how to merge them before sending them to the decoder.

Basically, you’re asking how to decode and render H.265 (aka. HEVC) video.  This has nothing to with the LIVE555 code (as it does not include any video decoding or encoding functionality), and thus is outside the scope of this mailing list.  However, you might wish to take a look at the VLC source code.  VLC uses the LIVE555 libraries to receive H.265 (and H.264) video over RTP, and thus will also receive one NAL slice at a time (when a video frame consists of multiple ’slice’ NAL units).  So, the VLC code has figured out how to decode and render these slices.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/




More information about the live-devel mailing list