Pre-process video files to improve file transcription efficiency
The Paraformer speech recognition API is compatible with video files. However, video files are often large, which can slow down transfers. To improve efficiency, you can pre-process your video files to extract and compress only the audio track required for speech recognition. This reduces the file size, shortens transfer time for API calls, and increases transcription throughput.
Prerequisites
FFmpeg is installed.
Procedure
You can use FFmpeg to extract the first audio track from a video file, reduce the sampling rate to 16 kHz, and compress it into an OPUS file.
The resulting audio file is typically much smaller than the original video file. You can then submit this audio file to the file transcription API by specifying its URL to obtain the speech recognition results.
ffmpeg -i input-video-file -ac 1 -ar 16000 -acodec libopus output-audio-file.opusImprove file transcription efficiency and stability with OSS
Alibaba Cloud Object Storage Service (OSS) lets you easily generate URLs for files to use as API inputs. To improve transcription efficiency and stability, store your audio and video files in an OSS bucket in the same region as the Paraformer speech recognition API.
The Paraformer speech recognition file transcription API is currently deployed in the following region: China North 2 (Beijing, cn-beijing).
When you transcribe an OSS file in the same region, specify the file URL using the OSS bucket's internal same-region endpoint. This practice avoids unnecessary network traffic costs from OSS.
For more information about Object Storage Service (OSS), see OSS.