One notable difference from the AVC/HEVC code is that it also inserts the METADATA and SEQUENCE_HEADER OBUs into new_packet, otherwise the resulting video file wouldn't play.