perl:打开文件夹,选择视频文件,并播放

在Windows10系统中Perl安装Tk模块

运行 cmd
cpan
install Tk
编写 openvideo.pl  如下

#!/usr/bin/perl
use strict;
use warnings;
use File::Basename;
use Tk;

my $mw = MainWindow->new or die 'cannot create Widget';

my $types = [['AVI', '.avi'], ['MP4', '.mp4']];

my $file = $mw->getOpenFile(-initialdir=>'D:/VIDEO', -filetypes=>$types);
#print $file;

if ( -e $file){
    my $fname = basename($file);
    system("D:/FFModules/Encoder/mplayer.exe -title $fname -aspect 4:3 $file");
} else {
    print 'file is not exists.';
}
#MainLoop;

运行 perl openvideo.pl 

如果你的PC安装了【 格式工厂】这个应用软件,那么实际安装了Windows版的 FFmpeg
在D:\FormatFactory\FFModules\Encoder\ 能找到 mplayer.exe 和 ffmpeg.exe

这里谈谈 mplayer 简单应用:mplayer -h

1. 播放比例调整
mplayer -aspect 16:9 <videofile> 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值