You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PaddleSpeech/demos/automatic_video_subtitiles/run.sh

21 lines
485 B

#!/bin/bash
video_url=https://paddlespeech.bj.bcebos.com/demos/asr_demos/subtitle_demo1.mp4
video_file=$(basename ${video_url})
audio_file=$(echo ${video_file} | awk -F'.' '{print $1}').wav
num_channels=1
sr=16000
# Download video
if [ ! -f ${video_file} ]; then
wget -c ${video_url}
fi
# Extract audio from video
if [ ! -f ${audio_file} ]; then
ffmpeg -i ${video_file} -ac ${num_channels} -ar ${sr} -vn ${audio_file}
fi
python -u recognize.py --input ${audio_file}
exit 0