首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >运行shell命令

运行shell命令
EN

Stack Overflow用户
提问于 2013-10-11 12:29:57
回答 1查看 1.3K关注 0票数 0

如何运行这个文件?

代码语言:javascript
复制
infile ="video.avi"
tmpfile="video_tmp.mp4"
outfile="video.mp4"
options="-vcodec libx264 -b 512k -flags +loop+mv4 -cmp 256 \
   -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 \
   -me_method hex -subq 7 -trellis 1 -refs 5 -bf 3 \
   -flags2 +bpyramid+wpred+mixed_refs+dct8x8 -coder 1 -me_range 16 \
         -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10\
   -qmax 51 -qdiff 4"

ffmpeg -y -i "$infile" -an -pass 1 -threads 2 $options "$tmpfile"

ffmpeg -y -i "$infile" -acodec libfaac -ar 44100 -ab 96k -pass 2 -threads 2 $options "$tmpfile"

qt-faststart "$tmpfile" "$outfile"

从这里拿来的https://gist.github.com/vadimii/4621929

Shell命令完全超出了我的范围,任何帮助都将不胜感激。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-10-11 12:55:47

根据评论中所写的内容:

代码语言:javascript
复制
infile =$1
tmpfile="video_tmp.mp4"
outfile=$2
options="-vcodec libx264 -b 512k -flags +loop+mv4 -cmp 256 \
   -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 \
   -me_method hex -subq 7 -trellis 1 -refs 5 -bf 3 \
   -flags2 +bpyramid+wpred+mixed_refs+dct8x8 -coder 1 -me_range 16 \
         -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10\
   -qmax 51 -qdiff 4"

ffmpeg -y -i "$infile" -an -pass 1 -threads 2 $options "$tmpfile"

ffmpeg -y -i "$infile" -acodec libfaac -ar 44100 -ab 96k -pass 2 -threads 2 $options "$tmpfile"

qt-faststart "$tmpfile" "$outfile"

要执行它:

  • 将此文件保存为my_script
  • 授予它执行权限:chmod +x my_script
  • 按以下方式执行给定参数: ./my_script input_file output_file

代码语言:javascript
复制
/bin/bash my_script input_file output_file
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19318212

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档