[Libav-user] HEVCRawSEI?

lyncher at sapo.pt lyncher at sapo.pt
Fri Jul 27 17:47:38 EEST 2018


After looking to the code I think that HEVCSEI should be be rewritten to 
something like:

>                 typedef struct H265RawSEIPayload {
>                     uint32_t payload_type;
>                     uint32_t payload_size;
>                     union {
>                         HEVCSEIPictureHash picture_hash;
>                         HEVCSEIFramePacking frame_packing;
>                         HEVCSEIDisplayOrientation display_orientation;
>                         HEVCSEIPictureTiming picture_timing;
>                         HEVCSEIA53Caption a53_caption;
>                         HEVCSEIMasteringDisplay mastering_display;
>                         HEVCSEIContentLight content_light;
>                         int active_seq_parameter_set_id;
>                         HEVCSEIAlternativeTransfer alternative_transfer;
>                     } payload;
>                 } H265RawSEIPayload;
>
>
>                 typedef struct H265RawSEI {
>                     H265RawNALUnitHeader nal_unit_header;
>
>                     H265RawSEIPayload payload[HEVC_MAX_SEI_PAYLOADS];
>                     uint8_t payload_count;
>                 } H265RawSEI;


In the decode stage, the above structs should be initialized at:

> static int decode_nal_sei_message(GetBitContext *gb, void *logctx, 
> HEVCSEI *s,
>                                   const HEVCParamSets *ps, int 
> nal_unit_type)
> {
>     int payload_type = 0;
>     int payload_size = 0;
>     int byte = 0xFF;
>     av_log(logctx, AV_LOG_DEBUG, "Decoding SEI\n");
>
>     while (byte == 0xFF) {
>         if (get_bits_left(gb) < 16 || payload_type > INT_MAX - 255)
>             return AVERROR_INVALIDDATA;
>         byte          = get_bits(gb, 8);
> *payload_type += byte;*
>     }
>     byte = 0xFF;
>     while (byte == 0xFF) {
>         if (get_bits_left(gb) < 8 + 8LL*payload_size)
>             return AVERROR_INVALIDDATA;
>         byte          = get_bits(gb, 8);
> *payload_size += byte;*
>     }

My two cents.... the HEVC code is incomplete.

lyncher



On 26-07-2018 19:46, lyncher at sapo.pt wrote:
> Hi,
> In H264 there's a H264RawSEI type that allows creating new SEI 
> messages to be added to the video stream.
>
> 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:
>     payload_type
>     payload_size
>     payload
>
> What is the recommended approach to add new SEI messages to a HEVC 
> video stream?
> Does current libavcodec supports encoding SEI messages to the HEVC 
> video stream?
>
> Thanks
> lyncher
>
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20180727/ced0581c/attachment.html>


More information about the Libav-user mailing list