
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (31)
-
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...) -
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Pas question de marché, de cloud etc...
10 avril 2011Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
sur le web 2.0 et dans les entreprises qui en vivent.
Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...)
Sur d’autres sites (5154)
-
Using gcovr with FFmpeg
6 septembre 2010, par Multimedia Mike — FATE ServerWhen I started investigating code coverage tools to analyze FFmpeg, I knew there had to be an easier way to do what I was trying to do (obtain code coverage statistics on a macro level for the entire project). I was hoping there was a way to ask the GNU gcov tool to do this directly. John K informed me in the comments of a tool called gcovr. Like my tool from the previous post, gcovr is a Python script that aggregates data collected by gcov. gcovr proves to be a little more competent than my tool.
Results
Here is the spreadsheet of results, reflecting FATE code coverage as of this writing. All FFmpeg source files are on the same sheet this time, including header files, sorted by percent covered (ascending), then total lines (descending).Methodology
I wasn’t easily able to work with the default output from the gcovr tool. So I modified it into a tool called gcovr-csv which creates data that spreadsheets can digest more easily.- Build FFmpeg using the
'-fprofile-arcs -ftest-coverage'
in both the extra cflags and extra ldflags configuration options 'make'
'make fate'
- From build directory :
'gcovr-csv > output.csv'
- Massage the data a bit, deleting information about system header files (assuming you don’t care how much of /usr/include/stdlib.h is covered — 66%, BTW)
Leftovers
I became aware of some spreadsheet limitations thanks to this tool :- OpenOffice can’t process percent values correctly– it imports the percent data from the CSV file but sorts it alphabetically rather than numerically.
- Google Spreadsheet expects CSV to really be comma-delimited– forget about any other delimiters. Also, line length is an issue which is why I needed my tool to omit the uncovered ine number ranges, which it does in its default state.
- Build FFmpeg using the
-
FFmpeg and Code Coverage Tools
21 août 2010, par Multimedia Mike — FATE Server, PythonCode coverage tools likely occupy the same niche as profiling tools : Tools that you’re supposed to use somewhere during the software engineering process but probably never quite get around to it, usually because you’re too busy adding features or fixing bugs. But there may come a day when you wish to learn how much of your code is actually being exercised in normal production use. For example, the team charged with continuously testing the FFmpeg project, would be curious to know how much code is being exercised, especially since many of the FATE test specs explicitly claim to be "exercising XYZ subsystem".
The primary GNU code coverage tool is called gcov and is probably already on your GNU-based development system. I set out to determine how much FFmpeg source code is exercised while running the full FATE suite. I ran into some problems when trying to use gcov on a project-wide scale. I spackled around those holes with some very ad-hoc solutions. I’m sure I was just overlooking some more obvious solutions about which you all will be happy to enlighten me.
Results
I’ve learned to cut to the chase earlier in blog posts (results first, methods second). With that, here are the results I produced from this experiment. This Google spreadsheet contains 3 sheets : The first contains code coverage stats for a bunch of FFmpeg C files sorted first by percent coverage (ascending), then by number of lines (descending), thus highlighting which files have the most uncovered code (ffserver.c currently tops that chart). The second sheet has files for which no stats were generated. The third sheet has "problems". These files were rejected by my ad-hoc script.Here’s a link to the data in CSV if you want to play with it yourself.
Using gcov with FFmpeg
To instrument a program for gcov analysis, compile and link the target program with the -fprofile-arcs and -ftest-coverage options. These need to be applied at both the compile and link stages, so in the case of FFmpeg, configure with :./configure \ —extra-cflags="-fprofile-arcs -ftest-coverage" \ —extra-ldflags="-fprofile-arcs -ftest-coverage"
The building process results in a bunch of .gcno files which pertain to code coverage. After running the program as normal, a bunch of .gcda files are generated. To get coverage statistics from these files, run
'gcov sourcefile.c'
. This will print some basic statistics as well as generate a corresponding .gcov file with more detailed information about exactly which lines have been executed, and how many times.Be advised that the source file must either live in the same directory from which gcov is invoked, or else the path to the source must be given to gcov via the
'-o, --object-directory'
option.Resetting Statistics
Statistics in the .gcda are cumulative. Should you wish to reset the statistics, doing this in the build directory should suffice :find . -name "*.gcda" | xargs rm -f
Getting Project-Wide Data
As mentioned, I had to get a little creative here to get a big picture of FFmpeg code coverage. After building FFmpeg with the code coverage options and running FATE,for file in `find . -name "*.c"` \ do \ echo "*****" $file \ gcov -o `dirname $file` `basename $file` \ done > ffmpeg-code-coverage.txt 2>&1
After that, I ran the ffmpeg-code-coverage.txt file through a custom Python script to print out the 3 CSV files that I later dumped into the Google Spreadsheet.
Further Work
I’m sure there are better ways to do this, and I’m sure you all will let me know what they are. But I have to get the ball rolling somehow.There’s also TestCocoon. I’d like to try that program and see if it addresses some of gcov’s shortcomings (assuming they are indeed shortcomings rather than oversights).
Source for script : process-gcov-slop.py
PYTHON :-
# !/usr/bin/python
-
-
import re
-
-
lines = open("ffmpeg-code-coverage.txt").read().splitlines()
-
no_coverage = ""
-
coverage = "filename, % covered, total lines\n"
-
problems = ""
-
-
stats_exp = re.compile(’Lines executed :(\d+\.\d+)% of (\d+)’)
-
for i in xrange(len(lines)) :
-
line = lines[i]
-
if line.startswith("***** ") :
-
filename = line[line.find(’./’)+2 :]
-
i += 1
-
if lines[i].find(":cannot open graph file") != -1 :
-
no_coverage += filename + ’\n’
-
else :
-
while lines[i].find(filename) == -1 and not lines[i].startswith("***** ") :
-
i += 1
-
try :
-
(percent, total_lines) = stats_exp.findall(lines[i+1])[0]
-
coverage += filename + ’, ’ + percent + ’, ’ + total_lines + ’\n’
-
except IndexError :
-
problems += filename + ’\n’
-
-
open("no_coverage.csv", ’w’).write(no_coverage)
-
open("coverage.csv", ’w’).write(coverage)
-
open("problems.csv", ’w’).write(problems)
-
-
Brute Force Dimensional Analysis
15 juillet 2010, par Multimedia Mike — Game Hacking, PythonI was poking at the data files of a really bad (is there any other kind ?) interactive movie video game known simply by one letter : D. The Sega Saturn version of the game is comprised primarily of Sega FILM/CPK files, about which I wrote the book. The second most prolific file type bears the extension ’.dg2’. Cursory examination of sample files revealed an apparently headerless format. Many of the video files are 288x144 in resolution. Multiplying that width by that height and then doubling it (as in, 2 bytes/pixel) yields 82944, which happens to be the size of a number of these DG2 files. Now, if only I had a tool that could take a suspected raw RGB file and convert it to a more standard image format.
Here’s the FFmpeg conversion recipe I used :
ffmpeg -f rawvideo -pix_fmt rgb555 -s 288x144 -i raw_file -y output.png
So that covers the files that are suspected to be 288x144 in dimension. But what about other file sizes ? My brute force approach was to try all possible dimensions that would yield a particular file size. The Python code for performing this operation is listed at the end of this post.
It’s interesting to view the progression as the script compresses to different sizes :
That ’D’ is supposed to be red. So right away, we see that rgb555(le) is not the correct input format. Annoyingly, FFmpeg cannot handle rgb555be as a raw input format. But this little project worked well enough as a proof of concept.
If you want to toy around with these files (and I know you do), I have uploaded a selection at : http://multimedia.cx/dg2/.
Here is my quick Python script for converting one of these files to every acceptable resolution.
work-out-resolution.py :
PYTHON :-
# !/usr/bin/python
-
-
import commands
-
import math
-
import os
-
import sys
-
-
FFMPEG = "/path/to/ffmpeg"
-
-
def convert_file(width, height, filename) :
-
outfile = "%s-%dx%d.png" % (filename, width, height)
-
command = "%s -f rawvideo -pix_fmt rgb555 -s %dx%d -i %s -y %s" % (FFMPEG, width, height, filename, outfile)
-
commands.getstatusoutput(command)
-
-
if len(sys.argv) <2 :
-
print "USAGE : work-out-resolution.py <file>"
-
sys.exit(1)
-
-
filename = sys.argv[1]
-
if not os.path.exists(filename) :
-
print filename + " does not exist"
-
sys.exit(1)
-
-
filesize = os.path.getsize(filename) / 2
-
-
limit = int(math.sqrt(filesize)) + 1
-
for i in xrange(1, limit) :
-
if filesize % i == 0 and filesize & 1 == 0 :
-
convert_file(i, filesize / i, filename)
-
convert_file(filesize / i, i, filename)
-