[FFmpeg-devel] [PATCH] avfilter: add panorama filter
Paul B Mahol
onemda at gmail.com
Mon Mar 12 10:42:59 EET 2018
On 3/12/18, Hazem Ashmawy <hazem.s.ashmawy at gmail.com> wrote:
> On 3/12/18, Paul B Mahol <onemda at gmail.com> wrote:
>> On 3/12/18, Hazem Ashmawy <hazem.s.ashmawy at gmail.com> wrote:
>>> So, I spend few hours trying to incorporate the partial change.
>>>
>>> I'm not sure that the video sent by <jamrial> earlier follows the
>>> faces order here
>>> https://github.com/google/spatial-media/blob/master/docs/spherical-video-v2-rfc.md#semantics-3
>>>
>>> Because when I made this change, I got a reasonable equirectangular
>>> ouput:
>>> https://imgur.com/a/BEN00
>>>
>>> comparing to the changes sent earlier.
>>> https://imgur.com/a/vaIvW
>>>
>>> diff --git a/libavfilter/vf_panorama.c b/libavfilter/vf_panorama.c
>>> index de08ef4..5383d57 100644
>>> --- a/libavfilter/vf_panorama.c
>>> +++ b/libavfilter/vf_panorama.c
>>> @@ -34,12 +34,12 @@ enum Projections {
>>> };
>>>
>>> enum Faces {
>>> + DOWN,
>>> LEFT,
>>> + TOP,
>>> FRONT,
>>> RIGHT,
>>> - TOP,
>>> BACK,
>>> - DOWN,
>>> };
>>>
>>> struct XYRemap {
>>> @@ -403,7 +403,7 @@ static int config_output(AVFilterLink *outlink)
>>>
>>> switch (face) {
>>> case LEFT:
>>> - locate(z, x, y, M_PI, rw, rh, &ox, &oy);
>>> + locate(z, x, y, -M_PI_2, rw, rh, &ox, &oy);
>>> break;
>>> case FRONT:
>>> locate(x, z, y, 0., rw, rh, &ox, &oy);
>>> @@ -418,7 +418,7 @@ static int config_output(AVFilterLink *outlink)
>>> locate(x, y, z,-M_PI_2, rw, rh, &ox, &oy);
>>> break;
>>> case DOWN:
>>> - locate(y, x, z,-M_PI_2, rw, rh, &ox, &oy);
>>> + locate(y, x, z, M_PI_2, rw, rh, &ox, &oy);
>>> break;
>>> }
>>>
>>> What I'm saying is: when I changed face order to this (which video
>>> sample seems to follow), I got a reasonable output.
>>> down | left | top
>>> front | right | back
>>>
>>> Comparing to Google's:
>>> right | left | top
>>> down | front | back
>>
>> The video linked here does not have name of faces, so you can not know
>> what is front and what is back.
>>
>> Just add support for typical cubemap layout currently used.
> You mean In the video linked?
> Or the Google's specification and ignore the linked video?
> Or current layout order originally used in the patch?
Just use what currently cubemap layout is used by youtube.
More information about the ffmpeg-devel
mailing list