Preserve channel resolution through continuity slates up to UHD
This commit is contained in:
@@ -17,13 +17,14 @@ def main():
|
||||
parser.add_argument('--ffmpeg', default='/usr/lib/jellyfin-ffmpeg/ffmpeg')
|
||||
parser.add_argument('--output', required=True)
|
||||
parser.add_argument('--long', action='store_true')
|
||||
parser.add_argument('--native', action='store_true')
|
||||
args = parser.parse_args()
|
||||
root = Path(args.output).resolve()
|
||||
if root.exists():
|
||||
raise ValueError('Choose a new output directory')
|
||||
samples, previous = [], {}
|
||||
with Path(str(root) + '.log').open('x') as log:
|
||||
process = subprocess.Popen([args.harness, '--long-continuity-e2e' if args.long else '--continuity-e2e', args.ffmpeg, str(root)], stdout=log,
|
||||
process = subprocess.Popen([args.harness, '--native-continuity-e2e' if args.native else '--long-continuity-e2e' if args.long else '--continuity-e2e', args.ffmpeg, str(root)], stdout=log,
|
||||
stderr=subprocess.STDOUT, start_new_session=True)
|
||||
deadline = time.monotonic() + 240
|
||||
try:
|
||||
@@ -58,7 +59,7 @@ def main():
|
||||
report = {'harness_exit_code': process.returncode, 'samples': samples,
|
||||
'scope': 'Only synthetic plugin source encoding; excludes fixture and player decoders'}
|
||||
(root / 'cpu-sample.json').write_text(json.dumps(report, indent=2))
|
||||
if process.returncode == 0 and args.long:
|
||||
if process.returncode == 0 and (args.long or args.native):
|
||||
subprocess.run(['python3', str(Path(__file__).with_name('verify-continuity-recording.py')), '--output', str(root), '--ffmpeg', args.ffmpeg], check=True)
|
||||
print(Path(str(root) + '.log').read_text()[-3500:])
|
||||
print(json.dumps({'exit_code': process.returncode, 'cpu_samples': len(samples),
|
||||
|
||||
@@ -12,7 +12,7 @@ import subprocess
|
||||
def pixels(ffmpeg, path, second=0):
|
||||
command = [ffmpeg, '-hide_banner', '-loglevel', 'error', '-nostdin', '-threads', '1', '-filter_threads', '1',
|
||||
'-ss', str(second), '-i', str(path), '-frames:v', '1', '-vf',
|
||||
'crop=1920:260:0:430,scale=640:86:flags=area', '-pix_fmt', 'gray', '-f', 'rawvideo', 'pipe:1']
|
||||
'scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,crop=1920:260:0:430,scale=640:86:flags=area', '-pix_fmt', 'gray', '-f', 'rawvideo', 'pipe:1']
|
||||
output = subprocess.run(command, capture_output=True, check=True, timeout=20).stdout
|
||||
if len(output) != 640 * 86:
|
||||
raise RuntimeError('Incomplete video frame')
|
||||
@@ -33,7 +33,7 @@ def verify(root, ffmpeg):
|
||||
retrying = pixels(ffmpeg, root / (language + '-retrying-slate.ts'))
|
||||
observed_waiting = pixels(ffmpeg, root / (language + '.mkv'), 1)
|
||||
observed_retrying = pixels(ffmpeg, root / (language + '.mkv'), 70)
|
||||
live = pixels(ffmpeg, root / (language + '.mkv'), 39)
|
||||
live = max((pixels(ffmpeg, root / (language + '.mkv'), at) for at in (18,22,26,30,34,38,42,46)), key=lambda frame: difference(retrying,frame))
|
||||
recovered = pixels(ffmpeg, root / (language + '.mkv'), 140)
|
||||
metrics = {'waiting_error': difference(waiting, observed_waiting),
|
||||
'retrying_error': difference(retrying, observed_retrying),
|
||||
|
||||
Reference in New Issue
Block a user