[FFmpeg-devel] [PATCH] lavfi/fade: Add ability to do video fade based on time

Clément Bœsch ubitux at gmail.com
Fri Apr 19 04:09:50 CEST 2013


On Thu, Apr 18, 2013 at 09:54:25PM -0400, Andy n Deanna wrote:
> On 4/18/2013 7:59 PM, Clément Bœsch wrote:
> >On Tue, Apr 16, 2013 at 10:20:13PM -0400, Andy n Deanna wrote:
> >+    { "start_time",  "Number of seconds of the beginning of the effect.",
> >+                                                    OFFSET(start_time),   AV_OPT_TYPE_DOUBLE, {.dbl = 0.   }, 0, 7*24*60*60,FLAGS },
> >Here and in the following, you can use AV_OPT_TYPE_DURATION.
> AV_OPT_TYPE_DURATION appears to be a UINT64. Is that correct? I need
> a float/double.
> 

The semantic of the your option is definitely a duration, so it's
appropriate to use AV_OPT_TYPE_DURATION. Note that it affects directly the
user interface; typically you can use 01:02:03 form, which is way more
friendly.

You should look at how afade does it, it's similar to what you are doing
(don't forget to git pull, Paul recently changed the fields to
AV_OPT_TYPE_DURATION)

> >>+    { "st",          "Number of seconds of the beginning of the effect.",
> >>+                                                    OFFSET(start_time),   AV_OPT_TYPE_DOUBLE, {.dbl = 0.   }, 0, 7*24*60*60,FLAGS },
> >>+    { "duration",    "Duration of the effect in seconds.",
> >>+                                                    OFFSET(duration),     AV_OPT_TYPE_DOUBLE, {.dbl = 0.   }, 0, 24*60*60,  FLAGS },
> >>+    { "d",            "Duration of the effect in seconds.",
> Just realized that I inserted new options in the middle of existing
> options. Does that break the shortcut?
> 

Yes, you'd better put them at the end. Though, in practice, since the
options are conflicting with each other, it's not that much a problem. But
yeah, better safe than sorry and put them at the end (don't forget to do
the update in the documentation).

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130419/7ed07fa0/attachment.asc>


More information about the ffmpeg-devel mailing list