Re: [FFmpeg-user] filters zoompan and crop

2018-11-01 Thread Jim DeLaHunt

On 2018-11-01 15:02, S Andreason wrote:

Jim DeLaHunt wrote:

.
I want to generate an overlay to zoom in, have the input png start 
small, and grow to half the video size, like from 20 to 320 in 
width. Starting the zoompan at z=0.1 does not seem to work.
Take a look at the *pad* filter 
. That generates an output 
frame which consists of an input frame with padding around it.
I suppose that could work, if it would accept the frame number as a 
variable, so that the x,y,w,h could change over time, and allow the 
padding color to be transparent.


So, I still see no filters to start small, without disturbing the rest 
of the frame, and have it grow over time to full size, replacing the 
video on the lower layer.
I see the problem. The *pad* filter doesn't let you use the frame number 
/n/ as a parameter for expressions defining /width/, /height/, /x/, and 
/y/. In contrast, the *zoompan* filter does give you both an input frame 
number and output frame number to use in expressions. I have used 
*zoompan* to animate a video by writing ridiculously complex expressions 
for /x/ and /y/ and /zoom/ based on frame number.

You have confirmed zoompan won't shrink less than 1.0 in size factor.
For example zoom value of 0.1 should enlarge the input stream x10 and 
with x and y I could select where in the stream[0] to place the 
(growing/shrinking) stream[1].


I have the impression that *zoompan* was designed with one use in mind, 
panning over a large still image, and so they missed the chance to make 
a more flexible and useful tool. I would love it if someone would make 
an "animate" filter, which could do arbitrary affine coordinate 
transforms on frames of an incoming video, based on a set of key frames, 
with bézier interpolation between the keyframes.


That tool would sure serve my needs better. Maybe it would serve yours 
also. Should we raise money for a bounty to write it?



Also if the first filter was successful, I need to crop it so that 
it grows over time. I am having trouble getting crop to adjust based 
on the frame number. From my testing it seems n in this case starts 
at 0 when the enable between starts, instead of the output video 
frame number like the other filters I have been using.

I'm not sure I follow what you mean by "when the enable between starts".

Sorry, I'll re-word it;
when the "enable='between(t,#,#)'" begins
I was experiencing something more than just 0 to 2 frames offset. I'll 
work up another example once I have a moment to re-create it.


Thank you. That phrase is much clearer when accompanied by punctuation. 
Sorry, I've never used the /enable/ parameter, so I don't know what 
effect it has on other parameters.


Best regards,
  —Jim DeLaHunt, software engineer, Vancouver, Canada


___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


--
--Jim DeLaHunt, j...@jdlh.com http://blog.jdlh.com/ (http://jdlh.com/)
  multilingual websites consultant

  355-1027 Davie St, Vancouver BC V6E 4L2, Canada
 Canada mobile +1-604-376-8953

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] filters zoompan and crop

2018-11-01 Thread S Andreason

Jim DeLaHunt wrote:

.
I want to generate an overlay to zoom in, have the input png start 
small, and grow to half the video size, like from 20 to 320 in width. 
Starting the zoompan at z=0.1 does not seem to work.
Take a look at the *pad* filter 
. That generates an output 
frame which consists of an input frame with padding around it.
I suppose that could work, if it would accept the frame number as a 
variable, so that the x,y,w,h could change over time, and allow the 
padding color to be transparent.


So, I still see no filters to start small, without disturbing the rest 
of the frame, and have it grow over time to full size, replacing the 
video on the lower layer.

You have confirmed zoompan won't shrink less than 1.0 in size factor.
For example zoom value of 0.1 should enlarge the input stream x10 and 
with x and y I could select where in the stream[0] to place the 
(growing/shrinking) stream[1].



Also if the first filter was successful, I need to crop it so that it 
grows over time. I am having trouble getting crop to adjust based on 
the frame number. From my testing it seems n in this case starts at 0 
when the enable between starts, instead of the output video frame 
number like the other filters I have been using.

I'm not sure I follow what you mean by "when the enable between starts".

Sorry, I'll re-word it;
when the "enable='between(t,#,#)'" begins
I was experiencing something more than just 0 to 2 frames offset. I'll 
work up another example once I have a moment to re-create it.


Stewart

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] filters zoompan and crop

2018-10-29 Thread Jim DeLaHunt

On 2018-10-29 01:38, Paul B Mahol wrote:

On 10/29/18, Jim DeLaHunt  wrote:
My experience with the *zoompan* filter is that the /in/ parameter 
(input frame number) is 2 for the first frame, rather than 0 as is 
usual for ffmpeg. I think that this is partly a bug (see 
). Partly this appears to be a 
design decision by the original developer, to use cardinal numbers 
instead of ordinal numbers. 

That bug have long be fixed in master branch. I just closed it.


Yay! That's great to hear!  I see it was fixed in June 2018.

I'm glad the bug report is now marked as closed also. That should help 
spread the word about the fix.


I am in favour of the documentation changing to better describe the 
current behaviour. I may submit a patch if no-one beats me to it.


--
--Jim DeLaHunt, j...@jdlh.com http://blog.jdlh.com/ (http://jdlh.com/)
  multilingual websites consultant

  355-1027 Davie St, Vancouver BC V6E 4L2, Canada
 Canada mobile +1-604-376-8953

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] filters zoompan and crop

2018-10-29 Thread Jim DeLaHunt

On 2018-10-28 23:15, Gyan wrote:


On Mon, Oct 29, 2018 at 11:38 AM Jim DeLaHunt 
wrote:


   A zoom
argument of /k/ is interpreted as if the input image was drawn /k /times
its original size, or equivalently, that the output image is 1//k/ the
size of the input image.


That should be k^2. A zoom value of 2 crops a window of one-half width and
height, so one-fourth area.

Agreed. By "size" I meant linear dimension, not area or pixel count.

So I think Gyan and I are both saying, interpret the "zoom" argument in 
terms of linear dimension, which means the resulting pixel count or area 
changes in terms of 1 divided by the square of the "zoom" argument.


--
--Jim DeLaHunt, j...@jdlh.com http://blog.jdlh.com/ (http://jdlh.com/)
  multilingual websites consultant

  355-1027 Davie St, Vancouver BC V6E 4L2, Canada
 Canada mobile +1-604-376-8953

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] filters zoompan and crop

2018-10-29 Thread Paul B Mahol
On 10/29/18, Jim DeLaHunt  wrote:
> On 2018-10-26 11:57, S Andreason wrote:
>> Hi,
>>
>> Does zoompan not work outside the range 1 .. 8?
>>
> Nearly correct. The zoompan filter accepts values for the zoom parameter
> between 1 and 10. Any values below 1.0 are set to 1; any values greater
> than 10.0 are set to 10.
>
> Also, it's helpful to be very clear about the conceptual model the
> zoompan filter uses. The filter starts with an input image (or frame of
> an input video). It sets up a coordinate system based on this image:
> origin at top-left, with +x to the right and +y downwards.  A zoom
> argument of /k/ is interpreted as if the input image was drawn /k /times
> its original size, or equivalently, that the output image is 1//k/ the
> size of the input image. The x and y arguments to the zoompan filter are
> interpreted in this coordinate system, but clipped so that the output
> image (after zoom adjustment) will stay completely within the input image.
>
> The core motivation for the filter seems to be implementing what some
> call the "Ken Burns effect", making a video image which pans over an
> input image, and zooms in to only show part of the image at a time. It
> is not well-suited to general transformations, given its limitations on
> zoom level, its refusal to pan beyond the boundary of the input image,
> and the absence of a rotation capability or generalised affine
> coordinate transformations.
>
>> I want to generate an overlay to zoom in, have the input png start
>> small, and grow to half the video size, like from 20 to 320 in width.
>> Starting the zoompan at z=0.1 does not seem to work.
> Take a look at the *pad* filter .
> That generates an output frame which consists of an input frame with
> padding around it.
>> Also if the first filter was successful, I need to crop it so that it
>> grows over time. I am having trouble getting crop to adjust based on
>> the frame number. From my testing it seems n in this case starts at 0
>> when the enable between starts, instead of the output video frame
>> number like the other filters I have been using.
> I'm not sure I follow what you mean by "when the enable between starts".
> My experience with the *zoompan* filter is that the /in/ parameter
> (input frame number) is 2 for the first frame, rather than 0 as is usual
> for ffmpeg. I think that this is partly a bug (see
> ). Partly this appears to be a
> design decision by the original developer, to use cardinal numbers
> instead of ordinal numbers.

That bug have long be fixed in master branch. I just closed it.

>> Is there a manual or wiki with more information then at
>> https://ffmpeg.org/ffmpeg-filters.html ?
> If you want to do serious work with the zoompan filter, my experience is
> that the documentation isn't adequate, and you need to read the source
> code in ffmpeg/libavfilter/vf_zoompan.c, lines 153-250, function
> output_single_frame().
>> Thank you
>>
> I hope this is helpful for you.
>—Jim DeLaHunt, Vancouver, Canada
>
> --
>  --Jim DeLaHunt, j...@jdlh.com http://blog.jdlh.com/
> (http://jdlh.com/)
>multilingual websites consultant
>
>355-1027 Davie St, Vancouver BC V6E 4L2, Canada
>   Canada mobile +1-604-376-8953
>
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] filters zoompan and crop

2018-10-29 Thread Gyan
On Mon, Oct 29, 2018 at 11:38 AM Jim DeLaHunt 
wrote:

>
>   A zoom
> argument of /k/ is interpreted as if the input image was drawn /k /times
> its original size, or equivalently, that the output image is 1//k/ the
> size of the input image.
>

That should be k^2. A zoom value of 2 crops a window of one-half width and
height, so one-fourth area.

Gyan
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] filters zoompan and crop

2018-10-29 Thread Jim DeLaHunt

On 2018-10-26 11:57, S Andreason wrote:

Hi,

Does zoompan not work outside the range 1 .. 8?

Nearly correct. The zoompan filter accepts values for the zoom parameter 
between 1 and 10. Any values below 1.0 are set to 1; any values greater 
than 10.0 are set to 10.


Also, it's helpful to be very clear about the conceptual model the 
zoompan filter uses. The filter starts with an input image (or frame of 
an input video). It sets up a coordinate system based on this image: 
origin at top-left, with +x to the right and +y downwards.  A zoom 
argument of /k/ is interpreted as if the input image was drawn /k /times 
its original size, or equivalently, that the output image is 1//k/ the 
size of the input image. The x and y arguments to the zoompan filter are 
interpreted in this coordinate system, but clipped so that the output 
image (after zoom adjustment) will stay completely within the input image.


The core motivation for the filter seems to be implementing what some 
call the "Ken Burns effect", making a video image which pans over an 
input image, and zooms in to only show part of the image at a time. It 
is not well-suited to general transformations, given its limitations on 
zoom level, its refusal to pan beyond the boundary of the input image, 
and the absence of a rotation capability or generalised affine 
coordinate transformations.


I want to generate an overlay to zoom in, have the input png start 
small, and grow to half the video size, like from 20 to 320 in width. 
Starting the zoompan at z=0.1 does not seem to work.
Take a look at the *pad* filter . 
That generates an output frame which consists of an input frame with 
padding around it.
Also if the first filter was successful, I need to crop it so that it 
grows over time. I am having trouble getting crop to adjust based on 
the frame number. From my testing it seems n in this case starts at 0 
when the enable between starts, instead of the output video frame 
number like the other filters I have been using.
I'm not sure I follow what you mean by "when the enable between starts". 
My experience with the *zoompan* filter is that the /in/ parameter 
(input frame number) is 2 for the first frame, rather than 0 as is usual 
for ffmpeg. I think that this is partly a bug (see 
). Partly this appears to be a 
design decision by the original developer, to use cardinal numbers 
instead of ordinal numbers.

Is there a manual or wiki with more information then at
https://ffmpeg.org/ffmpeg-filters.html ?
If you want to do serious work with the zoompan filter, my experience is 
that the documentation isn't adequate, and you need to read the source 
code in ffmpeg/libavfilter/vf_zoompan.c, lines 153-250, function 
output_single_frame().

Thank you


I hope this is helpful for you.
  —Jim DeLaHunt, Vancouver, Canada

--
--Jim DeLaHunt, j...@jdlh.com http://blog.jdlh.com/ (http://jdlh.com/)
  multilingual websites consultant

  355-1027 Davie St, Vancouver BC V6E 4L2, Canada
 Canada mobile +1-604-376-8953

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".