Skip to content

Instantly share code, notes, and snippets.

@james-see
Created May 20, 2024 23:35
Show Gist options
  • Save james-see/01b954e20a0fa62a01a099b32ac55d2d to your computer and use it in GitHub Desktop.
Save james-see/01b954e20a0fa62a01a099b32ac55d2d to your computer and use it in GitHub Desktop.
download and transcribe videos in one script
#!/bin/bash
# What: quick workflow to headless get a video's text and timestamps for each chunk
# brew install yt-dlp
yt-dlp https://www.youtube.com/watch\?v\=LGkASsEBAiY -o ufo-cbs-video.mp4
# brew install ffmpeg
ffmpeg -i ufo-cbs-video.mp4.webm -q:a 0 -map a cbs-transcribed.mp3
# pip install git+https://github.com/openai/whisper.git
whisper cbs-transcribed.mp3
### example output
# [06:50.140 --> 06:55.660] So one of the things that you've been active in Washington has been dealing with UFOs.
# [06:55.660 --> 07:00.820] You've established the all-domain anomaly restoration office.
# [07:00.820 --> 07:05.700] I wonder what you could tell me about that, and I know that the report found that while
# [07:05.700 --> 07:10.740] they were able to explain some of the things that the army and other people are reporting,
# [07:10.740 --> 07:15.220] there were 171 unexplained situations.
# [07:15.220 --> 07:16.220] Way more than that now.
# [07:16.220 --> 07:21.980] So the most recent report that I got is they've looked at about 800, as opposed to the first
# [07:21.980 --> 07:27.660] group of 300, unidentified aerial or anomalous phenomenon, because some's in air and some's
# [07:27.660 --> 07:29.820] in water.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment