The development and utilization of abundant biomass resources is a promising solution to the problems of fossil resource scarcity and the difficulty in the biodegradation of waste faced by traditional food packaging films. Novel biomass-based films are not only biodegradable but can also be endowed with a variety of functional characteristics, including smart pH indicating film that can show color changes according to pH changes during food storage to achieve real-time visual detection of the degree of food spoilage, which is intuitive, sensitive, and convenient compared to traditional food packaging films. In this work, an environmentally friendly smart pH indicating film was prepared by incorporating natural polymer chitosan (CS) with anthocyanin-rich purple yam extract (PYE). The effect of different additions (1.5, 3, 4.5, 6 wt%) of PYE on the mechanical properties, water vapor barrier properties, antioxidant, antibacterial and pH sensitivity properties of chitosan films were investigated. The results showed that the films supplemented with 4.5% and 6% PYE demonstrated higher antioxidant capacity and antibacterial properties, while showing a more pronounced color change in different pH buffers. The results of FT-IR, scanning electron microscopy and X-ray diffraction analysis indicated the presence of hydrogen bonding between CS and PYE molecules. The application of films for in-situ monitoring the freshness of food (e.g., shrimp) was also studied, and films with PYE additions between 3% and 6% all showed visible color changes. Consequently, CS-PYE films are of great potential as smart and active packaging materials for keeping and monitoring the freshness of foods.