Add crop option
This commit is contained in:
parent
51174a6bad
commit
6ec951e015
9
main.py
9
main.py
|
@ -15,6 +15,7 @@ parser.add_argument("--ba")
|
||||||
parser.add_argument("--alayout")
|
parser.add_argument("--alayout")
|
||||||
parser.add_argument("--cpu")
|
parser.add_argument("--cpu")
|
||||||
parser.add_argument("--mf")
|
parser.add_argument("--mf")
|
||||||
|
parser.add_argument("--crop")
|
||||||
parser.add_argument("--dry", action="store_true")
|
parser.add_argument("--dry", action="store_true")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
@ -34,9 +35,11 @@ if args.mf is not None:
|
||||||
preset["mf"] = args.mf
|
preset["mf"] = args.mf
|
||||||
|
|
||||||
cmd = ["ffmpeg", "-i", args.input, "-c:v", "libaom-av1", "-c:a", "libopus", "-c:s", "copy", "-map", "0",
|
cmd = ["ffmpeg", "-i", args.input, "-c:v", "libaom-av1", "-c:a", "libopus", "-c:s", "copy", "-map", "0",
|
||||||
"-crf", preset["crf"], "-b:v", "0", "-b:a", preset["ba"],
|
"-crf", preset["crf"], "-b:v", "0"]
|
||||||
"-af", f"aformat=channel_layouts={preset['alayout']}", "-mapping_family", preset["mf"],
|
if args.crop is not None:
|
||||||
"-cpu-used", preset["cpu"], "-row-mt", "1", "-tiles", "2x2", args.output]
|
cmd += ["-vf", "crop=" + args.crop]
|
||||||
|
cmd += ["-b:a", preset["ba"], "-af", f"aformat=channel_layouts={preset['alayout']}", "-mapping_family", preset["mf"],
|
||||||
|
"-cpu-used", preset["cpu"], "-row-mt", "1", "-tiles", "2x2", args.output]
|
||||||
|
|
||||||
if args.dry:
|
if args.dry:
|
||||||
print(" ".join(cmd))
|
print(" ".join(cmd))
|
||||||
|
|
Loading…
Reference in New Issue