python - making index of video files -
i have several directories of video files (windows) in various formats (avi, mp2, asf, ...) , want listing , csv of properties index (name, date, size, length, format).
there various tools single files, , have seen fixups such using scripts of mediainfo in .bat file, none give listing can imported table, or across multiple directories. windows explorer sill list of in visual format not file, , don't know of way coerce make file of it. knows lengths of video file types (mp3, mp4, asf, wmv), not many others (flv, ...). explorer directory specific, , won't recurse dir can.
i'd happy utility this, lacking tend try in python. there library utilities in python, or other suggestions?
use os.walk
walk through directory tree. pymedia library may reading mp3, avi, , other formats. eye3d.
using os.walk easy:
import os root_dir = '.' root, dirs, files in os.walk(root_dir): f in files: # takes file it's dir whatever want analyze_file(f, root)
Comments
Post a Comment