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
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
On 9/6/19, Michael Koch <astroelectronic@t-online.de> 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-request@ffmpeg.org with subject "unsubscribe".
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.9999+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
On 9/10/19, Michael Koch <astroelectronic@t-online.de> 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.9999+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-request@ffmpeg.org with subject "unsubscribe".
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
On 9/10/19, Michael Koch <astroelectronic@t-online.de> 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-request@ffmpeg.org with subject "unsubscribe".
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
On 9/10/19, Michael Koch <astroelectronic@t-online.de> 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-request@ffmpeg.org with subject "unsubscribe".
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
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
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
On 9/11/19, Michael Koch <astroelectronic@t-online.de> 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-request@ffmpeg.org with subject "unsubscribe".
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
On 9/12/19, Michael Koch <astroelectronic@t-online.de> 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-request@ffmpeg.org with subject "unsubscribe".
Am 12.09.2019 um 14:05 schrieb Paul B Mahol:
On 9/12/19, Michael Koch <astroelectronic@t-online.de> 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
On 9/12/19, Michael Koch <astroelectronic@t-online.de> wrote:
Am 12.09.2019 um 14:05 schrieb Paul B Mahol:
On 9/12/19, Michael Koch <astroelectronic@t-online.de> 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-request@ffmpeg.org with subject "unsubscribe".
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
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
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
On 9/20/19, Michael Koch <astroelectronic@t-online.de> 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-request@ffmpeg.org with subject "unsubscribe".
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
On 1/24/20, Michael Koch <astroelectronic@t-online.de> 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-request@ffmpeg.org with subject "unsubscribe".
participants (2)
-
Michael Koch -
Paul B Mahol