所需工具mtn 官网:http://moviethumbnail.sourceforge.net/
——————直接下载二进制执行文件——————
wget http://downloads.sourceforge.net/moviethumbnail/mtn-200808a-linux.tgz
解压: tar xzvf mtn-200808a-linux.tgz
——————进入到解压目录执行——————
cd /root/mtn-200808a-linux
./mht 视频路径 -f 字体路径
————————centos的字体路径——————
/usr/share/fonts/
选择其一即可
————————另选第三方字体————————
wget http://www.orwell.ru/download/cyberbit.zip
unzip cyberbit.zip
——————修改环境变量更方便的调用——————
vim ~/.bashrc
添加:
export PATH=${PATH}:/root/mtn-200808a-linux
保存退出
source ./.bashrc 使修改生效
——————详细使用说明——————
Usage:
mtn is a command-line program so its usage will mostly be done in a shell or command prompt. It has many options, the more frequently used ones are:
-w width: width of output image- If you want the thumbnails to have 3 columns and 10 rows, use:
-c 3 -r 10 - Or if you want to have 5 columns and have a shot every 65 seconds, use:
-c 5 -s 65 -r rowswill override-s secondsif used together- If not overridden, the defaults are used:
-w 1024 -c 3 -s 120 - In Windows, you can run mtn.exe from command prompt or drag files/dirs from Windows explorer and drop them on mtn.exe. You can change the default options by creating a shortcut to mtn.exe and add options there (right click the shortcut -> Properties -> Target); then drop files/dirs on the shortcut instead.
- In Linux & others, you'll probably need to change the TrueType font path (
-f fontfile). The default is set to tahomabd.ttf which might not exist in non-Windows systems. If you dont have a TrueType font, you can turn the text off by using-i -t. - Files which have Unicode names, e.g. in Thai Chinese Japanese Korean Greek, do work fine with mtn in both Linux and Windows (as of version 0.61). You need to tell which TrueType font to use though (
-f fontfile). ARIALUNI.TTF and Cyberbit.ttf seem like good ones.
For more information, see detailed usage.
参考:
如何在CentOS系统中安装字体
https://bbs.zephyrxt.com/thread-7279-1-1.html
etc/profile环境变量配置解析
https://bbs.zephyrxt.com/thread-7280-1-1.html