如何查找视频中使用的编解码器

如何查看视频中使用的编解码器(音频/视频)以及有关如何使用相同的压缩/质量来重现视频的额外信息。
4个回答

一种做法是使用VLC。打开相关文件,在播放列表中右键单击它,你会看到类似这样的内容:

Codec info

Stats info

我在使用OS X,但是思路是一样的。
另一种方法是打开终端,导航到包含文件的目录,并执行以下操作:
file foo.avi

这并没有提供太多的信息,但它是一个开始。

天哪,我的智商刚刚掉了99%。我都忘了。谢啦 boehj. - Luis Alvarado

另一个命令行选项,提供较少“严厉”信息的选项:
ffprobe -show_streams "file.mp4"

即使有更好的输出,对于普通人来说仍然很难理解。如果你需要一些文件格式的样本来测试它:
视频格式示例:Video Format Examples

添加|grep codec将过滤输出结果。 - daGo

你可以通过安装mediainfo来获取关于音频/视频编解码器和其他信息的信息。提供了图形用户界面(GUI)和命令行工具两种方式。使用以下命令进行安装:
sudo apt-get update
sudo apt-get install mediainfo

如果你想安装图形用户界面(GUI),
sudo apt-get install mediainfo-gui

请参考访问mediainfo

难以找到的“midenitfy”脚本。一份古老的副本如下所示:
#!/bin/sh
#
# This is a wrapper around the -identify functionality.
# It is supposed to escape the output properly, so it can be easily
# used in shellscripts by 'eval'ing the output of this script. 
#
# Written by Tobias Diedrich <ranma+mplayer@tdiedrich.de>
# Licensed under GNU GPL.

if [ -z "$1" ]; then
        echo "Usage: midentify <file> [<file> ...]"
        exit 1
fi

 mplayer -vo null -ao null -frames 0 -identify "$@" 2>/dev/null |
        sed -ne '/^ID_/ {
                           s/[]()|&;<>`'"'"'\\!$" []/\\&/g;p
                        }'