I have a x264 video with yuvj420p(pc, smpte170m) color space and i want to convert this video to x265 and reduce its file size. I have used this command ffmpeg -i input.mp4 -vcodec libx265 -crf 20 output.mp4 but the video got darker and when i runned ffprobe i saw the colorspace changed to yuvj420p(pc, progressive) How can i preserve color space while transcoding?

1 Answer 1


This command preserved the colorspace and also video didnt get darker after transcoding

ffmpeg -i input.mp4 -color_primaries smpte170m -color_trc smpte170m -colorspace smpte170m -r 25 -crf 18 output.mp4

source: https://kdenlive.org/en/project/color-hell-ffmpeg-transcoding-and-preserving-bt-601/

more about colorspace: https://trac.ffmpeg.org/wiki/colorspace

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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