Hi,

attached patch set metadata 'timecode' from first frame's meta.attr.timecode.markup property.

--
________________________________________
Maksym Veremeyenko


>From 3a7698cd1b64eb6cb751cb1a81a10133b2e49b5f Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <ve...@m1.tv>
Date: Thu, 18 Sep 2014 20:45:30 +0300
Subject: [PATCH 2/3] set metadata 'timecode' from first frame's
 meta.attr.timecode.markup property

---
 src/modules/avformat/consumer_avformat.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/modules/avformat/consumer_avformat.c b/src/modules/avformat/consumer_avformat.c
index 30e74f0..7f0fe98 100644
--- a/src/modules/avformat/consumer_avformat.c
+++ b/src/modules/avformat/consumer_avformat.c
@@ -1580,6 +1580,32 @@ static void *consumer_thread( void *arg )
 			// Write the stream header.
 			if ( !header_written )
 			{
+				// set timecode from first frame if not been set from metadata
+				if( !mlt_properties_get( properties, "meta.attr.timecode.markup" ) )
+				{
+					char *vitc = mlt_properties_get( frame_properties, "meta.attr.vitc.markup" );
+					if ( vitc )
+					{
+						mlt_log_debug( MLT_CONSUMER_SERVICE( consumer ), "timecode=[%s]\n", vitc );
+
+#if LIBAVUTIL_VERSION_INT >= ((51<<16)+(8<<8)+0)
+						av_dict_set
+#else
+						av_metadata_set2
+#endif
+							( &oc->metadata, "timecode", vitc, 0 );
+
+						if ( video_st )
+#if LIBAVUTIL_VERSION_INT >= ((51<<16)+(8<<8)+0)
+							av_dict_set
+#else
+							av_metadata_set2
+#endif
+								( &video_st->metadata, "timecode", vitc, 0 );
+
+					};
+				};
+
 #if LIBAVFORMAT_VERSION_INT >= ((53<<16)+(2<<8)+0)
 				if ( avformat_write_header( oc, NULL ) < 0 )
 #else
-- 
1.7.7.6

------------------------------------------------------------------------------
Slashdot TV.  Video for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to