[FFmpeg-devel] [PATCH] avutil/display: fix inverted doc

"zhilizhao(赵志立)" quinkblack at foxmail.com
Mon Dec 13 15:19:51 EET 2021



> On Dec 12, 2021, at 7:19 PM, Andreas Rheinhardt <andreas.rheinhardt at outlook.com> wrote:
> 
> Andreas Rheinhardt:
>> Zhao Zhili:
>>> ---
>>> libavutil/display.h | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/libavutil/display.h b/libavutil/display.h
>>> index 515adad795..d87bf68425 100644
>>> --- a/libavutil/display.h
>>> +++ b/libavutil/display.h
>>> @@ -88,7 +88,7 @@
>>> double av_display_rotation_get(const int32_t matrix[9]);
>>> 
>>> /**
>>> - * Initialize a transformation matrix describing a pure counterclockwise
>>> + * Initialize a transformation matrix describing a pure clockwise
>>>  * rotation by the specified angle (in degrees).
>>>  *
>>>  * @param matrix an allocated transformation matrix (will be fully overwritten
>>> 
>> 
>> If you look at the documentation, you will notice that the matrix
>> returned from the function is supposed to be multiplied from the right
>> to the coordinate (row) vector, not from the left to the coordinate
>> (column) vector as is standard in linear algebra. This is tantamount to
>> transposing the matrix which for rotation matrices means negating the
>> degree. So this doxy is correct.
>> Notice that last time I looked at this, I came to the conclusion that
>> the whole H.2645 SEI parsing code uses it wrongly.


Yes, there are some issues related to the SEI part:

./ffmpeg -i /tmp/test.h264 -c copy -bsf h264_metadata=rotate=90:display_orientation=insert  /tmp/90.h264 -y


ffmpeg -i /tmp/90.h264 -vf showinfo -f null - 2>&1 |grep displaymatrix
[Parsed_showinfo_0 @ 0x7f8980a19d40]   side data - displaymatrix: rotation of -90.00 degrees
[Parsed_showinfo_0 @ 0x7f8980a19d40]   side data - displaymatrix: rotation of -90.00 degrees

>> 
> 
> Wait, there is another difference to ordinary linear algebra: The y axis
> is directed downwards. Maybe you are right. Let me think this through...
> 
> - Andreas
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-devel mailing list