【问题标题】:Improve avconv load and speed?提高 avconv 负载和速度?
【发布时间】:2013-11-18 03:58:32
【问题描述】:

当我通过avconv转换视频时,它需要超过95%的百分比,有什么办法可以减少转换时间?

【问题讨论】:

  • 我正在使用 avconv 转换器,我的命令是 avconv -i input.mov -metadata:s:v rotate=0 -c:v libx264 -b:v 4m -b:a 128k output.mp4

标签: linux cpu-usage avconv


【解决方案1】:

尝试使用-threads auto 或将其推送到您的 CPU 拥有的内核/线程数。

这是我的完整脚本

#!/bin/sh

infile=$1
tmpfile="$1-tmp.mp4"
outfile="$1-new.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"

# Half size
options=$options" -vf scale=iw*0.5:-1"
# Copy audio
options=$options" -codec:a copy"
# Shut up
options=$options" -loglevel info "

# echo "Options : $options"

avconv -y -i "$infile" -threads auto $options "$outfile"
# avconv -y -i "$infile" -an -pass 1 -threads auto $options "$tmpfile"

# avconv -y -i "$infile" -acodec aac -strict experimental -ar 44100 -ab 96k -pass 2 -threads auto $options "$tmpfile"

# qt-faststart "$tmpfile" "$outfile"

【讨论】:

    猜你喜欢
    • 2018-04-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-17
    • 2014-12-03
    相关资源
    最近更新 更多