For gaming i5 7400 is better at stock, Ryzen 5 1400 is better when overclocked. For future ready multithreaded games, Ryzen 5 1400 is better as it has 8 threads.
Both CPUs have similiar TDPs of 65W, but the Ryzen 5 1400 would be more efficient in normal web browsing tasks as it is more efficient per core.
The Ryzen 5 1400 has 4 Cores and 8 Threads (SMT on) at 3.2 GHz while the i5 7400 has 4 Cores and 4 Threads with no hyperthreading at 3.0GHz. This makes the Ryzen 5 1400 30-70% better at multithreaded tasks such as video editing and streaming due to its higher thread count at similiar per core performance.
For gaming which relies on a main thread, the Ryzen 5 1400 clocks at a Turbo of 3.4GHz while the i5 7400 clocks in at 3.5 GHz...