Created
January 30, 2026 11:29
-
-
Save dcolinmorgan/d42088ff4793a1d75d449e59311db41d to your computer and use it in GitHub Desktop.
meeting vid > takeaway notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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