
Advanced search
Medias (1)
-
The Great Big Beautiful Tomorrow
28 October 2011, by
Updated: October 2011
Language: English
Type: Text
Other articles (64)
-
Other interesting software
13 April 2011, byWe don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
We don’t know them, we didn’t try them, but you can take a peek.
Videopress
Website: http://videopress.com/
License: GNU/GPL v2
Source code: (...) -
Des sites réalisés avec MediaSPIP
2 May 2011, byCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Taille des images et des logos définissables
9 February 2011, byDans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)
On other websites (4358)
-
use AudioUnit of kAudioUnitType_FormatConverter type to resample LinearPCM data from FFmpeg
20 June 2016, by Willi’m trying to play audio use AudioUnit on iOS.Because the default sample rate is 44100 and i have several audio stream of different sample rate, such as 32000,48000 etc, so i tried to set preferredSampleRate and preferredIOBufferDuration of AVAudioSession according to the audio stream.
But i found it difficult to get a proper preferredIOBufferDuration according to the preferredSampleRate, it seemed that preferredIOBufferDuration must be set differently according to the preferredSampleRate, or there may be noise.
So now i’m trying to resample all kinds of audio stream to the default hardware sample rate(44100Hz) use AudioUnit of kAudioUnitType_FormatConverter.
I use AUGraph with FormatConverter unit and remoteIO unit to do this.And now it seems i set the kAudioUnitProperty_SampleRate for kAudioUnitScope_Output successfully(the kAudioUnitProperty_SampleRate property read back is indeed 44100.But there also is noise when the input audio stream is not 44100, while it sounds normal when the input audio stream is originally 44100 Hz. Everything seems the same as i didn’t use FormatConverter and directly stream data to remoteIO Unit(44100 is OK, while others not).
I wonder where is my problem.Does it not do the resampling at all, or is the output data wrong? Does anyone have experience of FormatConverter AudioUnit? Any help would be appreciated.
My AUGraph:
AUGraphConnectNodeInput(_processingGraph, converterNode, 0, remoteIONode, 0);
Converter unit: (input format is AV_SAMPLE_FMT_FLTP from FFMpeg)
UInt32 bytesPerFrame = bitsPerChannel / 8;
UInt32 bytesPerPacket = bytesPerFrame * 1;
AudioStreamBasicDescription streamDescription = {
.mSampleRate = spec->sample_rate,
.mFormatID = kAudioFormatLinearPCM,
.mFormatFlags = formatFlags,
.mChannelsPerFrame = spec->channels,
.mFramesPerPacket = 1,
.mBitsPerChannel = bitsPerChannel,
.mBytesPerFrame = bytesPerFrame,
.mBytesPerPacket = bytesPerPacket
};
status = AudioUnitSetProperty(converterUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &streamDescription, sizeof(streamDescription));
if (status != noErr) {
NSLog(@"AudioUnit: failed to set stream format (%d)", (int)status);
}
/* input callback */
AURenderCallbackStruct renderCallback;
renderCallback.inputProc = performRender;
renderCallback.inputProcRefCon = (__bridge void *)self;
AUGraphSetNodeInputCallback(_processingGraph, converterNode, 0, &renderCallback);Converter unit output sample rate:
Float64 sampleRate = 44100.0;
AudioUnitSetProperty(converterUnit, kAudioUnitProperty_SampleRate, kAudioUnitScope_Output, 0, &sampleRate, sizeof(sampleRate));i also tried
AudioStreamBasicDescription outStreamDescription = {
.mSampleRate = 44100.0,
.mFormatID = kAudioFormatLinearPCM,
.mFormatFlags = formatFlags,
.mChannelsPerFrame = spec->channels,
.mFramesPerPacket = 1,
.mBitsPerChannel = bitsPerChannel,
.mBytesPerFrame = bytesPerFrame,
.mBytesPerPacket = bytesPerPacket
};
status = AudioUnitSetProperty(converterUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &outStreamDescription, sizeof(outStreamDescription));but seemed no difference.
-
Finding Optimal Code Coverage
7 March 2012, by Multimedia Mike — ProgrammingA few months ago, I published a procedure for analyzing code coverage of the test suites exercised in FFmpeg and Libav. I used it to add some more tests and I have it on good authority that it has helped other developers fill in some gaps as well (beginning with students helping out with the projects as part of the Google Code-In program). Now I’m wondering about ways to do better.
Current Process
When adding a test that depends on a sample (like a demuxer or decoder test), it’s ideal to add a sample that’s A) small, and B) exercises as much of the codebase as possible. When I was studying code coverage statistics for the WC4-Xan video decoder, I noticed that the sample didn’t exercise one of the 2 possible frame types. So I scouted samples until I found one that covered both types, trimmed the sample down, and updated the coverage suite.I started wondering about a method for finding the optimal test sample for a given piece of code, one that exercises every code path in a module. Okay, so that’s foolhardy in the vast majority of cases (although I was able to add one test spec that pushed a module’s code coverage from 0% all the way to 100% — but the module in question only had 2 exercisable lines). Still, given a large enough corpus of samples, how can I find the smallest set of samples that exercise the complete codebase?
This almost sounds like an NP-complete problem. But why should that stop me from trying to find a solution?
Science Project
Here’s the pitch:- Instrument FFmpeg with code coverage support
- Download lots of media to exercise a particular module
- Run FFmpeg against each sample and log code coverage statistics
- Distill the resulting data in some meaningful way in order to obtain more optimal code coverage
That first step sounds harsh– downloading lots and lots of media. Fortunately, there is at least one multimedia format in the projects that tends to be extremely small: ANSI. These are files that are designed to display elaborate scrolling graphics using text mode. Further, the FATE sample currently deployed for this test (TRE_IOM5.ANS) only exercises a little less than 50% of the code in libavcodec/ansi.c. I believe this makes the ANSI video decoder a good candidate for this experiment.
Procedure
First, find a site that hosts a lot ANSI files. Hi, sixteencolors.net. This site has lots (on the order of 4000) artpacks, which are ZIP archives that contain multiple ANSI files (and sometimes some other files). I scraped a list of all the artpack names.In an effort to be responsible, I randomized the list of artpacks and downloaded periodically and with limited bandwidth (
'wget --limit-rate=20k'
).Run ‘gcov’ on ansi.c in order to gather the full set of line numbers to be covered.
For each artpack, unpack the contents, run the instrumented FFmpeg on each file inside, run ‘gcov’ on ansi.c, and log statistics including the file’s size, the file’s location (artpack.zip:filename), and a comma-separated list of line numbers touched.
Definition of ‘Optimal’
The foregoing procedure worked and yielded useful, raw data. Now I have to figure out how to analyze it.I think it’s most desirable to have the smallest files (in terms of bytes) that exercise the most lines of code. To that end, I sorted the results by filesize, ascending. A Python script initializes a set of all exercisable line numbers in ansi.c, then iterates through each each file’s stats line, adding the file to the list of candidate samples if its set of exercised lines can remove any line numbers from the overall set of lines. Ideally, that set of lines should devolve to an empty set.
I think a second possible approach is to find the single sample that exercises the most code and then proceed with the previously described method.
Initial Results
So far, I have analyzed 13324 samples from 357 different artpacks provided by sixteencolors.net.Using the first method, I can find a set of samples that covers nearly 80% of ansi.c:
<br />
0 bytes: bad-0494.zip:5<br />
1 bytes: grip1293.zip:-ANSI---.---<br />
1 bytes: pur-0794.zip:.<br />
2 bytes: awe9706.zip:-ANSI───.───<br />
61 bytes: echo0197.zip:-(ART)-<br />
62 bytes: hx03.zip:HX005.DAT<br />
76 bytes: imp-0494.zip:IMPVIEW.CFG<br />
82 bytes: ice0010b.zip:_cont'd_.___<br />
101 bytes: bdp-0696.zip:BDP2.WAD<br />
112 bytes: plain12.zip:--------.---<br />
181 bytes: ins1295v.zip:-°VGA°-. н<br />
219 bytes: purg-22.zip:NEM-SHIT.ASC<br />
289 bytes: srg1196.zip:HOWTOREQ.JNK<br />
315 bytes: karma-04.zip:FASHION.COM<br />
318 bytes: buzina9.zip:ox-rmzzy.ans<br />
411 bytes: solo1195.zip:FU-BLAH1.RIP<br />
621 bytes: ciapak14.zip:NA-APOC1.ASC<br />
951 bytes: lght9404.zip:AM-TDHO1.LIT<br />
1214 bytes: atb-1297.zip:TX-ROKL.ASC<br />
2332 bytes: imp-0494.zip:STATUS.ANS<br />
3218 bytes: acepak03.zip:TR-STAT5.ANS<br />
6068 bytes: lgc-0193.zip:LGC-0193.MEM<br />
16778 bytes: purg-20.zip:EZ-HIR~1.JPG<br />
20582 bytes: utd0495.zip:LT-CROW3.ANS<br />
26237 bytes: quad0597.zip:MR-QPWP.GIF<br />
29208 bytes: mx-pack17.zip:mx-mobile-source-logo.jpg<br />
----<br />
109440 bytes total<br />A few notes about that list: Some of those filenames are comprised primarily of control characters. 133t, and all that. The first file is 0 bytes. I wondered if I should discard 0-length files but decided to keep those in, especially if they exercise lines that wouldn’t normally be activated. Also, there are a few JPEG and GIF files in the set. I should point out that I forced the tty demuxer using
-f tty
and there isn’t much in the way of signatures for this format. So, again, whatever exercises more lines is better.Using this same corpus, I tried approach 2– which single sample exercises the most lines of the decoder? Answer: blde9502.zip:REQUEST.EXE. Huh. I checked it out and ‘file’ ID’s it as a MS-DOS executable. So, that approach wasn’t fruitful, at least not for this corpus since I’m forcing everything through this narrow code path.
Think About The Future
Where can I take this next? The cloud! I have people inside the search engine industry who have furnished me with extensive lists of specific types of multimedia files from around the internet. I also see that Amazon Web Services Elastic Compute Cloud (AWS EC2) instances don’t charge for incoming bandwidth.I think you can see where I’m going with this.
See Also:
-
lavf/srtdec: rewrite parsing logic
22 December 2015, by Clément Bœschlavf/srtdec: rewrite parsing logic
Fixes Ticket #5032
The samples in Ticket #5032 is using \r\r\n as line breaks. Since we
already are handling \r, or \n, or \r\n as line breaks, \r\n\n will be
considered as a double line breaks. This is an issue because
ff_subtitles_read_text_chunk() will as a result stop extracting a chunk
after just one line.So instead of parsing the SRT by "chunks" (which means splitting every
double LB), this new parser is detecting timing lines, and split the
events on this basis. While this sounds safe and simple, it needs to
take into account the event number preceding the timing line while
handling situations such as:- event number starting at 0 or actually any number instead of 1
- event numbers not being ordered at all
- event number being followed by text garbage (this really happened,
see Ticket #4898)
- event payload containing one or multiple number (a protagonist saying
a count-down, a date or whatever) which could be confused with a
chapter number
- event number being empty (see Ticket #2167)
- all kind of weird line breaks can appear randomly like wild pokémons
- untrustable line breaks (Ticket #5032)The sample madness.srt tries to sum up most of this into one sample,
ticket5032-rrn.srt is the file containing \r\r\n line breaks. and
empty-events-2167.srt contains empty events.