[FFmpeg-devel] Fwd: Fwd: libavformat/segment : add option to increment timecode

Martin Vignali martin.vignali at gmail.com
Sun Feb 28 21:41:32 CET 2016


2016-02-23 20:08 GMT+01:00 Martin Vignali <martin.vignali at gmail.com>:

>
>
> 2016-02-23 19:41 GMT+01:00 Stefano Sabatini <stefasab at gmail.com>:
>
>> On date Friday 2016-02-19 14:04:12 +0100, Martin Vignali encoded:
>> > 2016-02-15 2:35 GMT+01:00 Stefano Sabatini <stefasab at gmail.com>:
>> [...]
>> > > > +                    err = av_timecode_init_from_string(&tc, rate,
>> > > tcr->value, s);
>> > > > +                    if (err < 0) {
>> > > > +                        av_log(s, AV_LOG_WARNING, "Could not
>> increment
>> > > timecode, error occured during timecode creation.");
>> > > > +                        break;
>> > > > +                    }
>> > >
>> > > > +                    tc.start += (int)
>> > > av_q2d(av_mul_q(av_make_q(seg->time, 1000000 ), rate));/* increment
>> > > timecode */
>> > >
>> > > nit: 1000000_) => 1000000)
>> > >
>> > > Also, reading from the timecode.c code it looks like the increment
>> > > must be expressed in fps units.
>> > >
>> >
>> > Sorry don't understand what's wrong now. In my tests, the timecode
>> > incrementation is correct (but maybe i missed a special case)
>>
>> Not necessarily a problem, assuming the fps is consistent with the
>> rate.
>>
>
> Ok, so i think there is no problem, because timecode is created with the
> rate (av_timecode_init_from_string set the fps from rate.),
> and the increment is made with the rate.
> Both values are consistent.
>
>
>
>>
>> > > Finally, you are using the segment->time, which is different from the
>> > > effective segment duration. Could you set the metadata in segment_end,
>> > > where the exact duration is known?
>> > >
>> >
>> > Do you know how can i get the exact segment duration ?
>>
>> What about setting the metadata when you're *closing* the segment
>> (e.g. in segment_end())?
>>
>> This way you can know the exact duration.
>> --
>>
>>
> Ok for that, but in fact my question is more about the way to have a more
> precise duration than segment->time.
>
> Thanks,
>
> Martin
>
>

Hello,

New patch attached, with the timecode incrementation inside segment_end()
Use this time start_time and end_time (from SegmentListEntry) to calculate
the duration of the segment.


Best regards

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavf-segment-add-increment-timecode-option.patch
Type: text/x-patch
Size: 4802 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160228/c930a3aa/attachment.bin>


More information about the ffmpeg-devel mailing list