Ετήσια αρχεία: 2020


Apply low pass and high pass frequency filter using ffmpeg

Just a quick example that applies both a high pass and a low pass frequency filter to a video file using ffmpeg

ffmpeg -i input.mp4 -filter:a "highpass=f=200, lowpass=f=3000" output.mp4;

The frequency is set in Hz so in this example we are filtering out all frequencies that are out of [200, 3000].


Increase volume in video using ffmpeg 2

A quick note on how to boost the audio stream in a video using the volume filter in ffmpeg

#;For newer versions of ffmpeg
ffmpeg -i input.mkv -filter:a "volume=4.0" output.mkv;
#For older versions of ffmpeg (we use multiples of 256)
ffmpeg -i input.mkv -vol 1024 -vcodec copy output.mkv;

Using the above command we were able to make the audio LOUDER!


Ubuntu 18.04 and VOSK Speech Recognition API

Just some quick notes on how to install and use VOSK on Ubuntu 18.04 LTS.

  1. Install using: pip3 install vosk
  2. Get samples from https://github.com/alphacep/vosk-api/tree/master/python/example
  3. Using ffmpeg create input audio files ffmpeg -i video.mkv -c:a pcm_s16le -ac 1 output.wav
    It will create a file of the following type output.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 48000 Hz
  4. Export text to JSON python3 ./test_simple.py output.wav