<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">After looking to the code I think that
HEVCSEI should be be rewritten to something like:<br>
<br>
<blockquote type="cite"> typedef struct
H265RawSEIPayload {<br>
uint32_t payload_type;<br>
uint32_t payload_size;<br>
union {<br>
HEVCSEIPictureHash picture_hash;<br>
HEVCSEIFramePacking frame_packing;<br>
HEVCSEIDisplayOrientation
display_orientation;<br>
HEVCSEIPictureTiming picture_timing;<br>
HEVCSEIA53Caption a53_caption;<br>
HEVCSEIMasteringDisplay
mastering_display;<br>
HEVCSEIContentLight content_light;<br>
int active_seq_parameter_set_id;<br>
HEVCSEIAlternativeTransfer
alternative_transfer; <br>
} payload;<br>
} H265RawSEIPayload;<br>
<br>
<br>
typedef struct H265RawSEI {<br>
H265RawNALUnitHeader nal_unit_header;<br>
<br>
H265RawSEIPayload
payload[HEVC_MAX_SEI_PAYLOADS];<br>
uint8_t payload_count;<br>
} H265RawSEI;</blockquote>
<br>
<br>
In the decode stage, the above structs should be initialized at:<br>
<br>
<blockquote type="cite">static int
decode_nal_sei_message(GetBitContext *gb, void *logctx, HEVCSEI
*s,<br>
const HEVCParamSets *ps, int
nal_unit_type)<br>
{<br>
int payload_type = 0;<br>
int payload_size = 0;<br>
int byte = 0xFF;<br>
av_log(logctx, AV_LOG_DEBUG, "Decoding SEI\n");<br>
<br>
while (byte == 0xFF) {<br>
if (get_bits_left(gb) < 16 || payload_type >
INT_MAX - 255)<br>
return AVERROR_INVALIDDATA;<br>
byte = get_bits(gb, 8);<br>
<b> payload_type += byte;</b><br>
}<br>
byte = 0xFF;<br>
while (byte == 0xFF) {<br>
if (get_bits_left(gb) < 8 + 8LL*payload_size)<br>
return AVERROR_INVALIDDATA;<br>
byte = get_bits(gb, 8);<br>
<b>payload_size += byte;</b><br>
}</blockquote>
<br>
My two cents.... the HEVC code is incomplete.<br>
<br>
lyncher<br>
<br>
<br>
<br>
On 26-07-2018 19:46, <a class="moz-txt-link-abbreviated" href="mailto:lyncher@sapo.pt">lyncher@sapo.pt</a> wrote:<br>
</div>
<blockquote type="cite"
cite="mid:f3757415-ef41-d0f5-4701-498084dbc3df@sapo.pt">Hi,
<br>
In H264 there's a H264RawSEI type that allows creating new SEI
messages to be added to the video stream.
<br>
<br>
I was checking if it was possible to add new SEI messages to HEVC
video stream but I'm not able to find the equivalent object.
There's HEVCSEI type that has all the possible messages defined,
but it would be needed a type that has:
<br>
payload_type
<br>
payload_size
<br>
payload
<br>
<br>
What is the recommended approach to add new SEI messages to a HEVC
video stream?
<br>
Does current libavcodec supports encoding SEI messages to the HEVC
video stream?
<br>
<br>
Thanks
<br>
lyncher
<br>
<br>
<br>
_______________________________________________
<br>
Libav-user mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://ffmpeg.org/mailman/listinfo/libav-user">http://ffmpeg.org/mailman/listinfo/libav-user</a>
<br>
</blockquote>
<p><br>
</p>
</body>
</html>