The mechanisms of the production of vibrationally excited NO and N2 molecules at the altitudes of the middle atmosphere of the Earth during high-energetic proton precipitation are considered. The study of vibrational populations N2(X1Σg+,v’>0) during high-energetic proton precipitation has shown different principal mechanisms in the N2(X1Σg+,v’>0) excitation. Firstly, the excitation by secondary electrons is principal for vibrational levels v’=1-10. Secondly, it is obtained that intramolecular electron energy transfer process in N2(A3Σu+)+N2 collisions dominates in vibrational excitation of high vibrational levels v’=20-30. It is shown that the chemical reaction of metastable atomic nitrogen with molecular oxygen is the main production mechanism of vibrationally excited NO(X2Π,v>0) and of the radiation of 5.3 μm and 2.7 μm infrared emissions at the altitudes. The role of VV’-processes in the radiation of the 5.3 μm infrared emission is discussed.