OpenCV è una libreria orientata alla computer vision.Originariamente è stata sviluppata da Intel, mentre attualmente è sotto licenza open sourceBSD. Mi sto interessando da poco ad OpenCV, partendo dall'integrazione con FFmpeg, e quindi poter provare i filtri erode,dilate e smooth., anche se ho notato che il meglio lo fa da solo. Per farla breve ho deciso d'installare OpenCV su Debian Sid, per poi ricompilare FFmpeg con l'opzione –enable=libopencv.
Per ottenere un video come sopra entrano in gioco una serie di filtri con FFmpeg( movie, scale, setpts, overlay ). La finestra con il video più piccolo ha un anticipo di 3.6 secondi sul video principale, settato dall' opzione seek_point. Le misure si riferiscono a questo video specifico. FFmpeg……J'Adore
Aggiornamento al post fatto qualche tempo fa, su come riuscire a ruotare un video di 90-180-270 gradi, usando FFmpeg. Nell'esempio precedente si usava il filtro rotate, che adesso non c'è più, ed al suo posto c'è transpose:
Filters:
aconvert Convert the input audio to sample_fmt:channel_layout:packed_fmt.
aformat Convert the input audio to one of the specified formats.
anull Pass the source unchanged to the output.
aresample Resample audio data.
ashowinfo Show textual information for each audio frame.
earwax Widen the stereo image.
pan Remix channels with coefficients (panning)
volume Change input volume.
abuffer Buffer audio frames, and make them accessible to the filterchain.
aevalsrc Generate an audio signal generated by an expression.
amovie Read audio from a movie source.
anullsrc Null audio source, return empty audio frames.
abuffersink Buffer audio frames, and make them available to the end of the filter graph.
anullsink Do absolutely nothing with the input audio.
blackframe Detect frames that are (almost) black.
boxblur Blur the input.
copy Copy the input video unchanged to the output.
crop Crop the input video to width:height:x:y.
cropdetect Auto-detect crop size.
delogo Remove logo from input video.
deshake Stabilize shaky video.
drawbox Draw a colored box on the input video.
drawtext Draw text on top of video frames using libfreetype library.
fade Fade in/out input video
fieldorder Set the field order.
fifo Buffer input images and send them when they are requested.
format Convert the input video to one of the specified pixel formats.
frei0r Apply a frei0r effect.
gradfun Debands video quickly using gradients.
hflip Horizontally flip the input video.
hqdn3d Apply a High Quality 3D Denoiser.
lut Compute and apply a lookup table to the RGB/YUV input video.
lutrgb Compute and apply a lookup table to the RGB input video.
lutyuv Compute and apply a lookup table to the YUV input video.
mp libmpcodecs wrapper.
negate Negate input video.
noformat Force libavfilter not to use any of the specified pixel formats for the input to the next filter.
null Pass the source unchanged to the output.
overlay Overlay a video source on top of the input.
pad Pad input image to width:height[:x:y[:color]] (default x and y: 0, default color: black).
pixdesctest Test pixel format definitions.
scale Scale the input video to width:height size and/or convert the image format.
select Select frames to pass in output.
setdar Set the frame display aspect ratio.
setpts Set PTS for the output video frame.
setsar Set the pixel sample aspect ratio.
settb Set timebase for the output link.
showinfo Show textual information for each video frame.
slicify Pass the images of input video on to next video filter as multiple slices.
split Pass on the input to two outputs.
transpose Transpose input video.
unsharp Sharpen or blur the input video.
vflip Flip the input video vertically.
yadif Deinterlace the input image
buffer Buffer video frames, and make them accessible to the filterchain.
color Provide an uniformly colored input, syntax is: [color[:size[:rate]]]
frei0r_src Generate a frei0r source.
mandelbrot Mandelbrot fractal renderer
movie Read from a movie source.
mptestsrc Generate various test pattern.
nullsrc Null video source, return unprocessed video frames.
rgbtestsrc Generate RGB test pattern.
testsrc Generate test pattern.
buffersink Buffer video frames, and make them available to the end of the filter graph.
nullsink Do absolutely nothing with the input video.
Modi per fare Screencast con FFmpeg, ce ne sono molti, e si possono trovare nella categoria dedicata a FFmpeg. Questo è diverso dal solito, in quanto, lo screencast viene fatto nella zona del mouse, con un'ampiezza che noi possiamo chiaramente indicare. Di seguito 2 comandi, il primo si riferisce al video sopra, il secondo invece crea una specie di box visivo intorno al mouse.
Condivido pacchetti deb i386 e amd64, per Debian Squeeze/Sid, di FFmpeg compilato con l'aggiunta di molti filtri. Avendo fatto alcune guide, ed altre ne farò, sui filtri di FFmpeg, mi è sembrato giusto condividerli, con quei pochi che mi leggono
Debian Squeeze:
nella cartella ffmpeg-squeeze si trovano i 2 pacchetti, i386 ed amd64. Leggere il file README all'interno.
Delogo è un'altro filtro stupendo, e serve praticamente ad eliminare un logo da un video, ad esempio i loghi televisivi. Nel video sopra, praticamente viene rimosso il logo di canale 5, ed il comando sotto è relativo a questo video. Per usare il filtro delogo con FFmpeg, naturalmente bisogna averlo compilato con l'opzione –enable-filter=delogo. Usando mencoder, invece, il filtro delogo è presente di default.
Continuando con FFmpeg ed i suoi filtri, oggi tocca a drawbox, che serve ad inserire un box colorato in un video. Di seguito il comando che ho usato per il video sopra, da usare come base di partenza.
Un altro filtro che si può usare con FFmpeg oltre a quelli gia visti, è l'effetto dissolvenza (fade). Nel secondo video ho unito in un solo comando il filtro drawtext e fade.