From a74069b7f251a0a3bfe99dae7050ce7f8608a20f Mon Sep 17 00:00:00 2001 From: tth Date: Sun, 1 Nov 2020 19:32:45 +0100 Subject: [PATCH] bla --- ao_example.c | 4 ++-- chap/image.tex | 40 ++++++++++++++++++++++++++++++++++++++-- chap/video.tex | 8 ++++++++ chap/webcam.tex | 10 +++++++++- 4 files changed, 57 insertions(+), 5 deletions(-) diff --git a/ao_example.c b/ao_example.c index c306ee7..328fc5e 100644 --- a/ao_example.c +++ b/ao_example.c @@ -41,7 +41,7 @@ format.rate = 44100; format.byte_format = AO_FMT_LITTLE; /* -- Open driver -- */ -device = ao_open_live(default_driver, &format, NULL /* no options */); +device = ao_open_live(default_driver, &format, NULL); if (device == NULL) { fprintf(stderr, "Error opening device.\n"); return 1; @@ -53,7 +53,7 @@ buffer = calloc(buf_size, sizeof(char)); for (i = 0; i < format.rate; i++) { sample = (int)(0.75 * 32768.0 * - sin(2 * M_PI * freq * ((float) i/format.rate))); + sin(2 * M_PI * freq * ((float) i/format.rate))); /* Put the same stuff in left and right channel */ buffer[4*i] = buffer[4*i+2] = sample & 0xff; diff --git a/chap/image.tex b/chap/image.tex index 2946720..a46aa77 100644 --- a/chap/image.tex +++ b/chap/image.tex @@ -5,11 +5,47 @@ \section{ImageMagick}\index{ImageMagick} -Attention, ça va devenir \textsl{hardu}\dots +Attention, ça va devenir \textsl{hardu}% +\footnote{Nous attendons tous avec impatience l'ouvrage de Brunus}, +l'abondance d'options +des outils imagemagick est vraiment énorme, et leurs +interactions parfois troublantes\dots + +\subsection{Écrire du texte} + +Voici un exemple concret +(tiré du script d'encodage du \textsc{cloître}\index{cloître}) +qui montre l'essentiel pour bien débuter. C'est une fonction +écrite en bash\index{bash} qui rajoute un texte sur une image : + +\begin{verbatim} +function tagpic +{ +infile="$1" +outfile="$2" +texte="$3" + +txtfont=" -font Utopia " +fontsize=" -pointsize 96 -kerning 6 " +color=" -fill Gray20 -stroke White " +txtopts=" -antialias -alpha off $txtfont " + +convert $infile \ + ${txtopts} \ + ${txtfont} ${fontsize} \ + ${color} \ + -gravity South \ + -annotate +0+85 "${texte}" \ + $outfile +} +\end{verbatim} + +Quelques explications... + % ------------------------------------------------------------------- - +\section{Gmic}\index{Gmic} diff --git a/chap/video.tex b/chap/video.tex index 5bef961..358845f 100644 --- a/chap/video.tex +++ b/chap/video.tex @@ -1,6 +1,10 @@ \chapter{Vidéo} \label{chap:video} +Le traitement de la vidéo, c'est vraiment compliqué : entre +les multiples \textsl{codec} et les multiples \textsl{containers}, +on est rapidement perdu. Voici donc quelques recettes de cuisine +à appliquer avec modération (et respect des gestes barrières). % -------------------------------------------------------------------- @@ -108,6 +112,10 @@ ffmpeg -nostdin \ wip.mp4 \end{verbatim} +\subsection{Questions} + +Quand on encode images+son, comment arreter au plus court des deux ? + % -------------------------------------------------------------------- \section{Autres trucs} diff --git a/chap/webcam.tex b/chap/webcam.tex index e7d2bb4..423720d 100644 --- a/chap/webcam.tex +++ b/chap/webcam.tex @@ -3,7 +3,7 @@ % -------------------------------------------------------------------- \chapter{Webcam} -\label{webcam} +\label{chap:webcam} \index{webcam} Sous Linux, c'est quand même un peu tordu, dans le même genre @@ -12,6 +12,14 @@ simple : juste tenter de prendre une photo avec une \textsl{webcam} classique en USB, et d'enregistrer cette image. +% -------------------------------------------------------------------- + +\section{v4l2}\index{v4l2} + +\textsl{Video For Linux, second edition.} + +% -------------------------------------------------------------------- + \section{vgrabbj} \index{vgrabbj}