mirror of
https://github.com/master-of-zen/Av1an.git
synced 2024-11-25 02:29:40 +00:00
no console spam for rav1e target_vmaf
This commit is contained in:
parent
180863a52c
commit
0f744b0ce4
1 changed files with 16 additions and 3 deletions
|
@ -12,7 +12,9 @@ from matplotlib import pyplot as plt
|
||||||
import matplotlib
|
import matplotlib
|
||||||
import sys
|
import sys
|
||||||
from math import isnan
|
from math import isnan
|
||||||
|
import os
|
||||||
|
from .bar import make_pipes
|
||||||
|
from subprocess import PIPE, STDOUT
|
||||||
|
|
||||||
def x264_probes(video: Path, ffmpeg: str):
|
def x264_probes(video: Path, ffmpeg: str):
|
||||||
cmd = f' ffmpeg -y -hide_banner -loglevel error -i {video.as_posix()} ' \
|
cmd = f' ffmpeg -y -hide_banner -loglevel error -i {video.as_posix()} ' \
|
||||||
|
@ -41,7 +43,7 @@ def probe_cmd(probe, q, ffmpeg_pipe, encoder):
|
||||||
cmd = f'{pipe} {params}{q} -o {probe.with_name(f"v_{q}{probe.stem}")}.ivf - '
|
cmd = f'{pipe} {params}{q} -o {probe.with_name(f"v_{q}{probe.stem}")}.ivf - '
|
||||||
|
|
||||||
elif encoder == 'rav1e':
|
elif encoder == 'rav1e':
|
||||||
params = "rav1e - -s 10 --tiles 8 --quantizer "
|
params = "rav1e - -q -s 10 --tiles 8 --quantizer "
|
||||||
cmd = f'{pipe} {params}{q} -o {probe.with_name(f"v_{q}{probe.stem}")}.ivf'
|
cmd = f'{pipe} {params}{q} -o {probe.with_name(f"v_{q}{probe.stem}")}.ivf'
|
||||||
|
|
||||||
return cmd
|
return cmd
|
||||||
|
@ -99,7 +101,18 @@ def plot_probes(args, vmaf_cq, vmaf_target, probe, frames):
|
||||||
def vmaf_probe(probe, q, args):
|
def vmaf_probe(probe, q, args):
|
||||||
|
|
||||||
cmd = probe_cmd(probe, q, args.ffmpeg_pipe, args.encoder)
|
cmd = probe_cmd(probe, q, args.ffmpeg_pipe, args.encoder)
|
||||||
subprocess.run(cmd, shell=True)
|
if args.encoder =='rav1e':
|
||||||
|
# temp to prevent console spam
|
||||||
|
f, e = cmd.split('|')
|
||||||
|
f, e = f.split(), e.split()
|
||||||
|
|
||||||
|
ffmpeg_pipe = subprocess.Popen(f, stdout=PIPE, stderr=STDOUT)
|
||||||
|
pipe = subprocess.Popen(e, stdin=ffmpeg_pipe.stdout, stdout=PIPE,
|
||||||
|
stderr=STDOUT,
|
||||||
|
universal_newlines=True)
|
||||||
|
pipe.wait()
|
||||||
|
else:
|
||||||
|
subprocess.run(cmd, shell=True)
|
||||||
|
|
||||||
file = call_vmaf(probe, gen_probes_names(probe, q), args.n_threads, args.vmaf_path)
|
file = call_vmaf(probe, gen_probes_names(probe, q), args.n_threads, args.vmaf_path)
|
||||||
score = read_vmaf_json(file, 25)
|
score = read_vmaf_json(file, 25)
|
||||||
|
|
Loading…
Reference in a new issue