TIP Encode Video for IPod
出自Gentoo Linux Wiki
| 终端/Shell • 网络 • X 窗口系统 • Portage • 系统 • 文件系统 • 内核 • 其它 |
[编辑] 安装
首先我们要安装ffmpeg,并且要加上“aac”这个USE标记:
# echo "media-video/ffmpeg aac" >> /etc/portage/package.use # emerge -avt ffmpeg
然后我们就要创建脚本来替我们完成这份工作:
| 文件: ipodvidenc |
#!/bin/bash
## ipodvidenc - The iPod Video Encoder for Linux.
## Created by Eric Hewitt, January 9, 2006.
## Released under the GPL. Go nuts.
input_file=$1
echo "What would you like to name the output file (sans extension)?"
read output_file_name
echo "$output_file_name will be located in $PWD. Is this acceptable? [y/n]"
read output_file_loc_permis
if [ $output_file_loc_permis = 'n' ] || [ $output_file_loc_permis = 'N' ]
then
echo "Where would you like to store $output_file_name.mov?"
read output_dir
else
output_dir=$PWD
fi
ffmpeg -i "${input_file}" -acodec libfaac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s 320x180 -title X "${output_dir}/${output_file_name}.mp4" |
接着我们要修改这个脚本的权限,之后我们才能运行它,接下来把这个脚本移动到/usr/local/bin里面:
# chmod +x ipodvidenc # mv ipodvidenc /usr/local/bin
[编辑] 运行
现在仅剩的工作就是运行ipodvidenc了:
ipodvidenc video.avi
[编辑] Credits
感谢写这篇TIP的作者!原文地址:http://gentoo-wiki.com/TIP_Encode_Video_for_IPod Author:Unknown Translator:--JackSM 2008年3月29日 (六) 03:22 (UTC)
