I've been digging through the mplayer/mencoder and ffmpeg documentation and I can't seem to come up with anything. I'm not especially picky as to the output format as I can use a regular expression to pull it out, I just can't seem to get the data in the first place.
相关问题
- Is shmid returned by shmget() unique across proces
- how to get running process information in java?
- How to create PNG images with more than 72dpi usin
- Error building gcc 4.8.3 from source: libstdc++.so
- Why should we check WIFEXITED after wait in order
Using exiftool
run the command
The output you get is similar to this:
Using ffmpeg/ffprobe
run the command
alternatively:
The output you get is similar to this:
Using mplayer
run the command
The output you get is similar to this:
Using mediainfo
run the command
The output you get is similar to this:
time summary
YMMV, but ffprobe is the fastest followed by mediainfo then mplayer and finally exiftool
The good ol' "file" utility will often get the dimensions of a video file.
Use ffprobe (part of FFmpeg toolkit)
example:
output:
See documentation for more info.
Here's an "almost-one-liner" I've concocted around ffprobe for exactly this purpose. Works pretty well for me both on Linux and MacOS.
MediaInfo has a command line version and provides the dimensions together with tons of other information.
Try midentify.sh (TOOLS/midentify.sh in the source code tree of MPlayer).
It will show information in a parseable format:
[,,,]