Re: [FFmpeg-devel] [FFMPEG DEVEL] [PATCH v6] fftools/ffprobe: Add S12M Timecode output as side data (such as SEI TC)

2019-05-29 Thread Antonin Gouzer
Thank you very much!

Le lun. 27 mai 2019 à 00:35, Marton Balint  a écrit :

>
>
> On Sat, 25 May 2019, Antonin Gouzer wrote:
>
> > Hello,
> > Shame on me, I didn't test the patch with the json format, only xml and
> flat.
> > It's ok now.
> > ok for XML too.
> >
> > Thanks!
>
> Thanks, applied.
>
> Regards,
> Marton
>
> >
> >
> > Le sam. 25 mai 2019 à 00:27, Marton Balint  a écrit :
> >>
> >>
> >>
> >> On Fri, 24 May 2019, Antonin Gouzer wrote:
> >>
> >> > ---
> >> > Add S12M Timecode output with the show_frame option
> >> > Multiple timecodes (3) for one frame support
> >> > Control side date Size to 16
> >> > Correct ffrpobe.xsd to allow multiple timecodes in side_data element
> >> > ---
> >> > doc/ffprobe.xsd   |  8 
> >> > fftools/ffprobe.c | 14 +-
> >> > 2 files changed, 21 insertions(+), 1 deletion(-)
> >>
> >> I almost committed this, but found another issue: the JSON output
> >> contained the "timecode" key multiple times. Apparently in order for the
> >> JSON output to work, we need a separate section for arrays.
> >>
> >> I managed to make those changes (see the attached patch), it affected
> the
> >> XML output slightly as well. Please let me know if this is satisfactory
> to
> >> you.
> >>
> >> Thanks,
> >> Marton___
> >> ffmpeg-devel mailing list
> >> ffmpeg-devel@ffmpeg.org
> >> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >>
> >> To unsubscribe, visit link above, or email
> >> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [FFMPEG DEVEL] [PATCH v6] fftools/ffprobe: Add S12M Timecode output as side data (such as SEI TC)

2019-05-26 Thread Marton Balint



On Sat, 25 May 2019, Antonin Gouzer wrote:


Hello,
Shame on me, I didn't test the patch with the json format, only xml and flat.
It's ok now.
ok for XML too.

Thanks!


Thanks, applied.

Regards,
Marton




Le sam. 25 mai 2019 à 00:27, Marton Balint  a écrit :




On Fri, 24 May 2019, Antonin Gouzer wrote:

> ---
> Add S12M Timecode output with the show_frame option
> Multiple timecodes (3) for one frame support
> Control side date Size to 16
> Correct ffrpobe.xsd to allow multiple timecodes in side_data element
> ---
> doc/ffprobe.xsd   |  8 
> fftools/ffprobe.c | 14 +-
> 2 files changed, 21 insertions(+), 1 deletion(-)

I almost committed this, but found another issue: the JSON output
contained the "timecode" key multiple times. Apparently in order for the
JSON output to work, we need a separate section for arrays.

I managed to make those changes (see the attached patch), it affected the
XML output slightly as well. Please let me know if this is satisfactory to
you.

Thanks,
Marton___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [FFMPEG DEVEL] [PATCH v6] fftools/ffprobe: Add S12M Timecode output as side data (such as SEI TC)

2019-05-25 Thread Antonin Gouzer
Hello,
Shame on me, I didn't test the patch with the json format, only xml and flat.
It's ok now.
ok for XML too.

Thanks!


Le sam. 25 mai 2019 à 00:27, Marton Balint  a écrit :
>
>
>
> On Fri, 24 May 2019, Antonin Gouzer wrote:
>
> > ---
> > Add S12M Timecode output with the show_frame option
> > Multiple timecodes (3) for one frame support
> > Control side date Size to 16
> > Correct ffrpobe.xsd to allow multiple timecodes in side_data element
> > ---
> > doc/ffprobe.xsd   |  8 
> > fftools/ffprobe.c | 14 +-
> > 2 files changed, 21 insertions(+), 1 deletion(-)
>
> I almost committed this, but found another issue: the JSON output
> contained the "timecode" key multiple times. Apparently in order for the
> JSON output to work, we need a separate section for arrays.
>
> I managed to make those changes (see the attached patch), it affected the
> XML output slightly as well. Please let me know if this is satisfactory to
> you.
>
> Thanks,
> Marton___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [FFMPEG DEVEL] [PATCH v6] fftools/ffprobe: Add S12M Timecode output as side data (such as SEI TC)

2019-05-24 Thread Marton Balint



On Fri, 24 May 2019, Antonin Gouzer wrote:


---
Add S12M Timecode output with the show_frame option
Multiple timecodes (3) for one frame support
Control side date Size to 16
Correct ffrpobe.xsd to allow multiple timecodes in side_data element
---
doc/ffprobe.xsd   |  8 
fftools/ffprobe.c | 14 +-
2 files changed, 21 insertions(+), 1 deletion(-)


I almost committed this, but found another issue: the JSON output 
contained the "timecode" key multiple times. Apparently in order for the 
JSON output to work, we need a separate section for arrays.


I managed to make those changes (see the attached patch), it affected the 
XML output slightly as well. Please let me know if this is satisfactory to 
you.


Thanks,
MartonFrom 3e1274d2250fca79acb5eb7b636ee924c6be2640 Mon Sep 17 00:00:00 2001
From: Antonin Gouzer 
Date: Fri, 24 May 2019 09:46:50 +0200
Subject: [PATCH] fftools/ffprobe: Add S12M Timecode output as side data (such
 as SEI TC)

Slightly modified by Marton Balint to produce valid json as well.

Signed-off-by: Marton Balint 
---
 doc/ffprobe.xsd   | 14 ++
 fftools/ffprobe.c | 18 +-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd
index 3e58da0f46..97dc67def6 100644
--- a/doc/ffprobe.xsd
+++ b/doc/ffprobe.xsd
@@ -147,11 +147,25 @@
 
 
 
+
+
+
+
 
 
 
 
 
+
+
+
+
+
+
+
+
+
+
 
   
   
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index dea489d02e..3becb6330e 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -165,6 +165,8 @@ typedef enum {
 SECTION_ID_FRAME_TAGS,
 SECTION_ID_FRAME_SIDE_DATA_LIST,
 SECTION_ID_FRAME_SIDE_DATA,
+SECTION_ID_FRAME_SIDE_DATA_TIMECODE_LIST,
+SECTION_ID_FRAME_SIDE_DATA_TIMECODE,
 SECTION_ID_FRAME_LOG,
 SECTION_ID_FRAME_LOGS,
 SECTION_ID_LIBRARY_VERSION,
@@ -209,7 +211,9 @@ 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_LIST, -1 } },
+[SECTION_ID_FRAME_SIDE_DATA_TIMECODE_LIST] = { SECTION_ID_FRAME_SIDE_DATA_TIMECODE_LIST, "timecodes", SECTION_FLAG_IS_ARRAY, { 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 +2203,18 @@ 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 == 16) {
+uint32_t *tc = (uint32_t*)sd->data;
+int m = FFMIN(tc[0],3);
+writer_print_section_header(w, SECTION_ID_FRAME_SIDE_DATA_TIMECODE_LIST);
+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);
+}
+writer_print_section_footer(w);
 } else if (sd->type == AV_FRAME_DATA_MASTERING_DISPLAY_METADATA) {
 AVMasteringDisplayMetadata *metadata = (AVMasteringDisplayMetadata *)sd->data;
 
-- 
2.16.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [FFMPEG DEVEL] [PATCH v6] fftools/ffprobe: Add S12M Timecode output as side data (such as SEI TC)

2019-05-24 Thread Antonin Gouzer
---
Add S12M Timecode output with the show_frame option
Multiple timecodes (3) for one frame support
Control side date Size to 16
Correct ffrpobe.xsd to allow multiple timecodes in side_data element
---
 doc/ffprobe.xsd   |  8 
 fftools/ffprobe.c | 14 +-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd
index 3e58da0f46..818e54c2c5 100644
--- a/doc/ffprobe.xsd
+++ b/doc/ffprobe.xsd
@@ -147,11 +147,19 @@
 
 
 
+
+
+
+
 
 
 
 
 
+
+
+
+
 
   
   
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index dea489d02e..6e290d5d88 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 == 
16) {
+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); 
+}  
 } else if (sd->type == AV_FRAME_DATA_MASTERING_DISPLAY_METADATA) {
 AVMasteringDisplayMetadata *metadata = 
(AVMasteringDisplayMetadata *)sd->data;
 
-- 
2.11.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".