Do you already have the i5-7400 CPU? If not I would go for the i3-8100 or i3-8300.
I would expect the 8th Gen i3 to perform about the same both in general and specifically for transcoding as the 7th gen i5 due to minor generational improvements and a small speed bump. The difference will likely be unnoticeable in either direction.
I’m not sure where you are located but it looks like in the US you can get the i3-8100 for $20 - $30 so you could be saving a bit on the processor for the same performance and the i3-8100 additionaly benefits from a newer platform.
The biggest advantage of the i3-8100 over the i5-7400 is that it is at the very low end of next generation platform (motherboard chipset / socket and higher speed DDR4 RAM) meaning that down the road you could upgrade to a higher end 8th gen or 9th gen CPU without needing to buy a new motherboard and possibly RAM.
In any case if you do end up going with the i5-7400 make sure to chose a motherbard that supports DDR4 RAM since that will have a bigger performance impact over DDR3 than the CPU choice.
Looks like you have already figured it out, but the motherboard you linked is an AMD board. If you do go with the i3-8100 check out the NK 6.0 build for some possible motherboard options, although any LGA 1511 V2 (Intel 8th / 9th gen) motherboard should work. Just make sure it has enough SATA ports available or you will need to get an add-on HBA as well to fit all your drives.