Sarmad Gardezi

Sarmad Gardezi

a freelance developer

How to Transcribe Video Files to Text with YouTube

S

ome times our professor give as a task to transcribe a audio or vudeo file of youtube He wrote – “We have some old lectures recorded on reel-to-reel tapes. We have digitized the audio lectures using Audacity and would now like to transcribe the audio and publish the lectures as text. What is the best way to proceed?”

When you upload a video file to YouTube, it will automatically generate subtitles or closed captions for that video. Google uses speech recognition to transform the speech portion of your video into closed captions that are displayed in the video player when the viewer hits the CC button (see screenshot).

If your video has decent audio quality and there not too many people speaking in the video at the same time, YouTube will automatically make a text transcript that may not be as accurate as human transcription but would do the job. The transcript is hidden inside obfuscated JavaScript but there’s a way to download it as plain text file.

How to Download Audio Transcriptions from Youtube

Here’s a quick guide on how to transcribe audio or video files to text with the help of YouTube.

  1. Go to youtube.com/upload and upload your video file. If you have an MP3 audio file, you may use a tool like Windows Movie Maker, iMovie on Mac or FFMpeg to convert the audio into a video file before uploading to YouTube.
  2. Wait for YouTube to completely process the video. The machine transcriptions may not immediately become available after uploading the video.
  3. Open the YouTube video page in Chrome and look for the CC button in the player. If it exists, the transcribed audio can be downloaded as text.
  4. Press F12 on Windows, or Option+Cmd+J on Mac, to open the JavaScript console inside Chrome Developer tools and paste this code:

if(yt.config_.TTS_URL.length) window.location.href=yt.config_.TTS_URL+"&kind=asr&fmt=srv1&lang=en"

It will open the transcribed text of the uploaded video in the current browser tab as shown in this short video. Save the file with a .html extension and double-click to view the transcription in plain text.

The same trick can help you download the closed captions of any video on YouTube even if you are not the uploader. And you can replace “en” in the URL with “fr” or “es” to download the transcriptions in another language.

You can also Download the audio transcription from YouTube as text


RELATED POSTS

Video Tutorials