Re: [FFmpeg-user] v360 filter output eac resolution
Am 12.07.2024 um 03:56 schrieb Jimmie: What confuses me is that the EAC texture has a resolution of 3000x1688. To my understanding, EAC is just a special case of cubemap, which should consist of six square faces. Apparently, that is not the case for this output. Can anyone help me understand why the output EAC texture does not have square faces as in regular cubemaps? Thank you! you can overwrite the default output size with the w and h options: v360=e:eac:w=3000:h=2000 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 output eac resolution
On Fri, Jul 12, 2024 at 4:04 AM Jimmie wrote: > Hi, > > I'm currently working on a project about Equi-Angular Cubemap (EAC). > > I need to sample an EAC texture but couldn't find one readily available. > After some googling, I found that FFmpeg could be used to convert > other 360 pictures to EAC, so I gave it a try. > > The input is an equirectangular texture with 3000x1500 resolution and > the output is an EAC texture with a standard 3x2 format, as expected. > > What confuses me is that the EAC texture has a resolution of 3000x1688. > To my understanding, EAC is just a special case of cubemap, which should > consist of six square faces. Apparently, that is not the case for this > output. > > Can anyone help me understand why the output EAC texture does not have > square faces as in regular cubemaps? Thank you! > https://paulbourke.net/panorama/youtubeformat/ > > Alex > > Command: ffmpeg -i pond.jpg -vf v360=e:eac eac.png > The log is as below. > > ffmpeg version 7.0.1-essentials_build-www.gyan.dev Copyright (c) > 2000-2024 the FFmpeg developers > built with gcc 13.2.0 (Rev5, Built by MSYS2 project) > configuration: --enable-gpl --enable-version3 --enable-static > --disable-w32threads --disable-autodetect --enable-fontconfig > --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp > --enable-bzlib --enable-lzma --enable-zlib --enable-libsrt > --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 > --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid > --enable-libaom --enable-libopenjpeg --enable-libvpx > --enable-mediafoundation --enable-libass --enable-libfreetype > --enable-libfribidi --enable-libharfbuzz --enable-libvidstab > --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm > --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va > --enable-ffnvcodec --enable-libvpl --enable-nvdec --enable-nvenc > --enable-vaapi --enable-libgme --enable-libopenmpt > --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora > --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb > --enable-libopus --enable-libspeex --enable-libvorbis > --enable-librubberband > libavutil 59. 8.100 / 59. 8.100 > libavcodec 61. 3.100 / 61. 3.100 > libavformat61. 1.100 / 61. 1.100 > libavdevice61. 1.100 / 61. 1.100 > libavfilter10. 1.100 / 10. 1.100 > libswscale 8. 1.100 / 8. 1.100 > libswresample 5. 1.100 / 5. 1.100 > libpostproc58. 1.100 / 58. 1.100 > Input #0, image2, from 'pond.jpg': > Duration: 00:00:00.04, start: 0.00, bitrate: 154676 kb/s > Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, > bt470bg/unknown/unknown), 3000x1500 [SAR 240:240 DAR 2:1], 25 fps, 25 > tbr, 25 tbn > Stream mapping: > Stream #0:0 -> #0:0 (mjpeg (native) -> png (native)) > Press [q] to stop, [?] for help > [swscaler @ 02ad6cac5540] deprecated pixel format used, make sure > you did set range correctly > Last message repeated 3 times > Output #0, image2, to 'eac.png': > Metadata: > encoder : Lavf61.1.100 > Stream #0:0: Video: png, rgb24(pc, gbr/unknown/unknown, > progressive), 3000x1688 [SAR 1:1 DAR 375:211], q=2-31, 200 kb/s, 25 > fps, 25 tbn > Metadata: > encoder : Lavc61.3.100 png > [image2 @ 02ad6cc35fc0] The specified filename 'eac.png' does not > contain an image sequence pattern or a pattern is invalid. > [image2 @ 02ad6cc35fc0] Use a pattern such as %03d for an image > sequence or use the -update option (with -frames:v 1 if needed) to > write a single image. > [out#0/image2 @ 02ad6c9e0040] video:9207KiB audio:0KiB > subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: > unknown > frame=1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A > speed=0.0467x > ___ > 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 output eac resolution
Hi, I'm currently working on a project about Equi-Angular Cubemap (EAC). I need to sample an EAC texture but couldn't find one readily available. After some googling, I found that FFmpeg could be used to convert other 360 pictures to EAC, so I gave it a try. The input is an equirectangular texture with 3000x1500 resolution and the output is an EAC texture with a standard 3x2 format, as expected. What confuses me is that the EAC texture has a resolution of 3000x1688. To my understanding, EAC is just a special case of cubemap, which should consist of six square faces. Apparently, that is not the case for this output. Can anyone help me understand why the output EAC texture does not have square faces as in regular cubemaps? Thank you! Alex Command: ffmpeg -i pond.jpg -vf v360=e:eac eac.png The log is as below. ffmpeg version 7.0.1-essentials_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers built with gcc 13.2.0 (Rev5, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va --enable-ffnvcodec --enable-libvpl --enable-nvdec --enable-nvenc --enable-vaapi --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband libavutil 59. 8.100 / 59. 8.100 libavcodec 61. 3.100 / 61. 3.100 libavformat61. 1.100 / 61. 1.100 libavdevice61. 1.100 / 61. 1.100 libavfilter10. 1.100 / 10. 1.100 libswscale 8. 1.100 / 8. 1.100 libswresample 5. 1.100 / 5. 1.100 libpostproc58. 1.100 / 58. 1.100 Input #0, image2, from 'pond.jpg': Duration: 00:00:00.04, start: 0.00, bitrate: 154676 kb/s Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 3000x1500 [SAR 240:240 DAR 2:1], 25 fps, 25 tbr, 25 tbn Stream mapping: Stream #0:0 -> #0:0 (mjpeg (native) -> png (native)) Press [q] to stop, [?] for help [swscaler @ 02ad6cac5540] deprecated pixel format used, make sure you did set range correctly Last message repeated 3 times Output #0, image2, to 'eac.png': Metadata: encoder : Lavf61.1.100 Stream #0:0: Video: png, rgb24(pc, gbr/unknown/unknown, progressive), 3000x1688 [SAR 1:1 DAR 375:211], q=2-31, 200 kb/s, 25 fps, 25 tbn Metadata: encoder : Lavc61.3.100 png [image2 @ 02ad6cc35fc0] The specified filename 'eac.png' does not contain an image sequence pattern or a pattern is invalid. [image2 @ 02ad6cc35fc0] Use a pattern such as %03d for an image sequence or use the -update option (with -frames:v 1 if needed) to write a single image. [out#0/image2 @ 02ad6c9e0040] video:9207KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown frame=1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A speed=0.0467x ___ 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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".