[FFmpeg-devel] [FFMPEG DEVEL] [PATCH v5] fftools/ffprobe: Add S12M Timecode output as side data (such as SEI TC)
Marton Balint
cus at passwd.hu
Thu May 23 22:14:48 EEST 2019
On Wed, 22 May 2019, Antonin Gouzer wrote:
> ---
> Change structure to conserve one SEI data=one side data with multiple
> timecode elements
Thanks for the changes, patch is looking good except for some minor
issues. However, you need to extend doc/ffprobe.xsd to support the changed
XML layout, so that part is missing.
> ---
> fftools/ffprobe.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
> index dea489d02e..c9c15fc205 100644
> --- a/fftools/ffprobe.c
> +++ b/fftools/ffprobe.c
> @@ -165,6 +165,7 @@ typedef enum {
> SECTION_ID_FRAME_TAGS,
> SECTION_ID_FRAME_SIDE_DATA_LIST,
> SECTION_ID_FRAME_SIDE_DATA,
> + SECTION_ID_FRAME_SIDE_DATA_TIMECODE,
> SECTION_ID_FRAME_LOG,
> SECTION_ID_FRAME_LOGS,
> SECTION_ID_LIBRARY_VERSION,
> @@ -209,7 +210,8 @@ static struct section sections[] = {
> [SECTION_ID_FRAME] = { SECTION_ID_FRAME, "frame", 0, { SECTION_ID_FRAME_TAGS, SECTION_ID_FRAME_SIDE_DATA_LIST, SECTION_ID_FRAME_LOGS, -1 } },
> [SECTION_ID_FRAME_TAGS] = { SECTION_ID_FRAME_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "frame_tags" },
> [SECTION_ID_FRAME_SIDE_DATA_LIST] ={ SECTION_ID_FRAME_SIDE_DATA_LIST, "side_data_list", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDE_DATA, -1 }, .element_name = "side_data", .unique_name = "frame_side_data_list" },
> - [SECTION_ID_FRAME_SIDE_DATA] = { SECTION_ID_FRAME_SIDE_DATA, "side_data", 0, { -1 } },
> + [SECTION_ID_FRAME_SIDE_DATA] = { SECTION_ID_FRAME_SIDE_DATA, "side_data", 0, { SECTION_ID_FRAME_SIDE_DATA_TIMECODE, -1 } },
> + [SECTION_ID_FRAME_SIDE_DATA_TIMECODE] = { SECTION_ID_FRAME_SIDE_DATA_TIMECODE, "timecode", 0, { -1 } },
> [SECTION_ID_FRAME_LOGS] = { SECTION_ID_FRAME_LOGS, "logs", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_LOG, -1 } },
> [SECTION_ID_FRAME_LOG] = { SECTION_ID_FRAME_LOG, "log", 0, { -1 }, },
> [SECTION_ID_LIBRARY_VERSIONS] = { SECTION_ID_LIBRARY_VERSIONS, "library_versions", SECTION_FLAG_IS_ARRAY, { SECTION_ID_LIBRARY_VERSION, -1 } },
> @@ -2199,6 +2201,16 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
> char tcbuf[AV_TIMECODE_STR_SIZE];
> av_timecode_make_mpeg_tc_string(tcbuf, *(int64_t *)(sd->data));
> print_str("timecode", tcbuf);
> + } else if (sd->type == AV_FRAME_DATA_S12M_TIMECODE && sd->size >= 8) {
You can match for exact size (== 16), the docs of the frame data does not
allow different sizes.
> + uint32_t *tc = (uint32_t*)sd->data;
> + int m = FFMIN(tc[0],3);
> + for (int j = 1; j <= m ; j++) {
> + char tcbuf[AV_TIMECODE_STR_SIZE];
> + av_timecode_make_smpte_tc_string(tcbuf, tc[j], 0);
> + writer_print_section_header(w, SECTION_ID_FRAME_SIDE_DATA_TIMECODE);
> + print_str("value", tcbuf);
> + writer_print_section_footer(w);
Tabs are not allowed, please use only spaces for indentation.
Thanks,
Marton
More information about the ffmpeg-devel
mailing list