[FFmpeg-devel] Patch to parse H264 SEI Green Metadata

Nicolas Derouineau nicolas.derouineau at vitec.com
Mon Jun 29 15:01:48 CEST 2015


Two patches are now here enclosed:

The first one enable metadata parsing. The second one add a new options in the file avcodec/options_table.h

Tested with:

./ffplay -debug green_metadata ~/GreenMetaDataSEI.264

Best Regards,

Nicolas DEROUINEAU
Research Engineer
VITEC

T.  +33 1 46 73 06 06
E.  nicolas.derouineau at vitec.com
W. www.vitec.com

________________________________________
De : ffmpeg-devel-bounces at ffmpeg.org <ffmpeg-devel-bounces at ffmpeg.org> de la part de Nicolas Derouineau <nicolas.derouineau at vitec.com>
Envoyé : lundi 29 juin 2015 14:20
À : FFmpeg development discussions and patches
Objet : Re: [FFmpeg-devel] Patch to parse H264 SEI Green Metadata

Hello,
Thank you for your comments.

Please find enclosed the updated patch.

I have tested it with the following cmdline:

./ffplay -debug 1048576 ~/GreenMetaDataSEI.264

I know that this debug flag should be define somewhere as a string in order to display it with:

./ffplay --help

Could someone point me to the correct location to do this ?

Ps: Reference Bitstreams are still available here: ftp-public-greenvideo.insa-rennes.fr

Ps 2: This message may look like a duplicate, but I have been experiencing issues to subscribe to the mailing list.



Best regards,
Nicolas DEROUINEAU
Research Engineer
VITEC

T.  +33 1 46 73 06 06
E.  nicolas.derouineau at vitec.com
W. www.vitec.com

________________________________________
De : Vittorio Giovara <vittorio.giovara at gmail.com>
Envoyé : vendredi 26 juin 2015 02:56
À : FFmpeg development discussions and patches
Cc : Nicolas Derouineau; Yahia Benmoussa; Erwan Raffin; michaelni at gmx.at; Didier Nicholson; Nicolas Tizon
Objet : Re: [FFmpeg-devel] Patch to parse H264 SEI Green Metadata

On Thu, Jun 25, 2015 at 5:30 PM, Michael Niedermayer
<michael at niedermayer.cc> wrote:
> On Thu, Jun 25, 2015 at 11:13:53AM +0000, Nicolas Derouineau wrote:
>> Hello,
>> Please find here enclosed a patch enabling h264 Green Metada SEI parsing for FFMPEG. You'll be able to find reference bitstreams containing the metadata at the following adress:
>>
>> ftp-public-greenvideo.insa-rennes.fr
>>
>>
>> The Nal SEI syntax is the same as the one used in the last JM release (19.0).
>>
>>
>> Best Regards,
>>
>>
>>
>> Nicolas DEROUINEAU
>> Research Engineer
>> VITEC
>>
>> T.  +33 1 46 73 06 06
>> E.  nicolas.derouineau at vitec.com<mailto:nicolas.derouineau at vitec.com>
>> W. www.vitec.com<http://www.vitec.com/>;
>
>>  h264.h     |   20 ++++++++++++++++++
>>  h264_sei.c |   67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 87 insertions(+)
>> feb39a55dd6afbaf341df765eafc02266c00a588  0002-Enabling-GreenMetadata-SEI-parsing-for-H264-decoder.patch
>> From 60903bff6429182c84dc5daef0d26695d3f71861 Mon Sep 17 00:00:00 2001
>> From: Nicolas DEROUINEAU <nicolas.derouineau at vitec.com>
>> Date: Thu, 25 Jun 2015 13:02:39 +0200
>> Subject: [PATCH 2/2] Enabling GreenMetadata SEI parsing for H264 decoder
>>
>> ---
>>  libavcodec/h264.h     | 20 +++++++++++++++
>>  libavcodec/h264_sei.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 87 insertions(+)
>>
>> diff --git a/libavcodec/h264.h b/libavcodec/h264.h
>> index 548510d..0324dc1 100644
>> --- a/libavcodec/h264.h
>> +++ b/libavcodec/h264.h
>> @@ -137,6 +137,7 @@ typedef enum {
>>      SEI_TYPE_RECOVERY_POINT         = 6,   ///< recovery point (frame # to decoder sync)
>>      SEI_TYPE_FRAME_PACKING          = 45,  ///< frame packing arrangement
>>      SEI_TYPE_DISPLAY_ORIENTATION    = 47,  ///< display orientation
>> +    SEI_TYPE_GREEN_METADATA  = 56  ///< GreenMPEG information
>>  } SEI_Type;
>>
>>  /**
>> @@ -268,6 +269,22 @@ typedef struct FPA {
>>  } FPA;
>>
>>  /**
>> + * Green MetaData Information Type
>> + */
>> +typedef struct GreenMetaData {
>> +    unsigned char  green_metadata_type;
>> +    unsigned char  period_type;
>> +    unsigned short num_seconds;
>> +    unsigned short num_pictures;

uint16_t and uint8_t would probably be more appropriate here

>> +    unsigned char percent_non_zero_macroblocks;
>> +    unsigned char percent_intra_coded_macroblocks;
>> +    unsigned char percent_six_tap_filtering;
>> +    unsigned char percent_alpha_point_deblocking_instance;
>> +    unsigned char xsd_metric_type;
>> +    unsigned short xsd_metric_value;
>> +} GreenMetaData;
>> +
>> +/**
>>   * Memory management control operation opcode.
>>   */
>>  typedef enum MMCOOpcode {
>> @@ -804,6 +821,9 @@ typedef struct H264Context {
>>      /* Motion Estimation */
>>      qpel_mc_func (*qpel_put)[16];
>>      qpel_mc_func (*qpel_avg)[16];
>> +
>> +    /*Green Metadata */
>> +    GreenMetaData sei_GreenMetaData;

This is mostly a nit, but could you maybe avoid using CamelCase naming
in function and variable names?
eg GreenMetaData sei_green_metadata would reflect more the rest of the code.

thanks
--
Vittorio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Enabling-GreenMetadata-SEI-parsing-for-H264-decoder.patch
Type: text/x-patch
Size: 6065 bytes
Desc: 0002-Enabling-GreenMetadata-SEI-parsing-for-H264-decoder.patch
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150629/4cc9779c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Update-for-libavcodec-debug-options-enabling-GreenMe.patch
Type: text/x-patch
Size: 1141 bytes
Desc: 0004-Update-for-libavcodec-debug-options-enabling-GreenMe.patch
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150629/4cc9779c/attachment-0001.bin>


More information about the ffmpeg-devel mailing list