Skip to content
Advertisement

Tag: ffmpeg

Python loadarff fails for string attributes

I am trying to load an arff file using Python’s ‘loadarff’ function from scipy.io.arff. The file has string attributes and it is giving the following error. How to read the arff successfully? Answer Since SciPy’s loadarff converts containings of arff file into NumPy array, it does not support strings as attributes. In 2020, you can use liac-arff package. However, make

Split audio files using silence detection

I’ve more than 200 MP3 files and I need to split each one of them by using silence detection. I tried Audacity and WavePad but they do not have batch processes and it’s very slow to make them one by one. The scenario is as follows: split track whereas silence 2 seconds or more then add 0.5 s at the

Hide ffmpeg’s console window when running YoutubeDL in GUI application

I’m developing a basic application which can download YouTube videos. Throughout the development, I had several quirks, including issues with formats. I decided to use a hopefully foolproof format syntax that youtube-dl will happily download for me in almost any case. Part of my YoutubeDL options look like this: The outtmpl is inserted later on when output folder is chosen

Using ffmpeg to obtain video durations in python

I’ve installed ffprobe using the pip ffprobe command on my PC, and installed ffmpeg from here. However, I’m still having trouble running the code listed here. I try to use the following code unsuccessfully. Does anyone know what’s wrong? Am I not referencing the directories correctly? Do I need to make sure the .py and video files are in a

Terminal text becomes invisible after terminating subprocess

After terminating an ffmpeg subprocess, the terminal gets messed up – typed characters are invisible! The input still works in that commands can be executed, but keyboard input is not echoed to the terminal. Issuing shell command reset puts everything back to normal (or !reset from within ipython), so a workaround the issue is calling os.system(‘reset’) inside the script. Other

Pipe raw OpenCV images to FFmpeg

Here’s a fairly straightforward example of reading off a web cam using OpenCV’s python bindings: Now I want to pipe the output to ffmpeg as in: $ python capture.py | ffmpeg -f image2pipe -pix_fmt bgr8 -i – -s 640×480 foo.avi Sadly, I can’t get the ffmpeg magic incantation quite right and it fails with libavutil 50.15. 1 / 50.15. 1

Advertisement