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

Antonin Gouzer antonin.gouzer at gmail.com
Sun May 19 02:11:31 EEST 2019


---
Add the index of the timecode in case of multiple timecodes values
Limit to 3 the number of timecodes
remove break
Thanks you !
---
 fftools/ffprobe.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index dea489d02e..b43349f746 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -2199,6 +2199,20 @@ 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) {
+                uint32_t *tc = (uint32_t*)sd->data;
+                for (int j = 1; j <= FFMIN(tc[0],3); j++) {
+                    char tcbuf[AV_TIMECODE_STR_SIZE];
+                    av_timecode_make_smpte_tc_string(tcbuf, tc[j], 0);
+                    if (j > 1){
+                        writer_print_section_header(w, SECTION_ID_FRAME_SIDE_DATA);
+                        print_str("side_data_type", name ? name : "unknown");
+                    }
+                    print_str("timecode", tcbuf);
+                    print_int("id",j);
+                    if (j < tc[0])
+                        writer_print_section_footer(w);
+                }          
             } else if (sd->type == AV_FRAME_DATA_MASTERING_DISPLAY_METADATA) {
                 AVMasteringDisplayMetadata *metadata = (AVMasteringDisplayMetadata *)sd->data;
 
-- 
2.11.0



More information about the ffmpeg-devel mailing list