Skip to content

Instantly share code, notes, and snippets.

@dcolinmorgan
Created January 30, 2026 11:29
Show Gist options
  • Select an option

  • Save dcolinmorgan/d42088ff4793a1d75d449e59311db41d to your computer and use it in GitHub Desktop.

Select an option

Save dcolinmorgan/d42088ff4793a1d75d449e59311db41d to your computer and use it in GitHub Desktop.
meeting vid > takeaway notes
#!/usr/bin/env python3
import subprocess
import sys
import os
def rip_audio(mp4_path):
audio_path = mp4_path.rsplit('.', 1)[0] + '.wav'
subprocess.run(['ffmpeg', '-i', mp4_path, '-vn', '-acodec', 'pcm_s16le', '-ar', '16000', audio_path, '-y'], check=True)
return audio_path
def transcribe(audio_path):
result = subprocess.run(['mlx_whisper', audio_path], capture_output=True, text=True, check=True)
return result.stdout
def llm_process(prompt, text):
full_prompt = f"{prompt}\n\n{text}"
result = subprocess.run(['mlx_lm.generate', '--prompt', full_prompt, '--max-tokens', '2000'],
capture_output=True, text=True, check=True)
return result.stdout
if __name__ == '__main__':
if len(sys.argv) != 2:
print("Usage: python process_meeting.py <input.mp4>")
sys.exit(1)
mp4 = sys.argv[1]
base = mp4.rsplit('.', 1)[0]
print("Extracting audio...")
audio = rip_audio(mp4)
print("Transcribing...")
transcript = transcribe(audio)
print("Generating formatted document...")
doc1 = llm_process("Can you reformat this transcribed text to a normal document type via markdown?", transcript)
with open(f"{base}_formatted.md", 'w') as f:
f.write(doc1)
print("Generating takeaways document...")
doc2 = llm_process("Can you make a followup doc reorganizing the meeting to highlight takeaways for team", transcript)
with open(f"{base}_takeaways.md", 'w') as f:
f.write(doc2)
print(f"Done! Created {base}_formatted.md and {base}_takeaways.md")
os.remove(audio)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment