adi10289
adi10289

Reputation: 33

YUV raw video color issue

I am converting YUV raw video to mp4 using below ffmpeg command but after conversion colors are totally messed up like instead of red its showing blue. Kindly check and confirm if there is any issue with below conversion code.

ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 1920x1080 -r 23.976 -i 2.raw -c:v libx264 output.mp4

Upvotes: 0

Views: 1771

Answers (2)

adi10289
adi10289

Reputation: 33

ok i have found out solution after lots of searching and hit & trial method, we need to add vtag yv12 for proper colors.

Upvotes: 1

nsp
nsp

Reputation: 87

The command looks alright. Possibly you may not be using the right pixel format. Are you sure that the pixel format is "yuv420p"?

One way you can check is to play the 2.raw video using ffplay and make sure that it plays fine. You can use the command

ffplay -f rawvideo -video_size 1920x1080 -pixel_format yuv420p -i 2.raw

If you see the same issues with the playback, then most likely the pixel format is incorrect or there is some inherent issue with the input video.

Upvotes: 1

Related Questions