0

I recorded a game using fraps. The recorded video looked great.

Then I edited the video and encoded it with Huffyuv lossless codec. The video looked great.

Finally, I encoded the video with x264 in FFmpeg and the colors looked washed out.

Screenshots:

Huffyuv (looks great):

Original

x264 (looks washed out):

Copy

x264 settings:

ffmpeg -y -i "D:\Project\TestHuffyuv.avi" -c:v libx264 -b:v 1000k -pass 1 -passlogfile D:\Project\Stats -f mp4 NUL
ffmpeg -y -i "D:\Project\TestHuffyuv.avi" -c:v libx264 -b:v 1000k -pass 2 -passlogfile D:\Project\Stats D:\Project\FFmpeg_MP4.mp4

When I was encoding with x264, I got the following warning:

No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.

How do I fix the colors so they look the same as in the original video?

UPDATE:

Tried Mulvya's x264 settings (colors still looks washed out):

ffmpeg -y -color_range 2 -i "D:\Project\TestHuffyuv.avi" -vf scale=in_range=full:out_range=tv -c:v libx264 -b:v 1000k -color_range 1 -pass 1 -passlogfile D:\Project\Stats -f mp4 NUL
ffmpeg -y -color_range 2 -i "D:\Project\TestHuffyuv.avi" -vf scale=in_range=full:out_range=tv -c:v libx264 -b:v 1000k -color_range 1 -pass 2 -passlogfile D:\Project\Stats D:\Project\FFmpeg_MP4.mp4

Mulvya

tried "-pix_fmt yuv420p" x264 switch (image looks darker, colors still washed out):

ffmpeg -y -i "D:\Project\TestHuffyuv.avi" -c:v libx264 -pix_fmt yuv420p -b:v 1000k -pass 1 -passlogfile D:\Project\Stats -f mp4 NUL
ffmpeg -y -i "D:\Project\TestHuffyuv.avi" -c:v libx264 -pix_fmt yuv420p -b:v 1000k -pass 2 -passlogfile D:\Project\Stats D:\Project\FFmpeg_MP4.mp4

-pix_fmt yuv420p

tried "-pix_fmt yuvj420p" x264 switch (Image looks darker than the original):

ffmpeg -y -i "D:\Project\TestHuffyuv.avi" -c:v libx264 -pix_fmt yuvj420p -b:v 1000k -pass 1 -passlogfile D:\Project\Stats -f mp4 NUL
ffmpeg -y -i "D:\Project\TestHuffyuv.avi" -c:v libx264 -pix_fmt yuvj420p -b:v 1000k -pass 2 -passlogfile D:\Project\Stats D:\Project\FFmpeg_MP4.mp4

pix_fmt yuvj420p

Full console output: http://pastebin.com/3cJNvVjL

1

Try

ffmpeg -y -color_range 2 -i "D:\Project\TestHuffyuv.avi" -vf scale=in_range=full:out_range=tv -c:v libx264 -b:v 1000k -color_range 1 -pass 1 -passlogfile D:\Project\Stats -f mp4 NUL
ffmpeg -y -color_range 2 -i "D:\Project\TestHuffyuv.avi" -vf scale=in_range=full:out_range=tv -c:v libx264 -b:v 1000k -color_range 1 -pass 2 -passlogfile D:\Project\Stats D:\Project\FFmpeg_MP4.mp4

It could also be an issue of colorspace but let's see if this doesn't work.

  • What happen when you tried -pix_fmt yuv420p ? – szatmary Jan 26 '17 at 17:21
  • I tried it, and the colors still look washed out; see my updated post for image comparison. – ClearSky Jan 26 '17 at 18:02
  • @szatmary I tried that switch, and the video is a bit darker, but colors still look washed out; see my updated post for comparison. – ClearSky Jan 26 '17 at 18:04
  • Ok, then try with -pix_fmt yuvj420p added to your original commands. If no change, then show the full console output. – Gyan Jan 26 '17 at 18:09
  • @Mulvya Tried it, the image looks darker than the original. Here is the full console output: pastebin.com/3cJNvVjL – ClearSky Jan 26 '17 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.