Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8597

Advanced users • Re: Distorted video using ffmpeg and h264_v4l2m2m codec (RPI4)

$
0
0
1920 / 32 = 60, so the pitch is the same as width.
720 / 32 = 22.5, so the pitch isn't the same as width. If pitch isn't handled correctly throughout, then you'll get weird image issues.

Just doing a little testing. Using your supplied test file and the command line

Code:

ffmpeg -threads 4  -codec:v h264_v4l2m2m  -i attica_raw.ts  -codec:v h264_v4l2m2m -pix_fmt yuv420p foo.mp4
gives me a valid encode using hardware decode and encode. (Your command line is using software decode and hardware encode)

Then again so does the basic

Code:

ffmpeg -threads 4 -i attica_raw.ts  -codec:v h264_v4l2m2m foo.mp4
which is using software decode.
Adding in -b:v 600k to set the bitrate also works.

FWIW I'm using ffmpeg version 5.1.4-0+rpt1+deb12u1 from the standard Raspberry Pi OS image. Also works with the latest 5.1.4-0+rpt3+deb12u1.
can you please check this?

Code:

sudo docker pull collelog/ffmpeg:4.4-alpine-rpi4-64sudo docker run --device /dev/video11:/dev/video11 -v ~/Videos:/tmp/files collelog/ffmpeg:4.4-alpine-rpi4-64 -y -threads 4 -i /tmp/files/attica_raw.ts -codec:v h264_v4l2m2m /tmp/files/foo.mp4
copy the .ts file to a new folder and replace ~/Videos with the full path

Statistics: Posted by dennmtr — Tue Mar 12, 2024 7:32 pm



Viewing all articles
Browse latest Browse all 8597

Trending Articles