OUTPUT #662 | 5428 karakter | 164 satır
Welcome to Ubuntu 24.04.1 LTS (GNU/Linux 6.8.0-139-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/pro
System information as of Wed Sep 16 08:31:52 PM +03 2026
System load: 0.18 Processes: 250
Usage of /: 56.9% of 66.98GB Users logged in: 1
Memory usage: 26% IPv4 address for ens160: 213.238.170.219
Swap usage: 3%
* Canonical Workshop gives developers fast, composable, reproducible, and
secure developer environments that are perfect for agentic workflows.
https://ubuntu.com/workshop
Expanded Security Maintenance for Applications is not enabled.
144 updates can be applied immediately.
To see these additional updates run: apt list --upgradable
16 additional security updates can be applied with ESM Apps.
Learn more about enabling ESM Apps service at https://ubuntu.com/esm
*** System restart required ***
Last login: Wed Sep 16 20:30:40 2026 from 88.253.69.213
root@213-238-170-219:~# temiz; rg -n -C 12 "contact_sheet|ffmpeg|fps=|tile=" /home/hermes/.hermes/skills/media/shorts-core/scripts/shorts_fast_pipeline.py
========== YENİ KOMUT | 16.09.2026 20:31:56 ==========
1-#!/usr/bin/env python3
2-import argparse
3-import hashlib
4-import json
5-import math
6-import re
7-import subprocess
8-from pathlib import Path
9-from PIL import Image
10-
11-VERSION = 1
12-
13:FFMPEG = "/usr/bin/ffmpeg"
14-FFPROBE = "/usr/bin/ffprobe"
15-EDGE_TTS = "/home/hermes/.hermes/tools/edge-tts/.venv/bin/edge-tts"
16-GOOGLE_TTS = "/home/hermes/.hermes/tools/google-tts/google_tts.py"
17-
18-def run(cmd, *, capture=False):
19- r = subprocess.run(
20- cmd,
21- check=True,
22- text=True,
23- stdout=subprocess.PIPE if capture else None,
24- stderr=subprocess.PIPE if capture else None,
25- )
--
289- cmd += ["-i", str(Path(shot["src"]))]
290-
291- filters = []
292- labels = []
293- for i, (shot, d) in enumerate(zip(shots, durations)):
294- start = float(shot.get("in", 0.0))
295- filters.append(
296- f"[{i}:v]"
297- f"trim=start={start}:duration={d},"
298- f"setpts=PTS-STARTPTS,"
299- f"scale=1080:1920:force_original_aspect_ratio=increase,"
300- f"crop=1080:1920,"
301: f"fps=30,"
302- f"format=yuv420p[v{i}]"
303- )
304- labels.append(f"[v{i}]")
305-
306- filters.append(
307- "".join(labels)
308- + f"concat=n={len(labels)}:v=1:a=0,"
309- + f"ass={Path(ass)},format=yuv420p[v]"
310- )
311-
312- cmd += [
313- "-filter_complex", ";".join(filters),
--
354- "-af", "loudnorm=I=-16:TP=-1.5:LRA=11:print_format=json",
355- "-f", "null", "-"
356- ], text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
357- (work / "loudness.log").write_text(loud.stderr, encoding="utf-8")
358-
359- duration = probe_duration(final)
360- frames = 6
361- fps = frames / max(duration, 0.1)
362- run([
363- FFMPEG, "-y", "-v", "error",
364- "-i", str(final),
365- "-vf",
366: f"fps={fps:.6f}:start_time=0.5:round=near,"
367- "scale=360:640:flags=lanczos,"
368: "tile=3x2:margin=0:padding=0",
369- "-frames:v", "1",
370: str(work / "final_contact_sheet.jpg")
371- ])
372-
373-def main():
374- ap = argparse.ArgumentParser()
375- ap.add_argument("manifest")
376- args = ap.parse_args()
377-
378- manifest_path = Path(args.manifest).resolve()
379- m = json.loads(manifest_path.read_text(encoding="utf-8"))
380-
381- work = Path(m.get("workdir", manifest_path.parent / "build")).resolve()
382- work.mkdir(parents=True, exist_ok=True)
--
517- final_info = {"sig": final_sig, "video_md5": final_md5}
518- final_meta.write_text(
519- json.dumps(final_info, ensure_ascii=False, indent=2),
520- encoding="utf-8"
521- )
522- else:
523- final_md5 = final_info["video_md5"]
524-
525- qa_sig = stamp([final], "deterministic-final-qa-v1")
526- qa_meta = work / ".qa.json"
527- cached_qa = False
528-
529: if qa_meta.exists() and (work / "final_contact_sheet.jpg").exists():
530- try:
531- cached_qa = json.loads(
532- qa_meta.read_text(encoding="utf-8")
533- ).get("sig") == qa_sig
534- except Exception:
535- pass
536-
537- if not cached_qa:
538- qa(final, work)
539- qa_meta.write_text(
540- json.dumps({"sig": qa_sig, "pass": True}, indent=2),
541- encoding="utf-8"
542- )
543-
544- result = {
545- "pass": True,
546- "version": VERSION,
547- "cached_tts": cached_tts,
548- "cached_visual": cached_visual,
549- "cached_final": cached_final,
550- "cached_qa": cached_qa,
551- "duration": probe_duration(final),
552- "final": str(final),
553: "contact_sheet": str(work / "final_contact_sheet.jpg"),
554- "video_md5": final_md5,
555- }
556- (work / "pipeline_result.json").write_text(
557- json.dumps(result, ensure_ascii=False, indent=2),
558- encoding="utf-8"
559- )
560- print(json.dumps(result, ensure_ascii=False))
561-
562-if __name__ == "__main__":
563- main()
root@213-238-170-219:~#