$ ffmpeg -i input.wav -af 'volume=0.5' output.wav
Nesse caso, o volume é diminuido pela metade.
$ ffmpeg -i input.wav -af 'volume=0.5' output.wav
$ ffmpeg -ss 00:02:10 -i video.mp4 -to 00:01:20 -c copy cut.mp4
$ ffmpeg -i a.mp4 -vf "scale=360:480 [inScale]; \
color=c=black@1.0:s=720x480:r=29.75:d=9.0 [bg];\
movie=b.mp4, scale=360:480 [vid2]; \
[bg] [vid2] overlay=360:0 [basis1]; \
[basis1] [inScale] overlay=0:0" out.mp4
$ ffmpeg -i a.mp4 -vf "scale=720:240 [inScale]; \ color=c=black@1.0:s=720x480:r=29.75:d=9.0 [bg];\ movie=b.mp4, scale=
720:240
[vid2]; \ [bg] [vid2] overlay=0:240 [basis1]; \ [basis1] [inScale] overlay=0:0" out.mp4
$ ffmpeg -i a.mp4 -vf "scale=360:240 [inScale]; \ color=c=black@1.0:s=720x480:r=29.75:d=9.0 [bg];\ movie=b.mp4, scale=360:240 [vid2]; \ movie=c.mp4, scale=360:240 [vid3]; \ movie=d.mp4, scale=360:240 [vid4]; \ [bg] [vid2] overlay=360:0 [basis1]; \ [basis1] [vid3] overlay=0:240 [basis2]; \ [basis2] [vid4] overlay=360:240 [basis3]; \ [basis3] [inScale] overlay=0:0" out.mp4
#include "Python.h"
#include "math.h"
#include "numpy/ndarraytypes.h"
#include "numpy/ufuncobject.h"
// Estrutura usada para descrever um método de um tipo de extensão.
static PyMethodDef MinhasufuncsMethods[] = {
{NULL, NULL, 0, NULL}
};
//Função 1
static void double_FtoERB(char **args, npy_intp *dimensions,
npy_intp* steps, void* data)
{
npy_intp i;
npy_intp n = dimensions[0];
char *in = args[0], *out = args[1];
npy_intp in_step = steps[0], out_step = steps[1];
for (i = 0; i < n; i++) {
*((double *)out) = 24.7 * (4.37 * 1E-3 * (*(double *)in) + 1.);
in += in_step;
out += out_step;
}
}
// Função 2
static void double_sinc(char **args, npy_intp *dimensions,
npy_intp* steps, void* data)
{
npy_intp i;
npy_intp n = dimensions[0];
char *in = args[0], *out = args[1];
npy_intp in_step = steps[0], out_step = steps[1];
for (i = 0; i < n; i++) {
*((double *)out) = sin((*(double *)in)) / (*(double *)in) ;
in += in_step;
out += out_step;
}
}
// Estes são ponteiros para as funções acima
PyUFuncGenericFunction FtoERBfuncs[1] = {&double_FtoERB};
PyUFuncGenericFunction sincfuncs[1] = {&double_sinc};
// Estes são as entradas e retorna os dtypes
static char FtoERBtypes[2] = {NPY_DOUBLE, NPY_DOUBLE};
static char sinctypes[2] = {NPY_DOUBLE, NPY_DOUBLE};
static void *FtoERBdata[1] = {NULL};
static void *sincdata[1] = {NULL};
// Inicializa o módulo "minhasufuncs"
PyMODINIT_FUNC initminhasufuncs(void)
{
PyObject *m, *FtoERB, *sinc, *d;
m = Py_InitModule("minhasufuncs", MinhasufuncsMethods);
if (m == NULL) {
return;
}
import_array();
import_umath();
FtoERB = PyUFunc_FromFuncAndData(FtoERBfuncs, FtoERBdata, FtoERBtypes, 1, 1, 1,
PyUFunc_None, "FtoERB",
"FtoERB_docstring", 0);
sinc = PyUFunc_FromFuncAndData(sincfuncs, sincdata, sinctypes, 1, 1, 1,
PyUFunc_None, "sinc",
"sinc_docstring", 0);
d = PyModule_GetDict(m);
PyDict_SetItemString(d, "FtoERB", FtoERB);
Py_DECREF(FtoERB);
PyDict_SetItemString(d, "sinc", sinc);
Py_DECREF(sinc);
}
def configuration(parent_package='', top_path=None):
import numpy
from numpy.distutils.misc_util import Configuration
config = Configuration('',
parent_package,
top_path)
config.add_extension('minhasufuncs', ['minhasufuncs.c'])
return config
if __name__ == "__main__":
from numpy.distutils.core import setup
setup(configuration=configuration)
$ python setup.py build_ext --inplace
# -*- coding: utf-8 -*-
#/usr/bin/python
import numpy as np
import minhasufuncs
import matplotlib.pyplot as mpl
x1 = np.linspace(-30,30,8000)
y1 = minhasufuncs.sinc(x1)
x2 = np.linspace(0,8000,8000)
y2 = minhasufuncs.FtoERB(x2)
mpl.figure(figsize=(7,12))
mpl.subplot(211)
mpl.plot(x1,y1,'k',lw=2)
mpl.grid()
mpl.subplot(212)
mpl.plot(x2,y2,'k',lw=2)
mpl.grid()
mpl.savefig('minhasufuncs.png')