Details
-
Task
-
Resolution: Fixed
-
P2: Important
-
None
-
6.5, 6.6, 6.7, 6.8
-
-
2f0f46c89 (dev), 144d6548c (6.8)
-
Multimedia wk 23-24
Description
QVideoFrame might be mirrored and rotated (QVideoFrame::rotation, QVideoFrame::mirrored).
It's handled properly in frame rendering, see QVideoWindowPrivate::render.
The ffmpeg encoder must consider them and record the frames properly.
Use cases:
- a user sets a custom transformation to video frames and sends them to the media recorder.
- eglfs screen capture generates frames flipped + rotated 180.
Notes:
Write correct side_data to avframes and maybe to stream->codecpar.
Note, that writing the side data to stream->codecpar might be challenging as we don't have the rotation data when we open the codec.
First of all, try modifying frame->side_data with type AV_PKT_DATA_DISPLAYMATRIX.
See our util func streamSideData(...), and ffmpeg funcs av_packet_side_data_add, av_display_rotation_set, av_display_matrix_flip.