哲德 2013年11月25日 星期一 15:30 | 1879次浏览 | 1条评论
一个用于多
我一直在尝试使用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 © 2024
京ICP备05028076号
回复 段永明 2013年12月16日 星期一 10:11