Generate metadata JSON, name files 0..n.