返回列表 发帖

[文件操作] [已解决]求助批处理把目录的视频文件,获取信息参数生成同名的txt呢?

本帖最后由 1139054012 于 2025-2-28 22:23 编辑

一直用Mediainfo,一个个视频打开复制,实在是太笨方法了
不知道可以通过Mediainfo.exe来批量获取当前目录下所有格式MP4,MKV,FIV等视频,获取信息输出TXT
比如
1.mkv

输出1.txt
General
Unique ID                      : 67354698150306436300435687988057029069 (0x32AC0B0275B6C21149353CE2E4BB39CD)
Complete name                  : F:\\1.mkv
Format                         : Matroska
Format version                 : Version 4
File size                      : 570 MiB
Duration                       : 30 min 9 s
Overall bit rate mode          : Variable
Overall bit rate               : 2 642 kb/s
Frame rate                     : 23.976 FPS
Encoded date                   : 2019-12-14 02:57:08 UTC
Writing application            : mkvmerge v36.0.0 ('Is That Jazz?') 64-bit
Writing library                : libebml v1.3.9 + libmatroska v1.5.2
Attachments                    : courte-regular.ttf / kudasai.ttf
Video
ID                             : 1
Format                         : AVC
Format/Info                    : Advanced Video Codec
Format profile                 : High 10@L4.1
Format settings                : CABAC / 5 Ref Frames
Format settings, CABAC         : Yes
Format settings, Reference fra : 5 frames
Codec ID                       : V_MPEG4/ISO/AVC
Duration                       : 30 min 9 s
Bit rate                       : 1 935 kb/s
Width                          : 1 024 pixels
Height                         : 576 pixels
Display aspect ratio           : 16:9
Frame rate mode                : Constant
Frame rate                     : 23.976 (24000/1001) FPS
Color space                    : YUV
Chroma subsampling             : 4:2:0
Bit depth                      : 10 bits
Scan type                      : Progressive
Bits/(Pixel*Frame)             : 0.137
Stream size                    : 418 MiB (73%)
Writing library                : x264 core 148 r2744 b97ae06
Encoding settings              : cabac=1 / ref=5 / deblock=1:-1:-1 / analyse=0x3:0x133 / me=esa / subme=11 / psy=1 / psy_rd=0.90:0.00 / mixed_ref=1 / me_range=32 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=4 / b_pyramid=2 / b_adapt=2 / b_bias=1 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=15.0 / qcomp=0.70 / qpmin=4 / qpmax=40 / qpstep=4 / vbv_maxrate=62500 / vbv_bufsize=78125 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.10
Language                       : Japanese
Default                        : Yes
Forced                         : No
Color range                    : Limited
Color primaries                : BT.601 NTSC
Transfer characteristics       : BT.601
Matrix coefficients            : BT.601
Audio
ID                             : 2
Format                         : FLAC
Format/Info                    : Free Lossless Audio Codec
Codec ID                       : A_FLAC
Duration                       : 30 min 9 s
Bit rate mode                  : Variable
Bit rate                       : 704 kb/s
Channel(s)                     : 2 channels
Channel layout                 : L R
Sampling rate                  : 48.0 kHz
Frame rate                     : 11.719 FPS (4096 SPF)
Bit depth                      : 16 bits
Compression mode               : Lossless
Stream size                    : 152 MiB (27%)
Writing library                : libFLAC 1.3.2 (2017-01-01)
Language                       : Japanese
Default                        : Yes
Forced                         : No
MD5 of the unencoded content   : F49FED78DAD6C9C72C8FF04873B9A1E2
Text
ID                             : 3
Format                         : ASS
Codec ID                       : S_TEXT/ASS
Codec ID/Info                  : Advanced Sub Station Alpha
Duration                       : 28 min 27 s
Bit rate                       : 132 b/s
Frame rate                     : 0.264 FPS
Count of elements              : 451
Compression mode               : Lossless
Stream size                    : 27.6 KiB (0%)
Default                        : Yes
Forced                         : No
Menu
00:00:00.000                   : Chapter 1
00:01:31.124                   : Chapter 2
00:02:58.645                   : Chapter 3
00:10:59.059                   : Chapter 4
00:19:38.179                   : Chapter 5
00:28:30.878                   : Chapter 6
00:30:02.904                   : Chapter 7COPY

本帖最后由 aloha20200628 于 2025-2-28 23:20 编辑

回复 1# 1139054012

以下代码须用 mediainfo.exe 的命令行版本(可从本坛第三方下载:http://bcn.bathome.net/s/tool/index.html?key=MediaInfo,存与批处理文件和视频文件同目录运行,只需采用压缩包中的一个 MediaInfo.exe 文件即可)
@echo off &for %%F in (*.mp4,*.mkv,*.fiv) do MediaInfo.exe "%%F">"%%~nF.txt"
pause&exit/bCOPY
1

评分人数

TOP

返回列表