我正在寻找一个工具或一组工具,它们可以从文件夹中递归读取并输出文件夹的名称、电影文件的名称、电影的分辨率和其他信息。
例如,它的输出将是:
(1997) Titanic, Titanicmovie, 1280x720, 720p
(2001) Matrix 2, Matrix2, 1280x1080, 1080p
(2012) Titan, Titanmovie, 1280x720, 720p
Run Code Online (Sandbox Code Playgroud)
awk & grep + exiftool
http://www.sno.phy.queensu.ca/~phil/exiftool/
应该能够明智地获得您需要的一切信息。
mp4:
$ exiftool big_buck_bunny_480p_surround-fix.avi
ExifTool Version Number : 9.02
File Name : big_buck_bunny_480p_surround-fix.avi
Directory : .
File Size : 210 MB
File Modification Date/Time : 2012:09:19 09:43:12-04:00
File Access Date/Time : 2012:09:19 09:43:22-04:00
File Permissions : rw-rw-r--
File Type : AVI
MIME Type : video/x-msvideo
Frame Rate : 24
Max Data Rate : 0 kB/s
Frame Count : 14315
Stream Count : 2
Stream Type : Video
Video Codec : FMP4
Video Frame Rate : 24
Video Frame Count : 14315
Quality : 0
Sample Size : Variable
Image Width : 854
Image Height : 480
Planes : 1
Bit Depth : 24
Compression : FMP4
Image Length : 1229760
Pixels Per Meter X : 0
Pixels Per Meter Y : 0
Num Colors : Use BitDepth
Num Important Colors : All
Audio Codec :
Audio Sample Rate : 56000
Audio Sample Count : 33401088
Encoding : FAST Multimedia DVM
Num Channels : 6
Sample Rate : 48000
Avg Bytes Per Sec : 56000
Bits Per Sample : 16
Duration : 0:09:56
Image Size : 854x480
Run Code Online (Sandbox Code Playgroud)
MKV
$ exiftool hddvd_demo_1080p.mkv
ExifTool Version Number : 9.02
File Name : hddvd_demo_1080p.mkv
Directory : .
File Size : 278 MB
File Modification Date/Time : 2012:09:19 10:09:51-04:00
File Access Date/Time : 2012:09:19 10:08:43-04:00
File Permissions : rw-rw-r--
File Type : MKV
MIME Type : video/x-matroska
Doc Type : matroska
Doc Type Version : 1
Doc Type Read Version : 1
Timecode Scale : 1 ms
Muxing App : libebml v0.7.7 + libmatroska v0.8.1
Writing App : mkvmerge v2.0.2 ('You're My Flame') built on Feb 21 2007 23:40:55
Duration : 0:02:01
Date/Time Original : 2007:04:07 03:28:47Z
Video Codec ID : V_MS/VFW/FOURCC
Image Width : 1920
Image Height : 1080
Video Scan Type : Progressive
Display Width : 1920
Display Height : 1080
Default Duration : 32 ms
Track Number : 3
Track Type : Audio
Track Used : Yes
Track Default : No
Track Forced : No
Track Timecode Scale : 1
Audio Codec ID : A_EAC3
Codec Decode All : Yes
Track Language : eng
Track Name : Dolby Digital Plus 5.1 640kbps
Audio Sample Rate : 48000
Audio Channels : 6
Image Size : 1920x1080
Run Code Online (Sandbox Code Playgroud)
所以你可以做的是类似的事情
find . -name "*.ogg" -o -name "*.avi" -exec exiftool {} \;
Run Code Online (Sandbox Code Playgroud)
添加
-o -name "*.videoFormat"
Run Code Online (Sandbox Code Playgroud)
对于每个附加的视频格式。此外,这只是让您入门的基础。你也可以这样做
exiftool ~/Videos
Run Code Online (Sandbox Code Playgroud)
它将为每个文件打印出一张巨大的信息表。您需要将其转储到文件中,然后您可以相应地 grep 和 awk。希望有帮助。