[FFmpeg-user] FFMPEG - AMD GPU Transcoding MJPEG to HEVC provides a skewed split screen video

Rajh U rajhlinux at yahoo.com
Mon Jul 25 21:37:46 EEST 2022

I am trying to use my AMD GPU for transcoding MJPEG to HEVC using VA-API.
Using this command:

ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -c:v mjpeg -f v4l2 -input_format mjpeg -framerate 30 -video_size 1920x1080 -i /dev/video0 -vf 'scale_vaapi=format=nv12' -c:v hevc_vaapi -map 0:a? -map 0:s? -c:s copy -rc_mode 1 -qp 25 -map_chapters 0 output.mp4 -y
And it seems to work fine, no skipped frames, smooth transcoding, only 2-3% CPU usage. However the video output file is completely skewed.
For some reason FFMPEG splits the video into two pieces where one half of the video is the actually the proper video and the other half is all skewed up.
Note: The camera is a CCTV camera, which is using it's infrared LEDs to view in the dark room. So it is in greyscale color due to the camera and not any issues based on transcoding.

Here is a picture of the video output:https://i.imgur.com/OuMlidj.png

Here is the output video file:AMD Radeon Pro WX 2100 GPU FFMPEG transcoding MJPEG to HEVC.

|  |  |


|  | 
AMD Radeon Pro WX 2100 GPU FFMPEG transcoding MJPEG to HEVC.




Any clue why this is happening?
I have AMD AMF and VAAPI encoders working. I like VAAPI since it is able to do HEVC encoding.
OS: Arch Linux
GPU: AMD Radeon Pro WX 2100.
$ lspci -k | grep -A 2 -E "(VGA|3D)"

bash: If: command not found...
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Lexa XT [Radeon PRO WX 2100]
        Subsystem: Dell Device 0b0c
        Kernel driver in use: amdgpu

Thanks for any advice.

More information about the ffmpeg-user mailing list