Why is ffmpeg producing a background?
Its impossible to say for sure, Because you dont say what your input format is, But there is most likely a color space/range conversion occurring.
You may may need to set the those values. you may need to specificity the agues to use for the conversion as well.
This post should explain it.
https://mux.com/blog/your-browser-and-my-browser-see-different-colors/
I don't cover color range in that post. But you most likely want to use full range.