A theoretical demonstration of the multichannel midinfrared (MIR) optical filters is proposed, and even-numbered multichannel spectral transmission is obtained by adding 1-D Ge2Sb2Te5 (GST) grating defect layers in a 1-D photonic crystal (1DPhC), which can be attributed to the excitations of defect modes (DMs) and guided mode resonance (GMR). Moreover, the channel numbers of the proposed optical filter can be designed by controlling the number of GST grating layers, and active tunability of the multichannel MIR optical filter can be realized by controlling the GST phase transition. In addition, two theoretically designed examples of optical filters for nondispersive infrared (NDIR) sensing are given for characteristic absorption wavelength acquisitions in single- (CO) and multicomponent (CH4, CH2O, CO2, and CO) gas detections. Our findings may have potential applications in infrared spectroscopic gas detection, material characterization, and biochemical sensing.