Waste reduction with on-line process control for modified atmosphere packaging