X-rated capacitors required for DC input voltage circuits
X-type capacitors are designed to be across an AC line and they are tested and manufactured to more stringent requirements in order that they do not short out the AC, take plenty of amps and cause a fire.

This is unlike (say) ceramic caps - once they break down they can go short circuit and you get a fire if the power source is fairly unlimited (like an AC line)!

If your external supply is 12V DC and can only supply a current of a few amps then I don't see the need to use X-type capacitors - basic ceramic types of 25 V rating with a decent dielectric will do the job and probably better in terms of reducing EMI.

Regards the calculation of a value, there is no information in the question to solve this.