Re: [FFmpeg-user] v360 filter with h_offset option

2022-01-12 Thread Michael Koch

Am 12.01.2022 um 19:00 schrieb Paul B Mahol:

On Wed, Jan 12, 2022 at 5:00 PM Michael Koch 
wrote:


Hello,

I have a projector with a 180° fisheye lens in a dome. Things are easy
if the lens is at the center of the dome. Any input format can be
transformed to fisheye output with the v360 filter. But things are
getting complicated when the lens isn't at the dome's center. Let's
assume the dome has 1m radius and the lens is shifted 0.5m to the side.
In this case the +60° point from the input image must be mapped to the
center of the output image (because acos(0.5) = 60°) ).
The center of the input image must be mapped to 63.4° in the output
image (because 90° - atan(0.5) = 63.4°).

The v360 filter has h_offset and v_offset options. There isn't much
documentation for these options, so let's just try out what they do.
I'm using the test pattern from Paul Bourke:
http://www.paulbourke.net/dome/testpattern/1200.png

ffmpeg -i 1200.png -vf v360=fisheye:fisheye:h_offset=0.5 -y out.png

The +60° point from the input image is not mapped to the center of the
output image, that's wrong.
The center of the input image is mapped to +60°, that's also wrong.


Next I did try 0.577 (=tan(30°)) as offset:

ffmpeg -i 1200.png -vf v360=fisheye:fisheye:h_offset=0.577 -y out.png

Now the +60° point from the input image is mapped to the center of the
output image, that's good.
The center of the input image is mapped to about 54.5°, that's wrong.


These results leave me with two questions:
-- Obviously the offset options aren't doing what I was hoping for. What
else are they supposed to do?
-- How can a fisheye image be transformed to an off-center fisheye image?


http://paulbourke.net/panorama/sphere2persp/

I got idea from that one, and I believe its correctly implemented.


ok, I didn't test it with perspective output, may be that works 
correctly. But in my case for fisheye it doesn't work. Also I would need 
3 offset parameters, including one for Z axis offset (if the lens is 
below the dome's center). I'll try to figure out the mathematics. But 
it's not so easy.


Michael

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

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


Re: [FFmpeg-user] v360 filter with h_offset option

2022-01-12 Thread Paul B Mahol
On Wed, Jan 12, 2022 at 5:00 PM Michael Koch 
wrote:

> Hello,
>
> I have a projector with a 180° fisheye lens in a dome. Things are easy
> if the lens is at the center of the dome. Any input format can be
> transformed to fisheye output with the v360 filter. But things are
> getting complicated when the lens isn't at the dome's center. Let's
> assume the dome has 1m radius and the lens is shifted 0.5m to the side.
> In this case the +60° point from the input image must be mapped to the
> center of the output image (because acos(0.5) = 60°) ).
> The center of the input image must be mapped to 63.4° in the output
> image (because 90° - atan(0.5) = 63.4°).
>
> The v360 filter has h_offset and v_offset options. There isn't much
> documentation for these options, so let's just try out what they do.
> I'm using the test pattern from Paul Bourke:
> http://www.paulbourke.net/dome/testpattern/1200.png
>
> ffmpeg -i 1200.png -vf v360=fisheye:fisheye:h_offset=0.5 -y out.png
>
> The +60° point from the input image is not mapped to the center of the
> output image, that's wrong.
> The center of the input image is mapped to +60°, that's also wrong.
>
>
> Next I did try 0.577 (=tan(30°)) as offset:
>
> ffmpeg -i 1200.png -vf v360=fisheye:fisheye:h_offset=0.577 -y out.png
>
> Now the +60° point from the input image is mapped to the center of the
> output image, that's good.
> The center of the input image is mapped to about 54.5°, that's wrong.
>
>
> These results leave me with two questions:
> -- Obviously the offset options aren't doing what I was hoping for. What
> else are they supposed to do?
> -- How can a fisheye image be transformed to an off-center fisheye image?
>

http://paulbourke.net/panorama/sphere2persp/

I got idea from that one, and I believe its correctly implemented.


>
> Michael
>
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://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
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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


[FFmpeg-user] v360 filter with h_offset option

2022-01-12 Thread Michael Koch

Hello,

I have a projector with a 180° fisheye lens in a dome. Things are easy 
if the lens is at the center of the dome. Any input format can be 
transformed to fisheye output with the v360 filter. But things are 
getting complicated when the lens isn't at the dome's center. Let's 
assume the dome has 1m radius and the lens is shifted 0.5m to the side.
In this case the +60° point from the input image must be mapped to the 
center of the output image (because acos(0.5) = 60°) ).
The center of the input image must be mapped to 63.4° in the output 
image (because 90° - atan(0.5) = 63.4°).


The v360 filter has h_offset and v_offset options. There isn't much 
documentation for these options, so let's just try out what they do.
I'm using the test pattern from Paul Bourke: 
http://www.paulbourke.net/dome/testpattern/1200.png


ffmpeg -i 1200.png -vf v360=fisheye:fisheye:h_offset=0.5 -y out.png

The +60° point from the input image is not mapped to the center of the 
output image, that's wrong.

The center of the input image is mapped to +60°, that's also wrong.


Next I did try 0.577 (=tan(30°)) as offset:

ffmpeg -i 1200.png -vf v360=fisheye:fisheye:h_offset=0.577 -y out.png

Now the +60° point from the input image is mapped to the center of the 
output image, that's good.

The center of the input image is mapped to about 54.5°, that's wrong.


These results leave me with two questions:
-- Obviously the offset options aren't doing what I was hoping for. What 
else are they supposed to do?

-- How can a fisheye image be transformed to an off-center fisheye image?

Michael

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

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


Re: [FFmpeg-user] V360 filter

2020-01-24 Thread Paul B Mahol
On 1/24/20, Michael Koch  wrote:
> Paul,
>
>> Single-fisheye is done as output only currently, user need to set both
>> h_fov and v_fov.
>
> I'm just testing the new single fisheye options and as far as I have
> tested, everything looks good.
> Would it be possible to add an option for filling the unused area with a
> user-defined color, instead of the default black?

I'm probably gonna add at some point mask option which will fill
unused pixels with max alpha values.
To make stitching possible with multiple flat(or any other projection
format) inputs, this would also make possible to replace all alpha
values with custom picked color by using overlay filter.

>
> Some suggestions for documentation:
> -- "perspective" needs better description what it is. I don't know.

It is similar to one side of globe, like watching earth from space :)

> -- "ball" is the same as when the whole 360° environment is seen as a
> reflection in a mirror ball
>
> Michael
>
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://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
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] V360 filter

2020-01-24 Thread Michael Koch

Paul,

Single-fisheye is done as output only currently, user need to set both 
h_fov and v_fov. 


I'm just testing the new single fisheye options and as far as I have 
tested, everything looks good.
Would it be possible to add an option for filling the unused area with a 
user-defined color, instead of the default black?


Some suggestions for documentation:
-- "perspective" needs better description what it is. I don't know.
-- "ball" is the same as when the whole 360° environment is seen as a 
reflection in a mirror ball


Michael

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

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

Re: [FFmpeg-user] V360 filter

2020-01-17 Thread Paul B Mahol
On 9/20/19, Michael Koch  wrote:
> Paul,
>
>> I'm working on dual fisheye output
>
> I've tested the new "ball" output format and found no problems. It gives
> the same output as my workaround with the remap filter.
>
> The only thing that's still missing is single-fisheye as input and
> output format, with a user-defined field of view.
>

Single-fisheye is done as output only currently, user need to set both
h_fov and v_fov.

> Michael
>
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://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
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] V360 filter

2019-09-20 Thread Michael Koch

Paul,


I'm working on dual fisheye output


I've tested the new "ball" output format and found no problems. It gives 
the same output as my workaround with the remap filter.


The only thing that's still missing is single-fisheye as input and 
output format, with a user-defined field of view.


Michael

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

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

Re: [FFmpeg-user] V360 filter

2019-09-13 Thread Michael Koch

Am 12.09.2019 um 14:55 schrieb Paul B Mahol:



Question:
If the input format is stereographic and the output format is
equirectangular, what's then the meaning of the h_fov and v_fov parameters?
Do they define the field of view of the stereographic input (that would
make sense),
or do they define the field of view of the equirectangular output (that
makes no sense, because equirectangular should always be 360° x 180°).

They are always used only for output when they make sense, for flat
and stereographic currently.


In my opinion stereographic as input format is useless, if the algorithm 
doesn't know the field of view of the input image.


Michael

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

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

Re: [FFmpeg-user] V360 filter

2019-09-13 Thread Michael Koch

Paul,



I'm working on dual fisheye output


I've tested double-fisheye input and output and found no problems. This 
can also be used for tilting of 180° single-fisheye images:


set "IN=IMG_077.jpg" :: Input image or video
set "PITCH=0"    :: Rotation angle around X axis
set "YAW=10" :: Rotation angle around Y axis
set "OUT=out.jpg"    :: Output image or video

ffmpeg -i %IN% -lavfi 
"pad=w=2*iw:color=darkgreen,v360=input=dfisheye:output=dfisheye:yaw=%YAW%:pitch=%PITCH%,crop=w=iw/2:x=0" 
-y %OUT%


Michael

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

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

Re: [FFmpeg-user] V360 filter

2019-09-12 Thread Paul B Mahol
On 9/12/19, Michael Koch  wrote:
> Am 12.09.2019 um 14:05 schrieb Paul B Mahol:
>> On 9/12/19, Michael Koch  wrote:
>>> Paul,
>>>
>> Make this correction:
>>
>> new_fov = 180 * tan(fov/4)
>>
>> where fov the the field of view you get from the command line, and
>> fov_new is the value that you use for the filter.
>> You must exclude values too close to 360°, because 360° stereographic
>> projection is impossible.
>>
> P.S. of course fov must be converted to radians before using tan():
>
> new_fov = 180 * tan(fov * pi / 720)
 Thanks, that cleared some stuff.
 Should be fixed.
>>> Converting from equirectangular to stereographic is working fine now.
>>> Field of view is correct.
>>> But in the other direction from stereographic to equirectangular the
>>> output is wrong.
>>> The output doesn't contain any no-data areas. I mean those areas that
>>> aren't visible in the stereographic input. These areas should be filled
>>> with black (or better a user-defined color).
>> That is not doable by design.
>
> What about fisheye input and output?
> Fisheye (180°) input is almost the same as already implemented as
> dfisheye, and if the second hemisphere doesn't exist it can be replaced
> by a color.
> Fisheye input and output is important. For example I've made a long-time
> timelapse from many fisheye images, but some of the images require a few
> degrees tilting. That means the fisheye image must be converted to
> equirectangular, tilted, and then converted back to fisheye.

I'm working on dual fisheye output

>
>>
>>> Also, the default output size should be width/height=2, but it is
>>> quadratic.
>> output size for what?
>
> The equirectangular output image should have width/height=2 by default.

Will try to fix it.

>
> Question:
> If the input format is stereographic and the output format is
> equirectangular, what's then the meaning of the h_fov and v_fov parameters?
> Do they define the field of view of the stereographic input (that would
> make sense),
> or do they define the field of view of the equirectangular output (that
> makes no sense, because equirectangular should always be 360° x 180°).

They are always used only for output when they make sense, for flat
and stereographic currently.

>
> Michael
>
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://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
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] V360 filter

2019-09-12 Thread Michael Koch

Am 12.09.2019 um 14:05 schrieb Paul B Mahol:

On 9/12/19, Michael Koch  wrote:

Paul,


Make this correction:

new_fov = 180 * tan(fov/4)

where fov the the field of view you get from the command line, and
fov_new is the value that you use for the filter.
You must exclude values too close to 360°, because 360° stereographic
projection is impossible.


P.S. of course fov must be converted to radians before using tan():

new_fov = 180 * tan(fov * pi / 720)

Thanks, that cleared some stuff.
Should be fixed.

Converting from equirectangular to stereographic is working fine now.
Field of view is correct.
But in the other direction from stereographic to equirectangular the
output is wrong.
The output doesn't contain any no-data areas. I mean those areas that
aren't visible in the stereographic input. These areas should be filled
with black (or better a user-defined color).

That is not doable by design.


What about fisheye input and output?
Fisheye (180°) input is almost the same as already implemented as 
dfisheye, and if the second hemisphere doesn't exist it can be replaced 
by a color.
Fisheye input and output is important. For example I've made a long-time 
timelapse from many fisheye images, but some of the images require a few 
degrees tilting. That means the fisheye image must be converted to 
equirectangular, tilted, and then converted back to fisheye.





Also, the default output size should be width/height=2, but it is quadratic.

output size for what?


The equirectangular output image should have width/height=2 by default.

Question:
If the input format is stereographic and the output format is 
equirectangular, what's then the meaning of the h_fov and v_fov parameters?
Do they define the field of view of the stereographic input (that would 
make sense),
or do they define the field of view of the equirectangular output (that 
makes no sense, because equirectangular should always be 360° x 180°).


Michael

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

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

Re: [FFmpeg-user] V360 filter

2019-09-12 Thread Paul B Mahol
On 9/12/19, Michael Koch  wrote:
> Paul,
>
>>
 Make this correction:

 new_fov = 180 * tan(fov/4)

 where fov the the field of view you get from the command line, and
 fov_new is the value that you use for the filter.
 You must exclude values too close to 360°, because 360° stereographic
 projection is impossible.

>>> P.S. of course fov must be converted to radians before using tan():
>>>
>>> new_fov = 180 * tan(fov * pi / 720)
>> Thanks, that cleared some stuff.
>> Should be fixed.
>
> Converting from equirectangular to stereographic is working fine now.
> Field of view is correct.
> But in the other direction from stereographic to equirectangular the
> output is wrong.
> The output doesn't contain any no-data areas. I mean those areas that
> aren't visible in the stereographic input. These areas should be filled
> with black (or better a user-defined color).

That is not doable by design.

> Also, the default output size should be width/height=2, but it is quadratic.

output size for what?

> I tested with these command lines:
>
> ffmpeg -i equirectangular_test.png -lavfi
> "v360=input=e:output=sg:h_fov=300:v_fov=300" -y sg.png
> ffmpeg -i sg.png -lavfi "v360=input=sg:output=e:h_fov=300:v_fov=300" -y
> e.png
>
> Michael
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://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
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] V360 filter

2019-09-12 Thread Michael Koch

Paul,




Make this correction:

new_fov = 180 * tan(fov/4)

where fov the the field of view you get from the command line, and
fov_new is the value that you use for the filter.
You must exclude values too close to 360°, because 360° stereographic
projection is impossible.


P.S. of course fov must be converted to radians before using tan():

new_fov = 180 * tan(fov * pi / 720)

Thanks, that cleared some stuff.
Should be fixed.


Converting from equirectangular to stereographic is working fine now. 
Field of view is correct.
But in the other direction from stereographic to equirectangular the 
output is wrong.
The output doesn't contain any no-data areas. I mean those areas that 
aren't visible in the stereographic input. These areas should be filled 
with black (or better a user-defined color).

Also, the default output size should be width/height=2, but it is quadratic.

I tested with these command lines:

ffmpeg -i equirectangular_test.png -lavfi 
"v360=input=e:output=sg:h_fov=300:v_fov=300" -y sg.png
ffmpeg -i sg.png -lavfi "v360=input=sg:output=e:h_fov=300:v_fov=300" -y 
e.png


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

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

Re: [FFmpeg-user] V360 filter

2019-09-11 Thread Paul B Mahol
On 9/11/19, Michael Koch  wrote:
> Am 11.09.2019 um 14:23 schrieb Michael Koch:
>> Am 11.09.2019 um 13:13 schrieb Michael Koch:
>>> Paul,
>>>
> I think the field of view isn't correct in the stereographic output.
>
> Here is a script for making really nice test images, for measuring
> field
> of view:
 Well spotted, thanks, should be fixed.
>>>
>>> The field of view of the stereographic output isn't correct. Here are
>>> a few examples:
>>> set in command line / measured in output image
>>> 60° / 74°
>>> 120° / 135°
>>> 180° / 180°
>>> 240° / 212°
>>> 300° / 236°
>>> 360° / 274°
>>
>> Make this correction:
>>
>> new_fov = 180 * tan(fov/4)
>>
>> where fov the the field of view you get from the command line, and
>> fov_new is the value that you use for the filter.
>> You must exclude values too close to 360°, because 360° stereographic
>> projection is impossible.
>>
>
> P.S. of course fov must be converted to radians before using tan():
>
> new_fov = 180 * tan(fov * pi / 720)

Thanks, that cleared some stuff.
Should be fixed.

> Michael
>
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://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
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] V360 filter

2019-09-11 Thread Michael Koch

Am 11.09.2019 um 14:23 schrieb Michael Koch:

Am 11.09.2019 um 13:13 schrieb Michael Koch:

Paul,


I think the field of view isn't correct in the stereographic output.

Here is a script for making really nice test images, for measuring 
field

of view:

Well spotted, thanks, should be fixed.


The field of view of the stereographic output isn't correct. Here are 
a few examples:

set in command line / measured in output image
60° / 74°
120° / 135°
180° / 180°
240° / 212°
300° / 236°
360° / 274°


Make this correction:

new_fov = 180 * tan(fov/4)

where fov the the field of view you get from the command line, and 
fov_new is the value that you use for the filter.
You must exclude values too close to 360°, because 360° stereographic 
projection is impossible.




P.S. of course fov must be converted to radians before using tan():

new_fov = 180 * tan(fov * pi / 720)

Michael

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

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

Re: [FFmpeg-user] V360 filter

2019-09-11 Thread Michael Koch

Am 11.09.2019 um 13:13 schrieb Michael Koch:

Paul,


I think the field of view isn't correct in the stereographic output.

Here is a script for making really nice test images, for measuring 
field

of view:

Well spotted, thanks, should be fixed.


The field of view of the stereographic output isn't correct. Here are 
a few examples:

set in command line / measured in output image
60° / 74°
120° / 135°
180° / 180°
240° / 212°
300° / 236°
360° / 274°


Make this correction:

new_fov = 180 * tan(fov/4)

where fov the the field of view you get from the command line, and 
fov_new is the value that you use for the filter.
You must exclude values too close to 360°, because 360° stereographic 
projection is impossible.


Michael

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

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

Re: [FFmpeg-user] V360 filter

2019-09-11 Thread Michael Koch

Paul,


I think the field of view isn't correct in the stereographic output.

Here is a script for making really nice test images, for measuring field
of view:

Well spotted, thanks, should be fixed.


The field of view of the stereographic output isn't correct. Here are a 
few examples:

set in command line / measured in output image
60° / 74°
120° / 135°
180° / 180°
240° / 212°
300° / 236°
360° / 274°

Vertical field of view is limited to 180°, which makes "little planet" 
impossible..


Michael

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

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

Re: [FFmpeg-user] V360 filter

2019-09-10 Thread Paul B Mahol
On 9/10/19, Michael Koch  wrote:
> Paul,
>
>>
>>> v_fov is limited to 90°, that's not enough for little planet.
>> I increased it.
>
> ok, I will test it as soon as it's available at Zeranoe.
>
> I think the field of view isn't correct in the stereographic output.
>
> Here is a script for making really nice test images, for measuring field
> of view:

Well spotted, thanks, should be fixed.

>
>
> set "IN=1200.png"   :: Test pattern from
> http://www.paulbourke.net/dome/testpattern/1200.png
> set "OUT=double_fisheye_test.png"   :: Double fisheye test image
>
> ffmpeg -i %IN% -i %IN% -lavfi
> "[0]transpose=1[left];[1]transpose=2,geq=r='255-r(X,Y)':g='255-g(X,Y)':b='255-b(X,Y)'[right];[left][right]hstack"
> -y %OUT%
>
> set "IN=double_fisheye_test.png"
> set "OUT=equirectangular_test.png"  :: Equirectangular test image
>
> ffmpeg -i %IN% -lavfi "v360=input=dfisheye:output=e:pitch=90" -y %OUT%
>
> Michael
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://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
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] V360 filter

2019-09-10 Thread Michael Koch



ffmpeg -i %IN% -i %IN% -lavfi
"[0]transpose=1[left];[1]transpose=2,geq=r='255-r(X,Y)':g='255-g(X,Y)':b='255-b(X,Y)'[right];[left][right]hstack"
-y %OUT%

Cant you use here negate filter instead of geq?


oops, yes that would be better. I did search for "invert" and didn't 
find it...


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

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

Re: [FFmpeg-user] V360 filter

2019-09-10 Thread Paul B Mahol
On 9/10/19, Michael Koch  wrote:
> Paul,
>
>>
>>> v_fov is limited to 90°, that's not enough for little planet.
>> I increased it.
>
> ok, I will test it as soon as it's available at Zeranoe.
>
> I think the field of view isn't correct in the stereographic output.
>
> Here is a script for making really nice test images, for measuring field
> of view:
>
>
> set "IN=1200.png"   :: Test pattern from
> http://www.paulbourke.net/dome/testpattern/1200.png
> set "OUT=double_fisheye_test.png"   :: Double fisheye test image
>
> ffmpeg -i %IN% -i %IN% -lavfi
> "[0]transpose=1[left];[1]transpose=2,geq=r='255-r(X,Y)':g='255-g(X,Y)':b='255-b(X,Y)'[right];[left][right]hstack"
> -y %OUT%

Cant you use here negate filter instead of geq?

>
> set "IN=double_fisheye_test.png"
> set "OUT=equirectangular_test.png"  :: Equirectangular test image
>
> ffmpeg -i %IN% -lavfi "v360=input=dfisheye:output=e:pitch=90" -y %OUT%
>
> Michael
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://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
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] V360 filter

2019-09-10 Thread Michael Koch

Paul,




v_fov is limited to 90°, that's not enough for little planet.

I increased it.


ok, I will test it as soon as it's available at Zeranoe.

I think the field of view isn't correct in the stereographic output.

Here is a script for making really nice test images, for measuring field 
of view:



set "IN=1200.png"   :: Test pattern from 
http://www.paulbourke.net/dome/testpattern/1200.png

set "OUT=double_fisheye_test.png"   :: Double fisheye test image

ffmpeg -i %IN% -i %IN% -lavfi 
"[0]transpose=1[left];[1]transpose=2,geq=r='255-r(X,Y)':g='255-g(X,Y)':b='255-b(X,Y)'[right];[left][right]hstack" 
-y %OUT%


set "IN=double_fisheye_test.png"
set "OUT=equirectangular_test.png"  :: Equirectangular test image

ffmpeg -i %IN% -lavfi "v360=input=dfisheye:output=e:pitch=90" -y %OUT%

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

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

Re: [FFmpeg-user] V360 filter

2019-09-10 Thread Paul B Mahol
On 9/10/19, Michael Koch  wrote:
> Paul,
>
>> Stereographic projection aka little planet added as both input and output.
>> Single fisheye is little different.
>
> v_fov is limited to 90°, that's not enough for little planet.

I increased it.

>
>>
>>> -- I think the d_flip parameter needs some more documentation. What's an
>>> "in-depth" flip?
>> It swaps back with front.
>
> Please add it to the documentation, "in-depth" flip isn't self-explaining.
>
>
> I have a workaround for converting an equirectangular video to a little
> planet video, but I use a fisheye projection (vertical coordinate in
> equirectangular image is proportional to distance from image center in
> little planet image):
>
> set "IN=test3.mp4"  :: Equirectangular input video
> set "H=960"   :: Height of input video (width = 2 * height)
> set "S=1080":: Size of quadratic little planet output video
> set "OUT=out.mp4"   :: Output video
>
> rem Create the xmap file
> ffmpeg -f lavfi -i nullsrc=size=%S%x%S% -vf format=pix_fmts=gray16le,^
> geq='%H%*(0.+atan2(Y-%S%/2,X-%S%/2)/PI)' -frames 1 -y xmap.pgm
>
> rem Create the ymap file
> ffmpeg -f lavfi -i nullsrc=size=%S%x%S% -vf format=pix_fmts=gray16le,^
> geq='%H%*(1-hypot((2*X/%S%)-1,(2*Y/%S%)-1))' -frames 1 -y ymap.pgm
>
> rem Apply the remap filter to the video
> ffmpeg -i %IN% -i xmap.pgm -i ymap.pgm -lavfi
> "format=pix_fmts=rgb24,remap" -y %OUT%
>

You sure that is little planet projection?

It is not, it is 360 deg fisheye.

>
> Michael
>
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://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
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] V360 filter

2019-09-10 Thread Michael Koch

Paul,


Stereographic projection aka little planet added as both input and output.
Single fisheye is little different.


v_fov is limited to 90°, that's not enough for little planet.




-- I think the d_flip parameter needs some more documentation. What's an
"in-depth" flip?

It swaps back with front.


Please add it to the documentation, "in-depth" flip isn't self-explaining.


I have a workaround for converting an equirectangular video to a little 
planet video, but I use a fisheye projection (vertical coordinate in 
equirectangular image is proportional to distance from image center in 
little planet image):


set "IN=test3.mp4"          :: Equirectangular input video
set "H=960"               :: Height of input video (width = 2 * height)
set "S=1080"                :: Size of quadratic little planet output video
set "OUT=out.mp4"           :: Output video

rem Create the xmap file
ffmpeg -f lavfi -i nullsrc=size=%S%x%S% -vf format=pix_fmts=gray16le,^
geq='%H%*(0.+atan2(Y-%S%/2,X-%S%/2)/PI)' -frames 1 -y xmap.pgm

rem Create the ymap file
ffmpeg -f lavfi -i nullsrc=size=%S%x%S% -vf format=pix_fmts=gray16le,^
geq='%H%*(1-hypot((2*X/%S%)-1,(2*Y/%S%)-1))' -frames 1 -y ymap.pgm

rem Apply the remap filter to the video
ffmpeg -i %IN% -i xmap.pgm -i ymap.pgm -lavfi 
"format=pix_fmts=rgb24,remap" -y %OUT%



Michael

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

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

Re: [FFmpeg-user] V360 filter

2019-09-10 Thread Paul B Mahol
On 9/6/19, Michael Koch  wrote:
> Hi all,
>
> I see the progress on the V360 filter... that's very good!
> A few suggestions for improvement:
> -- (Single-)Fisheye as input and output format, with a selectable field
> of view up to 360° (little planet).

Stereographic projection aka little planet added as both input and output.
Single fisheye is little different.

> -- A "color" option for filling those areas that have got no data from
> the input.
> -- I think the d_flip parameter needs some more documentation. What's an
> "in-depth" flip?

It swaps back with front.

>
> Michael
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://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
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] V360 filter

2019-09-10 Thread Michael Koch

Am 06.09.2019 um 15:14 schrieb Michael Koch:

Hi all,

I see the progress on the V360 filter... that's very good!
A few suggestions for improvement:
-- (Single-)Fisheye as input and output format, with a selectable 
field of view up to 360° (little planet).
-- A "color" option for filling those areas that have got no data from 
the input.
-- I think the d_flip parameter needs some more documentation. What's 
an "in-depth" flip?


Workaround for converting a quadratic single-fisheye video (camera 
pointing to the sky) to an equirectangular video:


ffmpeg -i in.mp4 -lavfi 
"pad=w=2*iw:color=darkgreen,v360=input=dfisheye:output=e:pitch=90" -y 
out.mp4


Michael

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

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

[FFmpeg-user] V360 filter

2019-09-06 Thread Michael Koch

Hi all,

I see the progress on the V360 filter... that's very good!
A few suggestions for improvement:
-- (Single-)Fisheye as input and output format, with a selectable field 
of view up to 360° (little planet).
-- A "color" option for filling those areas that have got no data from 
the input.
-- I think the d_flip parameter needs some more documentation. What's an 
"in-depth" flip?


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

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