哲德

哲德的博客

他的个人主页  他的博客

一个用于多媒体文件转换编码的makefile。

哲德  2013年11月25日 星期一 15:30 | 1762次浏览 | 1条评论

一个用于多媒体文件转换编码的makefile,请各位大牛帮忙改进。

我一直在尝试使用make(1)来辅助视频文件转码。以下是我最近写出的一个,效果相当好,并可利用make的-j参数实现多任务同步。(格式工厂神马的自由软件盗版可以滚了,;-)只是现在对路径名中的空格比较头疼(现在的解决方法是找个地方做一批路径名不带空格的源文件的符号链接),还请各位大牛帮忙改进。

以下为makefile代码:

#This Makefile is to provide an easy and multi-task way to transcode multimedia files with make(1) and avconv(1)

#This program is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 3 of the License, or
#(at your option) any later version.

#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.

#GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html

SRCDIR=.
include list.mk
#to introduce a list of all target files as $(TARGETS), path to source files as $(SRCDIR) (default to '.'), and file extensions $(TGEXT) and $(SRCEXT)
include flag.mk
#introduce transcode flags to avconv as $(AVFLAGS)

all: $(TARGETS)

clean:
    -rm $(TARGETS)

%.$(TGEXT): $(SRCDIR)/%.$(SRCEXT)
    avconv -i "$<" $(AVFLAGS) "$@"

 

评论

我的评论:

发表评论

请 登录 后发表评论。还没有在Zeuux哲思注册吗?现在 注册 !
段永明

回复 段永明  2013年12月16日 星期一 10:11

扔到Github上了吗

0条回复

暂时没有评论

Zeuux © 2024

京ICP备05028076号