Audio and video to RAG: prepare passages with source timestamps
Turn a public recording into transcript passages your own search system can index. Each passage keeps its source URL and original time range. This tutorial covers transcription and the handoff to your index; it does not build an embedding service, search index or question-answering app.
I maintain the paid Audio & Video to RAG Actor. No speech-provider API key is required. Use your Apify account/token, supported MCP OAuth, or prepaid Apify access as described in the API guide.
1. Inspect the data before starting a run
Download the RAG input JSON and passage JSONL sample. The passages were derived offline by the existing exporter from this previously observed transcript of Google’s public speech sample. They are not a fresh hosted RAG run or an end-to-end retrieval benchmark.
The short non-diarized sample merges into one passage, p1, spanning original seconds 0–42.66. That is enough to inspect the export shape, not to evaluate search quality across a corpus. A new transcription may produce different text and timing.
2. Run the existing RAG preset
Open the podcast-to-RAG Task or paste this into the Actor’s Input JSON editor:
{
"urls": ["https://storage.googleapis.com/cloud-samples-data/speech/commercial_mono.wav"],
"timestamps": "segment",
"exportRag": true
}
This is a speech demo, not a podcast. For this first try, review the preset’s $0.10 maximum run charge, 4096 MiB and 180-second timeout. Check the active Pricing tab. The cap is a limit, not a quoted final cost; it can stop processing. Longer recordings need a suitable budget and timeout. maxTotalChargeUsd is a run option, not an input field. Keep the run ID instead of starting again if a response is lost.
For API or MCP, use the same input with the budgeted start/poll/retrieve flow in the API guide. Its downloadable scripts keep their transcript/subtitle defaults; set exportRag in a copy to request passages and retrieve JSONL separately.
3. Inspect every result, then download passages
After completion, open Dataset → RAG passages and source metadata, or inspect the JSON. Check error, stop_processing, billing and artifact_errors before forwarding text. SUCCEEDED alone does not mean all items are complete.
Each processed URL has its own row. Read rag_chunks, or download transcript-000.rag.jsonl from the run’s Storage. The number is the input URL’s zero-based position. If a row contains result_record_key, fetch that key from the same run’s KVS and read its value wrapper for the full result. A failed JSONL export can leave saved JSON available; inspect the existing run before retrying.
4. Preserve citation metadata in your index
| Passage field | Downstream mapping |
|---|---|
text |
Text to embed or index. |
source_url |
Original submitted recording URL. |
start_s, end_s |
Original source seconds to show beside a retrieved passage. |
id |
Local passage ID; namespace it by recording identity and processing version. |
language, speaker |
Optional metadata; retain when present. |
Choose your own embedding model and destination. Store source metadata alongside vectors/text. When your application retrieves a passage, display its recording and time range; player-specific timestamp links are your application’s job. Check generated answers against the passages and check recognition against audio.
Current chunking merges nearby same-speaker segments. It is not semantic chunking, a global-ID service or a guarantee of better retrieval. Speaker IDs across independent chunks do not establish the same person’s identity; inspect speaker_scope.
5. Use n8n for the same ingestion step
Import the inactive media-to-RAG workflow and follow the setup guide. Configure Apify Header Auth credentials, one media URL and a run budget. The template emits one item per passage at Export passages. Connect that node to your own embedding/indexing step; no Google Docs credential is needed for this workflow. Keep it inactive until your own source and destination pass. Live RAG indexing and answer-with-citations acceptance have not been established by the existing checks.
Use your own recordings
Supply individual public HTTPS recordings, not a channel or RSS-monitoring request. YouTube and other platform pages can fail because of blocking, login requirements, DRM or geography. Start with a direct media URL when diagnosing access failures. Selecting startTime/endTime keeps original source offsets but still downloads the source. New runs can repeat processing and charges; manage corpus updates and retries in your own system.
Audio goes to the selected ASR provider. Saved Apify results, caches and journals follow their own access/retention settings; local cleanup does not delete them. Review those settings before using sensitive recordings. See the advanced reference.
Other outputs: transcripts and subtitles
SRT/VTT, word timestamps and optional subtitle QA remain available. The older 36-second subtitle walkthrough below demonstrates those exports only; it does not show RAG indexing or search. Its original sample and acceptance evidence are preserved separately from this offline-derived RAG example.
36-second silent walkthrough with captions embedded in the video, using the public sample’s observed input and output. Download captions (VTT).