
Recherche avancée
Autres articles (81)
-
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...) -
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...) -
Récupération d’informations sur le site maître à l’installation d’une instance
26 novembre 2010, parUtilité
Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)
Sur d’autres sites (5285)
-
Revision 36914 : On affiche si ffmpeg-php est correctement installé avec quelques ...
4 avril 2010, par kent1@… — LogOn affiche si ffmpeg-php est correctement installé avec quelques information sur son installation
les options de taille et de audiorate ne marchent pas dans les pressets de ffmpeg ... on doit les laisser dans la ligne de commande du script
On ajoute deux filtres pour les codecs issus des métadatas des flv -
Visualizing Call Graphs Using Gephi
1er septembre 2014, par Multimedia Mike — GeneralWhen I was at university studying computer science, I took a basic chemistry course. During an accompanying lab, the teaching assistant chatted me up and asked about my major. He then said, “Computer science ? Well, that’s just typing stuff, right ?”
My impulsive retort : “Sure, and chemistry is just about mixing together liquids and coming up with different colored liquids, as seen on the cover of my high school chemistry textbook, right ?”
In fact, pure computer science has precious little to do with typing (as is joked in CS circles, computer science is about computers in the same way that astronomy is about telescopes). However, people who study computer science often pursue careers as programmers, or to put it in fancier professional language, software engineers.
So, what’s a software engineer’s job ? Isn’t it just typing ? That’s where I’ve been going with this overly long setup. After thinking about it for long enough, I like to say that a software engineer’s trade is managing complexity.
A few years ago, I discovered Gephi, an open source tool for graph and data visualization. It looked neat but I didn’t have much use for it at the time. Recently, however, I was trying to get a better handle on a large codebase. I.e., I was trying to manage the project’s complexity. And then I thought of Gephi again.
Prior Work
One way to get a grip on a large C codebase is to instrument it for profiling and extract details from the profiler. On Linux systems, this means compiling and linking the code using the -pg flag. After running the executable, there will be a gmon.out file which is post-processed using the gprof command.GNU software development tools have a reputation for being rather powerful and flexible, but also extremely raw. This first hit home when I was learning how to use the GNU tool for code coverage — gcov — and the way it outputs very raw data that you need to massage with other tools in order to get really useful intelligence.
And so it is with gprof output. The output gives you a list of functions sorted by the amount of processing time spent in each. Then it gives you a flattened call tree. This is arranged as “during the profiled executions, function c was called by functions a and b and called functions d, e, and f ; function d was called by function c and called functions g and h”.
How can this call tree data be represented in a more instructive manner that is easier to navigate ? My first impulse (and I don’t think I’m alone in this) is to convert the gprof call tree into a representation suitable for interpretation by Graphviz. Unfortunately, doing so tends to generate some enormous and unwieldy static images.
Feeding gprof Data To Gephi
I learned of Gephi a few years ago and recalled it when I developed an interest in gaining better perspective on a large base of alien C code. To understand what this codebase is doing for a particular use case, instrument it with gprof, gather execution data, and then study the code paths.How could I feed the gprof data into Gephi ? Gephi supports numerous graphing formats including an XML-based format named GEXF.
Thus, the challenge becomes converting gprof output to GEXF.
Demonstration
I have been absent from FFmpeg development for a long time, which is a pity because a lot of interesting development has occurred over the last 2-3 years after a troubling period of stagnation. I know that 2 big video codec developments have been HEVC (next in the line of MPEG codecs) and VP9 (heir to VP8’s throne). FFmpeg implements them both now.I decided I wanted to study the code flow of VP9. So I got the latest FFmpeg code from git and built it using the options
"--extra-cflags=-pg --extra-ldflags=-pg"
. Annoyingly, I also needed to specify"--disable-asm"
because gcc complains of some register allocation snafus when compiling inline ASM in profiling mode (and this is on x86_64). No matter ; ASM isn’t necessary for understanding overall code flow.After compiling, the binary ‘ffmpeg_g’ will have symbols and be instrumented for profiling. I grabbed a sample from this VP9 test vector set and went to work.
./ffmpeg_g -i vp90-2-00-quantizer-00.webm -f null /dev/null gprof ./ffmpeg_g > vp9decode.txt convert-gprof-to-gexf.py vp9decode.txt > /bigdisk/vp9decode.gexf
Gephi loads vp9decode.gexf with no problem. Using Gephi, however, can be a bit challenging if one is not versed in any data exploration jargon. I recommend this Gephi getting starting guide in slide deck form. Here’s what the default graph looks like :
Not very pretty or helpful. BTW, that beefy arrow running from mid-top to lower-right is the call from decode_coeffs_b -> iwht_iwht_4x4_add_c. There were 18774 from the former to the latter in this execution. Right now, the edge thicknesses correlate to number of calls between the nodes, which I’m not sure is the best representation.
Following the tutorial slide deck, I at least learned how to enable the node labels (function symbols in this case) and apply a layout algorithm. The tutorial shows the force atlas layout. Here’s what the node neighborhood looks like for probing file type :
Okay, so that’s not especially surprising– avprobe_input_format3 calls all of the *_probe functions in order to automatically determine input type. Let’s find that decode_coeffs_b function and see what its neighborhood looks like :
That’s not very useful. Perhaps another algorithm might help. I select the Fruchterman–Reingold algorithm instead and get a slightly more coherent representation of the decoding node neighborhood :
Further Work
Obviously, I’m just getting started with this data exploration topic. One thing I would really appreciate in such a tool is the ability to interactively travel the graph since that’s what I’m really hoping to get out of this experiment– watching the code flows.Perhaps someone else can find better use cases for visualizing call graph data. Thus, I have published the source code for this tool at Github.
-
'C' program to pipeout audio file to FFMPEG and generate Video file
9 mai 2017, par soflowI am attempting to write a short ’C’ program which reads in an Audio file using FFMPEG, processes that file using a ’C’ program, and then outputs a file via FFMEPG, which combines the new, modified audio together with a Video representation using the FFMPEG showwaves filter.
At present the program attempts to do the following :-
i) Read in an audio file, using pipein thorugh FFMPEG
ii) Process the audio file using a portion of the ’C’ program
iii) Pipeout the modified audio to FFMPEG, and generate a file using the ’showwaves’ filter in FFMEPG to create an MP4 file with audio and video.The following code run form the ommand line in FFMPEG generates the Audio/Video MP4 I want to create :-
ffmpeg -y -f s16le -ar 44100 -ac 1 -i 12345678.wav -i 12345678.wav -filter_complex "[0:a]showwaves=s=1280x720:mode=line:rate=25,format=yuv420p[v]" -map "[v]" -map 1:a:0 -codec:v libx264 -crf 21 -bf 2 -flags +cgop -pix_fmt yuv420p -codec:a aac -strict -2 -b:a 384k -r:a 48000 -movflags faststart 12345678.mp4
"
This code generates a processed audio file, and outputs it to a .wav file as required :-
#include
#include
#include
void main()
{
// Launch two instances of FFmpeg, one to read the original WAV
// file and another to write the modified WAV file. In each case,
// data passes between this program and FFmpeg through a pipe.
FILE *pipein;
FILE *pipeout;
pipein = popen("ffmpeg -i 12345678.wav -f s16le -ac 1 -", "r");
pipeout = popen("ffmpeg -y -f s16le -ar 44100 -ac 1 -i - out.wav", "w");
// Read, modify and write one sample at a time
int16_t sample;
int count, n=0;
while(1)
{
count = fread(&sample, 2, 1, pipein); // read one 2-byte sample
if (count != 1) break;
++n;
sample = sample * sin(n * 5.0 * 2*M_PI / 44100.0);
fwrite(&sample, 2, 1, pipeout);
}
// Close input and output pipes
pclose(pipein);
pclose(pipeout);
}(This code borrowed from ted Burke’s excellent post here)
I have made an attempt as shown below, but this is not working :-
#include
#include
#include
void main()
{
// Launch two instances of FFmpeg, one to read the original WAV
// file and another to write the modified WAV file. In each case,
// data passes between this program and FFmpeg through a pipe.
FILE *pipein;
FILE *pipeout;
pipein = popen("ffmpeg -i 12345678.wav -f s16le -ac 1 -", "r");
pipeout = popen("ffmpeg -y -f s16le -ar 44100 -ac 1 -i 12345678.wav -i
12345678.wav -filter_complex "
[0:a]showwaves=s=1280x720:mode=line:rate=25,format=yuv420p[v]" -map "[v]"
-map 1:a:0 -codec:v libx264 -crf 21 -bf 2 -flags +cgop -pix_fmt yuv420p -
codec:a aac -strict -2 -b:a 384k -r:a 48000 -movflags faststart
12345678.mp4
", "w");
// Read, modify and write one sample at a time
int16_t sample;
int count, n=0;
while(1)
{
count = fread(&sample, 2, 1, pipein); // read one 2-byte sample
if (count != 1) break;
++n;
sample = sample * sin(n * 5.0 * 2*M_PI / 44100.0);
fwrite(&sample, 2, 1, pipeout);
}
// Close input and output pipes
pclose(pipein);
pclose(pipeout);
}Ideally someone can suggest an improved version of the pipeout command above - alternately another process to achieve this would be interesting
* EDIT *
Thanks to @Mulvya, the revised pipeout line is now :-
pipeout = popen("ffmpeg -y -f s16le -ar 44100 -ac 1 -i - -filter_complex "[0:a]showwaves=s=1280x720:mode=line:rate=25,format=yuv420p[v]" -map "[v]" -map 1:a:0 -codec:v libx264 -crf 21 -bf 2 -flags +cgop -pix_fmt yuv420p -codec:a aac -strict -2 -b:a 384k -r:a 48000 -movflags faststart 12345678.mp4
", "w") ;
On compiling with gcc I get the following error messages :-
avtovid2.c: In function \u2018main\u2019:
wavtovid2.c:13:83: error: expected \u2018]\u2019 before \u2018:\u2019
token
pipeout = popen("ffmpeg -y -f s16le -ar 44100 -ac 1 -i - -
filter_complex "
[0:a]showwaves=s=1280x720:mode=line:rate=25,format=yuv420p[v]" -map "[v]"
-map 1:a:0 -codec:v libx264 -crf 21 -bf 2 -flags +cgop -pix_fmt yuv420p -
codec:a aac -strict -2 -b:a 384k -r:a 48000 -movflags faststart
12345678.mp4
^
wavtovid2.c:13:86: error: expected \u2018)\u2019 before
\u2018showwaves\u2019
pipeout = popen("ffmpeg -y -f s16le -ar 44100 -ac 1 -i - -
filter_complex "
[0:a]showwaves=s=1280x720:mode=line:rate=25,format=yuv420p[v]" -map "[v]"
-map 1:a:0 -codec:v libx264 -crf 21 -bf 2 -flags +cgop -pix_fmt yuv420p -
codec:a aac -strict -2 -b:a 384k -r:a 48000 -movflags faststart
12345678.mp4
^
wavtovid2.c:13:98: error: invalid suffix "x720" on integer constant
pipeout = popen("ffmpeg -y -f s16le -ar 44100 -ac 1 -i - -
filter_complex "
[0:a]showwaves=s=1280x720:mode=line:rate=25,format=yuv420p[v]" -map "[v]"
-map 1:a:0 -codec:v libx264 -crf 21 -bf 2 -flags +cgop -pix_fmt yuv420p -
codec:a aac -strict -2 -b:a 384k -r:a 48000 -movflags faststart
12345678.mp4
^
wavtovid2.c:13:153: warning: missing terminating " character
pipeout = popen("ffmpeg -y -f s16le -ar 44100 -ac 1 -i - -
filter_complex "
[0:a]showwaves=s=1280x720:mode=line:rate=25,format=yuv420p[v]" -map "[v]"
-map 1:a:0 -codec:v libx264 -crf 21 -bf 2 -flags +cgop -pix_fmt yuv420p -
codec:a aac -strict -2 -b:a 384k -r:a 48000 -movflags faststart
12345678.mp4
^
wavtovid2.c:13:86: error: missing terminating " character
pipeout = popen("ffmpeg -y -f s16le -ar 44100 -ac 1 -i - -
filter_complex "
[0:a]showwaves=s=1280x720:mode=line:rate=25,format=yuv420p[v]" -map "[v]"
-map 1:a:0 -codec:v libx264 -crf 21 -bf 2 -flags +cgop -pix_fmt yuv420p -
codec:a aac -strict -2 -b:a 384k -r:a 48000 -movflags faststart
12345678.mp4
^
wavtovid2.c:14:6: warning: missing terminating " character
", "w");
^
wavtovid2.c:14:1: error: missing terminating " character
", "w");
^
wavtovid2.c:13:21: warning: passing argument 1 of \u2018popen\u2019 makes
pointer from integer without a cast
pipeout = popen("ffmpeg -y -f s16le -ar 44100 -ac 1 -i - -
filter_complex "
[0:a]showwaves=s=1280x720:mode=line:rate=25,format=yuv420p[v]" -map "[v]"
-map 1:a:0 -codec:v libx264 -crf 21 -bf 2 -flags +cgop -pix_fmt yuv420p -
codec:a aac -strict -2 -b:a 384k -r:a 48000 -movflags faststart
12345678.mp4
^
In file included from wavtovid2.c:1:0:
/usr/include/stdio.h:872:14: note: expected \u2018const char *\u2019 but
argument is of type \u2018char\u2019
extern FILE *popen (const char *__command, const char *__modes) __wur;
^
wavtovid2.c:13:15: error: too few arguments to function \u2018popen\u2019
pipeout = popen("ffmpeg -y -f s16le -ar 44100 -ac 1 -i - -
filter_complex "
[0:a]showwaves=s=1280x720:mode=line:rate=25,format=yuv420p[v]" -map "[v]"
-map 1:a:0 -codec:v libx264 -crf 21 -bf 2 -flags +cgop -pix_fmt yuv420p -
codec:a aac -strict -2 -b:a 384k -r:a 48000 -movflags faststart
12345678.mp4
^
In file included from wavtovid2.c:1:0:
/usr/include/stdio.h:872:14: note: declared here
extern FILE *popen (const char *__command, const char *__modes) __wur;
^
wavtovid2.c:32:1: error: expected \u2018;\u2019 before \u2018}\u2019
token
}