Extract audio from video

Extract the audio track from video files for transcription, analysis, or processing.

Audio · Notebook · Updated

Colab runs it in your browser. If it calls a model provider, it asks for that provider's API key in a cell.

How it works

You use the extract_audio function to create an audio column from video. This integrates seamlessly with transcription and other audio processing.

What it covers

  • Extract audio from video as a computed column
  • Choose audio format (mp3, wav, flac)
  • Chain with transcription for automatic video-to-text

What it uses

Install
terminal
pip install pixeltable 'numpy<2.4' openai-whisper
Pixeltable calls
video.extract_audio()whisper.transcribe()pxt.create_table()add_computed_column()insert()

A look at the code

audio-extract-from-video.ipynb
# Add computed column to extract audio as MP3
videos.add_computed_column(
audio=extract_audio(videos.video, format='mp3')
)

One cell of the notebook, copied as it is. Open it in Colab for the rest.

Browse all 103