
Recherche avancée
Médias (1)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (75)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)
Sur d’autres sites (10405)
-
How to apply audio equalization using NAudio
19 mai 2021, par Raheel KhanI have a WPF app that does the following :


- 

- Imports video files.
- Extracts audio from the using FFmpeg.
- Resamples the audio using NAudio to conform to a Speech-to-Text engine (16kHz/16bit/Mono).
- Plays back the video for users with overlayed subtitles.
- Allows users to correct mistakes that the STT engine might have made.












Simple resampling with NAudio :


using (var reader = new WaveFileReader(fileAudioTemp.FullName))
{
 var outFormat = new WaveFormat(16000, 16, 1);
 //var outFormat = WaveFormat.CreateIeeeFloatWaveFormat(16000, 1);

 using (var resampler = new MediaFoundationResampler(reader, outFormat))
 {
 resampler.ResamplerQuality = 60; // Highest Quality in MF.
 WaveFileWriter.CreateWaveFile(fileAudio.FullName, resampler);
 }
}



The problem is that these videos have extremely bad audio quality. The sound is muffled, bassy, and makes it very difficult to make out names of people, places, etc. This makes it difficult and time-consuming for users to proof the text. Please do note that the STT engine has no problem with this and is surprisingly accurate considering the quality.


What I would like to do is apply an equalization present to this audio. I found that the built-in
SKA
preset in VLC seems to make it 'slightly' easier for users to understand what is being said.



Is there a way to use either FFmpeg (Xabe) or preferably NAudio to apply such a filter ? Is so how ? I have seen many examples out there about manipulation of sound buffers but was looking for an easier way such as a preset file or parameters that could be passed into the resamplers.


Any pointers would be appreciated.


-
Add, remove and tune filters on running ffmpeg
28 mai 2023, par TurmundPreface


I have been fiddling around with
ffmpeg
andffplay
using command line adding and tuning filters and effects.

It quickly becomes rather tiresome to


- 

- start playback with some audio file
- stop
- modify command
- back to 1.










When for example fine-tuning noise reduction or adding effects and equalizer.


I have played around with using
zmq
to tune filters by executing commands in a different terminal, but this also becomes somewhat cumbersome.

I want some interface where I can add, remove and tune filters during runtime / while listening to the changes taking effect.


FFMPEG


I use
filter
to mean effect / filter from here on out. For exampleafftdn
,rubberband
, ...

ffmpeg
is somewhat intimidating. It's powerful but also complex, at least when starting to dig into it. :0

Looking at the library and examples I am looking at API example for audio decoding and filtering, - which at least at first looks promising as a starting platter.


Output


I imagine it would be best to have multiple sinks or some container with multiple audio tracks :


- 

- Raw audio
- Audio with effects applied






Optionally :


- 

- Raw audio
- Audio with all filters
- Audio with filter group 1
- Audio with filter group 2
- ... etc.













Processing


I imagine the routine would have to be something like :


- 

- Read packet from stream/file/url
- Unpack the sample
- Copy / duplicate sample for each filter group / or one for filters
- Apply filter(s) to these “effect sample” (s)
- Write raw audio, filtered audio 1, filtered audio 2, filtered audio N, ... to out












Or for step 3 - 5 (as one would only be listening to one track at a time (But this is perhaps not the best if one decide to jump back / forth in the audio stream) :


- 

- Apply currently active filter(s)
- Write raw audio, filtered audio to out






Simultaneously one would read and check changes to filters by some interface. I.e. input :


afftdn=rf=-20:nr=20



then, if
afftdn
is not present in filters add it, else set new values.

Idea is to output "raw-audio". I.e. used in a sampling and tuning phase - then produce a line with filter-options one can use with the
ffmpeg
-tool to process the audio files once satisfied.

Questions section


- 

- Does something similar exist ?




General :


- 

- Does this seem like a way to do it and use the
ffmpeg
library ?
- 

- Can one add, remove and change filter values during runtime or do one have to re-initialize the entire stream for each added / removed filter etc ?
- Is the “Processing” part sound ?






- Would using a container that supports multiple audio tracks be the likely best solution ? E.g. mp4.

- 

- Any container preferred over others ?
- Any drawbacks (i.e. jumping back / forth in the stream)













Sub-note


Dream is to have a Arduino interfacing with this program where I use physical rotary switches, incremental rotary encoders, buttons and whistles. Tuning the various options for the filters using physical knobs. But at first I need some working sample where I use FIFO or what ever to test
ffmpeg
itself.

-
fluent-ffmpeg audio filter not working, but works on CLI
24 avril 2022, par bevanbI'm trying to apply filters to audio using
fluent-ffmpeg
. It's mostly working. But when adding certain filters (such asasubcut
ortreble
) it produces the error below.

It seems like
fluent-ffmpeg
can't find those filters (when I try a bogus filter name, it gives me the exact same error message).

Any idea what's going on ?


const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const ffmpeg = require('fluent-ffmpeg');
ffmpeg.setFfmpegPath(ffmpegPath);

async function test() {
 const command = ffmpeg();
 command.addInput("./tmp/test.mp3");
 command.withAudioFilters(['asubcut=cutoff=35:order=10:level=1']); // Other filters like "equalizer" work just fine.

 const fileOutputPath = "./tmp/mastered.mp3";
 await new Promise((resolve, reject) => {
 command
 .on('end', resolve)
 .save(fileOutputPath)
 });
}
test();



The CLI version works :

ffmpeg -i ./tmp/test.mp3 -af 'asubcut=cutoff=35:order=10:level=1' ./tmp/mastered.mp3


However, the fluent-ffmpeg version produces this error :


node:events:368
 throw er; // Unhandled 'error' event
 ^

 Error: ffmpeg exited with code 1: Error reinitializing filters!
 Failed to inject frame into filter network: Invalid argument
 Error while processing the decoded data for stream #0:0
 Conversion failed!

 at ChildProcess.<anonymous> (/Users/me/project/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
 at ChildProcess.emit (node:events:390:28)
 at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
 Emitted 'error' event on FfmpegCommand instance at:
 at emitEnd (/Users/me/project/node_modules/fluent-ffmpeg/lib/processor.js:424:16)
 at endCB (/Users/me/project/node_modules/fluent-ffmpeg/lib/processor.js:544:13)
 at handleExit (/Users/me/project/node_modules/fluent-ffmpeg/lib/processor.js:170:11)
 at Socket.<anonymous> (/Users/me/project/node_modules/fluent-ffmpeg/lib/processor.js:209:9)
 at Socket.emit (node:events:402:35)
 at Pipe.<anonymous> (node:net:687:12)
</anonymous></anonymous></anonymous>