]> git.sesse.net Git - mlt/commitdiff
Add video_delay to avformat producer.
authorDan Dennedy <dan@dennedy.org>
Tue, 14 Jun 2011 06:07:26 +0000 (23:07 -0700)
committerDan Dennedy <dan@dennedy.org>
Tue, 14 Jun 2011 06:07:26 +0000 (23:07 -0700)
src/modules/avformat/producer_avformat.c
src/modules/avformat/producer_avformat.yml

index 306a0bd096ff7a9f2fd3c8cc34099726deff4327..e366af97c938bb2e7ec1f26c882e8afa102f2703 100644 (file)
@@ -1432,7 +1432,8 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
                                {
                                        if ( pkt.dts != AV_NOPTS_VALUE )
                                        {
-                                               int_position = ( int )( av_q2d( stream->time_base ) * pkt.dts * source_fps + 0.5 );
+                                               double delay = mlt_properties_get_double( properties, "video_delay" );
+                                               int_position = ( int )( ( av_q2d( stream->time_base ) * pkt.dts + delay ) * source_fps + 0.5 );
                                                if ( context->start_time != AV_NOPTS_VALUE )
                                                        int_position -= ( int )( context->start_time * source_fps / AV_TIME_BASE + 0.5 );
                                                if ( int_position == self->last_position )
index b5f788d2275a10d14c96d45d8386d360848638ac..df28a6f07f8e5ebfe11b4ad41b2c192cdf54e736 100644 (file)
@@ -200,3 +200,13 @@ parameters:
       - 240 # SMPTE 240M
       - 601 # ITU-R BT.601
       - 709 # ITU-R BT.709
+
+  - identifier: video_delay
+    title: Video delay
+    description: >
+      Manually adjust A/V synchronization.
+      A negative value advances the video instead of delaying it.
+    type: float
+    default: 0
+    unit: seconds
+    widget: timecode