On Fri, Sep 19, 2014 at 1:56 AM, Maksym Veremeyenko <ve...@m1stereo.tv>
wrote:

> 18.09.14 19:43, Dan Dennedy написав(ла):
>
>> On Thu, Sep 18, 2014 at 9:27 AM, Maksym Veremeyenko <ve...@m1stereo.tv
>> <mailto:ve...@m1stereo.tv>> wrote:
>>
>>     Hi,
>>
>>     attached patch set metadata 'timecode' from first frame's
>>     meta.attr.timecode.markup property.
>>
>>
>> Compare your patch to the recent commit that removed that feature:
>> https://github.com/mltframework/mlt/commit/022dedf4d4ccc9e1703d7a1c8ad4bd
>> 524ae62987#diff-1bba886ccf70d0171adb4e7842ec3d58L1393
>>
>>  thanks for notices.
>
> my first idea was to call *mlt_consumer_rt_frame* before header writing
> but i decided just move header writing below because if less origin code
> ruins.
>
>
I have not tested that patch, but I think that change is OK to make.


> first, without such kind of early mlt_consumer_rt_frame or delayed
> *avformat_write_header* makes impossible to store real timecode from SDI
> source (vitc).
>
> second, i cant understand where /timing problem/ can start from.
> *consumer_read_ahead_thread* seems had similar also had early
> /mlt_consumer_get_frame( self );/
>
>
It is a timing (or sequence) problem between determining mlt_image_format
and starting the render threads. mlt_image_format must be set before
starting the render threads. Now, we are determining mlt_image_format (if
not set) by the selected pix_fmt, which can now be selected by the codec.
The rendering threads do not start until the first call to
mlt_consumer_rt_frame(). So, calling that function to get a frame was
starting render threads before mlt_image_format was finalized.


> if it unsure where problem could comes from, we can add a property to
> avformat_consumer that allow calling *avformat_write_header* after first
> frame, i.e. make it parametrized
>

I do not think it is necessary. I was just explaining the recent change
that caused you to make a patch. :-)


>
>  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 )
>>
>> Add test that vitc is not empty string.
>>
> i will
>
>
>> +{
>> +mlt_log_debug( MLT_CONSUMER_SERVICE( consumer ), "timecode=[%s]\n", vitc
>> );
>> +
>> +#if LIBAVUTIL_VERSION_INT >= ((51<<16)+(8<<8)+0)
>>
>> I need to check what release version of FFmpeg and Libav this
>> corresponds to. I am very soon going to update the avformat code to
>> address deprecations and to review API usage against ffmpeg.c. In that
>> process, I am going to drop support for versions 0.7 and 0.8.
>>
> it similar to code above that call *av_dict_set*, so i just copied that
> version checking macros.
>

I understand. I am just letting you know this cruft might not be needed,
but I decided to test and apply your patches before the API update.


>
>> +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 );
>> +
>>
>> I think we should check if ';' is in the string and if so, set the
>> drop_frame_timecode flag.
>>
> i will, but i do not understand which part of mltframework will use it...


MLT will not use it, but avcodecs will (mpeg1video and mpeg2video).
Therefore, this flag with the exact name "drop_frame_timecode" should be
set on the av_dict. I do not recall if the DeckLink produces timecode
values with a ';', but I think it does. Even if not, if the application or
user sets a timecode on the producer with a ';' it means drop-frame, and we
should set this flag.

-- 
+-DRD-+
------------------------------------------------------------------------------
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