Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP 0.2

Autres articles (75)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Amélioration de la version de base

    13 septembre 2013

    Jolie 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, par

    MediaSPIP 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 Khan

    I have a WPF app that does the following :

    


      

    1. Imports video files.
    2. 


    3. Extracts audio from the using FFmpeg.
    4. 


    5. Resamples the audio using NAudio to conform to a Speech-to-Text engine (16kHz/16bit/Mono).
    6. 


    7. Plays back the video for users with overlayed subtitles.
    8. 


    9. Allows users to correct mistakes that the STT engine might have made.
    10. 


    


    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.

    


    VLC Equalizer Settings

    


    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 Turmund

    Preface

    


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

    


    It quickly becomes rather tiresome to

    


      

    1. start playback with some audio file
    2. 


    3. stop
    4. 


    5. modify command
    6. 


    7. back to 1.
    8. 


    


    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 example afftdn, 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 :

    


      

    1. Raw audio
    2. 


    3. Audio with effects applied
    4. 


    


    Optionally :

    


      

    1. Raw audio
    2. 


    3. Audio with all filters
    4. 


    5. Audio with filter group 1
    6. 


    7. Audio with filter group 2
    8. 


    9. ... etc.
    10. 


    



    


    Processing

    


    I imagine the routine would have to be something like :

    


      

    1. Read packet from stream/file/url
    2. 


    3. Unpack the sample
    4. 


    5. Copy / duplicate sample for each filter group / or one for filters
    6. 


    7. Apply filter(s) to these “effect sample” (s)
    8. 


    9. Write raw audio, filtered audio 1, filtered audio 2, filtered audio N, ... to out
    10. 


    


    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) :

    


      

    1. Apply currently active filter(s)
    2. 


    3. Write raw audio, filtered audio to out
    4. 


    


    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 bevanb

    I'm trying to apply filters to audio using fluent-ffmpeg. It's mostly working. But when adding certain filters (such as asubcut or treble) 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&#xA;      throw er; // Unhandled &#x27;error&#x27; event&#xA;      ^&#xA;&#xA;      Error: ffmpeg exited with code 1: Error reinitializing filters!&#xA;      Failed to inject frame into filter network: Invalid argument&#xA;      Error while processing the decoded data for stream #0:0&#xA;      Conversion failed!&#xA;&#xA;          at ChildProcess.<anonymous> (/Users/me/project/node_modules/fluent-ffmpeg/lib/processor.js:182:22)&#xA;          at ChildProcess.emit (node:events:390:28)&#xA;          at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)&#xA;      Emitted &#x27;error&#x27; event on FfmpegCommand instance at:&#xA;          at emitEnd (/Users/me/project/node_modules/fluent-ffmpeg/lib/processor.js:424:16)&#xA;          at endCB (/Users/me/project/node_modules/fluent-ffmpeg/lib/processor.js:544:13)&#xA;          at handleExit (/Users/me/project/node_modules/fluent-ffmpeg/lib/processor.js:170:11)&#xA;          at Socket.<anonymous> (/Users/me/project/node_modules/fluent-ffmpeg/lib/processor.js:209:9)&#xA;          at Socket.emit (node:events:402:35)&#xA;          at Pipe.<anonymous> (node:net:687:12)&#xA;</anonymous></anonymous></anonymous>

    &#xA;