To get crop geometry:
ffmpeg -i input.mkv -vf cropdetect=24:16:0 dummy.mkv
...
[Parsed_cropdetect_0 @ 0x3704360] x1:0 x2:639 y1:43 y2:317 w:640 h:272 x:0 y:46 pts:181320 t:181.320000 crop=640:272:0:46
...
As part of my professional duties, I have been tasked with developing a desktop application to analyze audio files. This desktop application would need to be work across platforms (Windows, macOS and Ubuntu), and I cannot rely on dependencies having already been installed (such as Python itself). Naturally I turned to Qt (and more specifically, Qt for Python) due to its capabilities for creating GUI applications that work across OSs. As I could not be dependent on the end user having Python installed (so no deploying a wheel and calling it good), I decided it may be worth trying to make native installers (deb
packages for linux, .app
bundles and .dmg
files for macOS, and setup.exe
files for Windows).
In short, here were the objectives I aimed to have
ffmpeg
is a command line utility that presents a API to interacting with a variety of media types/encodings in a uniform fashion.
Depending on the ffmpeg
distribiont, you may get access to utilities such as ffprobe
(which provides information on a file) and ffplay
(will play back a file). Those tools are critical.
Those tools, by default, will show all the arguments that ffmpeg
was compiled with, which can get a little verbose. If you're going to run many ffmpeg commands, I suggest you get used to passing the -hide_banner
argument.
import argparse | |
import importlib | |
import inspect | |
from collections import deque | |
from typing import Any, List, Set, Tuple | |
def get_nested_members(module, predicate=None) -> List[Tuple[str, Any]]: | |
return [ | |
module_info | |
for module_info in inspect.getmembers(module, predicate=predicate) |
from pyqtgraph.Qt import QtWidgets | |
import weakref | |
import gc | |
class MyButton(QtWidgets.QPushButton): | |
def __init__(self, *args, **kwds): | |
super().__init__(*args, **kwds) | |
self.clicked.connect(lambda : self.hello()) | |
# self.clicked.connect(lambda: QtWidgets.QApplication.instance().exit()) | |
# self.clicked.connect(self.hello) |
from PySide6 import QtCore, QtGui | |
import shiboken6 | |
import numpy as np | |
from time import perf_counter | |
class Points: | |
def __init__(self, use_drawNp): | |
self.use_drawNp = use_drawNp | |
self.alloc(0) |
import itertools | |
import functools | |
def compare(a, b): | |
if isinstance(a, int) and isinstance(b, int): | |
if a < b: | |
return True | |
elif a > b: | |
return False | |
else: |