The advanced nitrogen removal is always limited by low carbon to nitrogen ratio (C/N), the feasibility of producing carbon source through fermenting corncob was evaluated in this study. The effect of initial pH, solid content and temperature on the production of volatile fatty acids (VFAs) by alkali pre-treated corncob were investigated, and the denitrification performance with anaerobic fermentation liquid (AFL) and sodium acetate (SA) was compared. The results showed that alkali pretreatment improved the mass transfer inside the corncob, and the solid content had a major impact on VFA production. The denitrification rate of the two systems was related to the influent NO3−-N concentration only when the C/N was 6:1 and 8:1, and the removal efficiency was bigger than 95 %. Nevertheless, the nitrite reduction of the AFL system was limited at a C/N of 4:1, and the removal efficiency of NO₃−-N was only 65.10 %. Moreover, the AFL system enriched a large number of genera involved in nitrogen removal and organic decomposition. The functional analysis showed that the denitrification activity and ability of the AFL system were slightly lower. However, the SA system enriched more pathogenic bacteria, the relative abundances of Arcobacter and Pseudomonas were 28.74 % and 11.85 %, respectively. This study provides a reference for optimizing the design and control of VFAs production by continuous fermentation from agricultural waste.