Skip to content

Extracting Audio from Video

The Arc XP Audio API can accept MP4 video files as input and automatically extract the audio track. Use this when you have video content and need a standalone audio version, for example, publishing a video interview as a podcast episode or creating an audio clip from a recorded presentation.

MP4 processing steps

When you upload an MP4 file to any upload endpoint, the API automatically:

  1. Detects the video container format.
  2. Extracts the audio track, discarding the video stream.
  3. Encodes the extracted audio according to your organization’s configured encoding profile (see the developer guide for details).
  4. Follows the same processing lifecycle as a regular audio upload.

You do not need any special parameters or headers; the API handles video-to-audio extraction transparently.

Supported input formats

FormatExtensionNotes
WAV.wavRecommended for highest quality source audio
MP3.mp3Recommended bit rate of at least 128kbps
FLAC.flacLossless compressed audio
M4A.m4aAAC audio in MP4 container
MP4.mp4Video container: audio track extracted automatically

Example: audio clip from video

1. Create an audio clip record

Terminal window
curl -X POST https://api.[org].arcpublishing.com/audiocenter/api/editorial/v1/clips/ \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Conference Keynote (Audio)",
"description": "Audio extracted from the recorded keynote presentation.",
"tags": ["conference", "keynote"]
}'

Save the content_id from the response. In the following examples, use that same value anywhere the URL shows {audio_id}.

2. Upload the MP4 file

Upload the video file exactly as you would an audio file, using the presigned-URL flow (recommended for large video files, since it uploads directly to storage instead of routing the file through the API server). First, request a presigned upload URL:

Terminal window
curl -X POST "https://api.[org].arcpublishing.com/audiocenter/api/editorial/v1/clips/{audio_id}/upload/presigned?file_name=keynote.mp4" \
-H "Authorization: Bearer YOUR_API_TOKEN"

The response includes an upload_url for the direct upload and a notification_url for processing updates. Upload the file bytes to the returned URL as a second step:

Terminal window
curl -X PUT "PRESIGNED_UPLOAD_URL" \
-H "Content-Type: audio/mp3" \
--upload-file /path/to/your/file.mp3

The presigned URL’s signature covers Content-Type: audio/{extension}, where extension denotes the file extension you passed as file_name (for example, audio/wav, audio/flac, audio/m4a, or audio/mp4 for a video file uploaded for audio extraction). This value must match the Content-Type header on your PUT request exactly, or the upload fails with a signature error.

The API extracts the audio track, begins processing, and discards the video data.

3. Monitor processing

To receive real-time updates on extraction and encoding progress, subscribe to the notification_url returned with the presigned response. It streams Server-Sent Events (SSE) with progress notifications such as encoding_started, encoding_analyzing, and encoding_complete (or encoding_failed).

4. Publish

Once processing completes and the clip is in ready state:

Terminal window
curl -X POST https://api.[org].arcpublishing.com/audiocenter/api/editorial/v1/clips/{audio_id}/publish \
-H "Authorization: Bearer YOUR_API_TOKEN"

Example: podcast episode from video

You can also upload MP4 files directly as podcast episode audio. This is common when repurposing video interviews or recorded sessions as podcast episodes.

1. Create the episode

Terminal window
curl -X POST https://api.[org].arcpublishing.com/audiocenter/api/editorial/v1/podcasts/{podcast_id}/episodes \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Interview with Jane Doe",
"description": "Audio from our recorded video interview."
}'

2. Upload the MP4

Request a presigned upload URL:

Terminal window
curl -X POST "https://api.[org].arcpublishing.com/audiocenter/api/editorial/v1/podcasts/{podcast_id}/episodes/{episode_guid}/upload/presigned?file_name=interview.mp4" \
-H "Authorization: Bearer YOUR_API_TOKEN"

The response includes an upload_url for the direct upload and a notification_url for processing updates. Upload the file bytes to the returned URL as a second step:

Terminal window
curl -X PUT "PRESIGNED_UPLOAD_URL" \
-H "Content-Type: audio/mp3" \
--upload-file /path/to/your/file.mp3

The presigned URL’s signature covers Content-Type: audio/{extension}, where extension denotes the file extension you passed as file_name (for example, audio/wav, audio/flac, audio/m4a, or audio/mp4 for a video file uploaded for audio extraction). This value must match the Content-Type header on your PUT request exactly, or the upload fails with a signature error.

3. Publish the episode

Terminal window
curl -X POST https://api.[org].arcpublishing.com/audiocenter/api/editorial/v1/podcasts/{podcast_id}/episodes/{episode_guid}/publish \
-H "Authorization: Bearer YOUR_API_TOKEN"

Tips

  • Video files are typically much larger than audio files. The presigned-URL flow shown above uploads directly to storage rather than through the API server, which is especially important for large files.
  • The quality of the extracted audio depends on the audio track in the source video. If the source video’s audio track has a low bit rate, the extracted audio will reflect that.
  • The API only produces audio renditions; it discards the video stream during processing and does not store it.