ni_quadra_rotate
The ni_quadra_rotate filter rotates a picture/video. It works just like the FFmpeg software rotate filter but uses the hardware to do the rotation. Rotation is supported for yuv420p.
ni_quadra_rotate only supports hardware AVFrames as input and output. To rotate a software frame, use ni_quadra_hwupload to upload the frame to the Quadra device. If the hardware frame is on the same device as the scaler, it can be accessed directly.
The ni_quadra_rotate filter only supports limited color range video (also known as “TV” range). While full range (or “PC” range) video is accepted by the filter, the ni_quadra_bg filter will clamp to limited color range video before processing. This clamp will cause a slight color shift in the output video.
Parameters
The following are the ni_quadra_rotate parameters:
angle, a
Angle to clockwise rotate the input in radians.
| Supported Values | 0, PI/2, PI, 3*PI/2 |
| Default | 0 |
out_w, ow
Set the output width expression.
| Default | iw |
out_h, oh
Set the output height expression.
| Default | ih |
fillcolor, c
Set the color used to fill the output area not covered by the rotated image.
| Default | black |
is_p2p
Specifies if output buffer of the filter is p2p buffer. When is_p2p is set to 1, the output buffer of the filter is set as p2p buffer and can be read out by p2p read. Else the output buffer is normal and cannot perform p2p.
| Supported Values | Bool 0 and 1 |
| Default | 0 |
auto_skip
Specifies if to skip the hardware rotate when input is the same as the output. When auto-skip is set to 1, frames will pass through the rotate filter and no hardware operations will be executed. When auto_skip is set to 0, hardware scale will always be executed regardless of whether the input is the same as the output.
auto-skip is only supported with ffmpeg version > 3.4.2. If ffmpeg version < 3.4.2 the hardware operation will always be skipped when the input is the same as output.
| Supported Values | Bool 0 and 1 |
| Default | 0 |
The following example decodes a H.264 input using the h264_ni_quadra_dec and rotates the video by 180 degrees before passing it to h264_ni_quadra_enc for encoding.
ffmpeg -vsync 0 -c:v h264_ni_quadra_dec -xcoder-params 'out=hw' -i input.h264 -vf 'ni_quadra_rotate=PI' -c:v h264_ni_quadra_enc -c:a copy output.h264