Added posibility for CRF-Encoding
Bitrate <= 51 will be treated as a CRF-Factor, Bitrate > 52 will be treated as a constant bitrate.
This commit is contained in:
parent
d27991cbd1
commit
89d9b96f9d
1 changed files with 10 additions and 2 deletions
|
@ -69,7 +69,7 @@ def main(argv):
|
||||||
elif opt in ("-a", "--abitrate"):
|
elif opt in ("-a", "--abitrate"):
|
||||||
abitrate = int(arg) * 1000
|
abitrate = int(arg) * 1000
|
||||||
elif opt in ("-v", "--vbitrate"):
|
elif opt in ("-v", "--vbitrate"):
|
||||||
vbitrate = int(arg) * 1000
|
vbitrate = int(arg)
|
||||||
elif opt in ("-t", "--threads"):
|
elif opt in ("-t", "--threads"):
|
||||||
threads = arg
|
threads = arg
|
||||||
elif opt in ("-f", "--force-overwrite"):
|
elif opt in ("-f", "--force-overwrite"):
|
||||||
|
@ -193,6 +193,14 @@ def convert(input, output, res, abitrate, vbitrate, threads, mpopts):
|
||||||
|
|
||||||
|
|
||||||
# Define ffmpeg command for a/v encoding
|
# Define ffmpeg command for a/v encoding
|
||||||
|
|
||||||
|
if (vbitrate > 51):
|
||||||
|
rmode = "-b:v"
|
||||||
|
vbitr = str(vbitrate*1000)
|
||||||
|
else
|
||||||
|
rmode = "-crf"
|
||||||
|
vbitr = vbitrate
|
||||||
|
|
||||||
ffmenc = [ ffbin,
|
ffmenc = [ ffbin,
|
||||||
"-f", "yuv4mpegpipe",
|
"-f", "yuv4mpegpipe",
|
||||||
"-i", vfifo,
|
"-i", vfifo,
|
||||||
|
@ -206,7 +214,7 @@ def convert(input, output, res, abitrate, vbitrate, threads, mpopts):
|
||||||
"-threads", str(threads),
|
"-threads", str(threads),
|
||||||
"-vprofile", "baseline",
|
"-vprofile", "baseline",
|
||||||
"-tune", "animation",
|
"-tune", "animation",
|
||||||
"-b:v", str(vbitrate),
|
rmode, vbitr,
|
||||||
"-flags", "+loop", "-cmp", "+chroma",
|
"-flags", "+loop", "-cmp", "+chroma",
|
||||||
"-partitions", "+parti4x4+partp8x8+partb8x8",
|
"-partitions", "+parti4x4+partp8x8+partb8x8",
|
||||||
"-subq", "5", "-trellis", "1", "-refs", "1",
|
"-subq", "5", "-trellis", "1", "-refs", "1",
|
||||||
|
|
Loading…
Reference in a new issue