One folder per meeting (out/<name>/source.*, transcript.txt, meta.json, logs/), out/_global; speaker transcript from DB; throwaway Edge profile; skip shots only when all images exist
This commit is contained in:
+3
-3
@@ -16,7 +16,7 @@ ap.add_argument("--screen", action="store_true", help="also record screen to mp4
|
||||
ap.add_argument("--name", default=time.strftime("meet_%Y-%m-%dT%H-%M-%S"))
|
||||
ap.add_argument("--seconds", type=float, help="auto-stop after N seconds")
|
||||
a = ap.parse_args()
|
||||
out = Path(__file__).parent / "out"; out.mkdir(exist_ok=True)
|
||||
out = Path(__file__).parent / "out" / a.name; out.mkdir(parents=True, exist_ok=True) # out/<name>/source.mp4 + source.wav
|
||||
SR = 16000
|
||||
|
||||
def to16k(x, ch, sr):
|
||||
@@ -41,7 +41,7 @@ def record():
|
||||
if a.screen:
|
||||
ff = subprocess.Popen(["ffmpeg", "-y", "-f", "gdigrab", "-framerate", "15", "-i", "desktop",
|
||||
"-c:v", "libx264", "-preset", "ultrafast", "-pix_fmt", "yuv420p",
|
||||
str(out / f"{a.name}.mp4")], stdin=subprocess.PIPE,
|
||||
str(out / "source.mp4")], stdin=subprocess.PIPE,
|
||||
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
print("Recording... Ctrl+C to stop")
|
||||
try:
|
||||
@@ -57,7 +57,7 @@ def record():
|
||||
n = max(len(m) for m in mix)
|
||||
y = sum(np.pad(m, (0, n - len(m))) for m in mix)
|
||||
y = np.clip(y, -1, 1)
|
||||
path = out / f"{a.name}.wav"
|
||||
path = out / "source.wav"
|
||||
with wave.open(str(path), "wb") as w:
|
||||
w.setnchannels(1); w.setsampwidth(2); w.setframerate(SR)
|
||||
w.writeframes((y * 32767).astype(np.int16).tobytes())
|
||||
|
||||
Reference in New Issue
Block a user