Recherche avancée

Médias (1)

Mot : - Tags -/bug

Autres articles (101)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Emballe Médias : Mettre en ligne simplement des documents

    29 octobre 2010, par

    Le plugin emballe médias a été développé principalement pour la distribution mediaSPIP mais est également utilisé dans d’autres projets proches comme géodiversité par exemple. Plugins nécessaires et compatibles
    Pour fonctionner ce plugin nécessite que d’autres plugins soient installés : CFG Saisies SPIP Bonux Diogène swfupload jqueryui
    D’autres plugins peuvent être utilisés en complément afin d’améliorer ses capacités : Ancres douces Légendes photo_infos spipmotion (...)

Sur d’autres sites (11616)

  • How to specify the noise floor in FFmpeg's acompressor filter

    26 juillet 2019, par Reino

    I’ve always used Audacity’s Dynamic Range Compressor if I wanted to crank up the volume of an audio file. Today I was looking at whether I could do the same with FFmpeg’s acompressor filter.

    I’ve found "how to user "compressor" with ffmpeg" and Gyan’s answer, which was really helpful, but not satisfying enough.

    Right now I’m actually trying to mimic Audacity’s procedure.
    If I understand the acompressor correctly, then I can’t apply the makeup gain in one pass. So I need to do a volumedetect first.

    Let’s say I have the follow "Audacity options" I’d like to use :

    Threshold: -30dB  
    Noise Floor: -40dB
    Ratio: 2:1
    Attack Time: 0,2s
    Release Time: 1,0s
    [x] Make-up gain for 0 dB after compressing
    [x] Compress based on Peaks

    If I’m correct this translates to :

    threshold=0.031623   # 10^(-30/20) = 10^(-1.5) = 0.031623.
    ratio=2              # 2 is the default, so no need to specify.
    attack=200           # 0.2*1000 = 200ms.
    release=1000         # 1.0*1000 = 1000ms.
    detection=0          # peak based.

    What I don’t understand is where I can specify the "Noise Floor". Does acompressor even have an option for that ?

    Alright, volumedetect...

    ffmpeg -i input.wav -lavfi acompressor=threshold=0.031623:attack=200:release=1000:detection=0
    ,volumedetect -f null -
    or
    ffmpeg -i input.wav -lavfi acompressor=threshold=10^^(-30/20):attack=200:release=1000:detecti
    on=0,volumedetect -f null -

    (10^^(-30/20) (Windows), 10^\(-30/20\) (Unix). pow(10,-30/20) doesn’t appear to work)

    ...in my case leads to...

    n_samples: 23838888
    mean_volume: -27.7 dB
    max_volume: -7.7 dB
    histogram_7db: 3
    histogram_8db: 21
    histogram_9db: 126
    histogram_10db: 458
    histogram_11db: 1727
    histogram_12db: 5021
    histogram_13db: 11816
    histogram_14db: 24831

    For the 2nd pass I apply a makeup gain of 10^(7.7/20) or 2.4266 :

    ffmpeg -i input.wav -lavfi acompressor=threshold=10^^(-30/20):attack=200:release=1000:detecti
    on=0:makeup=10^^(7.7/20) -f wav output.wav

    Btw, I noticed that -lavfi acompressor=[...],volume=7.7dB produces the same output.

    So far so good. This is the waveform of output.wav :

    ffmpeg -i input.wav -lavfi acompressor=threshold=10^^(-30/20):attack=200:release=1000:detecti
    on=0:makeup=10^^(7.7/20),showwavespic=s=888x295:split_channels=1 output.png

    ffmpeg_acomp=t=0.031623-a=200-r=1000-d=0-mu=2.4266_wavespic.png
    Where as this is the waveform for the same input.wav processed by Audacity (with the above settings) :
    enter image description here

    I’m no expert in this field, but is the lower overall volume of FFmpeg’s output due to the "Noise floor" missing ?
    If so, how to specify ? And if not with acompressor, what other filter then ?

    [edit]

    ffmpeg -i input.wav -lavfi acompressor=threshold=10^^(-30/20):attack=200:release=1000:detecti
    on=0:makeup=10^^(7.7/20),volumedetect -f null NUL
    n_samples: 23838888
    mean_volume: -20.0 dB
    max_volume: -0.0 dB
    histogram_0db: 16
    histogram_1db: 76
    histogram_2db: 329
    histogram_3db: 1158
    histogram_4db: 3678
    histogram_5db: 9473
    histogram_6db: 19933
    ffmpeg -i input-audacity_drc-peak.wav -af volumedetect -f null NUL
    n_samples: 23838888
    mean_volume: -16.9 dB
    max_volume: -0.0 dB
    histogram_0db: 77
    histogram_1db: 683
    histogram_2db: 4291
    histogram_3db: 14065
    histogram_4db: 35403

    mean_volume: -20.0 dB vs. mean_volume: -16.9 dB. So Audacity’s output is quite a bit louder. Also having used a noise floor results in very different histogram_xdb values.

    I’ve had a closer look at other of acompressor’s options and started fiddling with level_in ("Set input gain. Default is 1. Range is between 0.015625 and 64.")
    I have no idea what the range stands for, but I figured a value of 2 would mean, make the input twice as loud.

    ffmpeg -i input.wav -lavfi acompressor=level_in=2:threshold=10^^(-30/20):attack=200:release=1
    000:detection=0:makeup=10^^(7.7/20),volumedetect -f null NUL
    n_samples: 23838888
    mean_volume: -16.9 dB
    max_volume: 0.0 dB
    histogram_0db: 1611
    histogram_1db: 3779
    histogram_2db: 9619
    histogram_3db: 20263

    And the waveform :
    ffmpeg_acomp=l=2-t=0.031623-a=200-r=1000-d=0-mu=2.4266_wavespic.png

    Wow ! That’s strange. The same mean_volume as Audacity’s output and a very similar waveform.
    Do note that is with a make up gain of 7.7dB for a level_in=1 !

    I guess this answers my question about the "Noise Floor". It wasn’t causing the lower volume.

    Maybe some Audacity experts could explain to me why Audacity is making the audio twice as loud with its DRC filter, while it’s not even an option.
    Or is my research on the matter completely wrong ?

    [/edit]

  • FFmpeg - resampled audio with much noise

    28 mars 2019, par Jinx

    I’m not familiar with auido resampling. I tried to resample auido streams from two videos. The first one’s output was close to the original but with noise, the other one was almost full of noise.

    Information for the first one

    128 kb/s, 48.0kHz, 2 channels, AACLC

    Information for the second one

    384 kb/s, 48.0 kHz, 6channels, AACLC

    I found that, when I set the sample size 16, the frist one worked quit good but still with noise. The other one worked too bad but still had sound. What and how to determine the output sample size ? Although I used channels * av_get_bytes_per_sample((AVSampleFormat)output_fmt) as the output sample size because I wanted it to be the same as the original, it had no sound at all.

    MyResampling.cpp

    bool MyResample::open(AVCodecParameters* par) {
       if (!par) {
           std::cout << "par is null" << std::endl;
           return false;
       }  
       audio_context = swr_alloc_set_opts(
           audio_context, av_get_default_channel_layout(2), (AVSampleFormat)output_fmt,
           par->sample_rate, av_get_default_channel_layout(par->channels), (AVSampleFormat)par->format, par->sample_rate,
           0, 0);

       avcodec_parameters_free(&par);
       int ret = swr_init(audio_context);
       if (ret != 0) {
           std::cout << "failed to open audio codec" << std::endl;
       }
       return true;
    }

    int MyResample::resample(AVFrame* frame, unsigned char* output)
    {
       if (!frame)
           return 0;
       if (!output)
           av_frame_free(&frame);

       uint8_t* data[2] = { 0 };
       data[0] = output;
       int ret = swr_convert(audio_context, data, frame->nb_samples, (const uint8_t**)frame->data, frame->nb_samples);
       //int size =  ret * frame->channels * av_get_bytes_per_sample((AVSampleFormat)output_fmt);
       int size = av_samples_get_buffer_size(nullptr, frame->channels, frame->nb_samples, (AVSampleFormat)output_fmt, 1);
       if (ret < 0)
           return ret;
       return size;
    }

    MyAudioPlayer.cpp

    bool open()
    {
       close();
       QAudioFormat fmt;
       fmt.setSampleRate(sample_rate); // from audioStream->codecpar->sample_rate
       fmt.setSampleSize(16); //
       fmt.setChannelCount(channels); // from audioStream->codecpar->channels
       fmt.setCodec("audio/pcm");
       fmt.setByteOrder(QAudioFormat::LittleEndian);
       fmt.setSampleType(QAudioFormat::UnSignedInt);
       output = new QAudioOutput(fmt);
       io = output->start();
       if (io)
           return true;
       return false;
    }

    bool write(const unsigned char* data, int data_size)
    {
       if (!data || data_size <= 0)
           return false;
       if (!output || !io)
       {
           return false;
       }
       int size = io->write((char*)data, data_size);
       if (data_size != size)
           return false;
       return true;
    }

    main.cpp

    MyAudioPlayer::open();
    unsigned char* pcm = new unsigned char[1024 * 1024];
    if (demux.get_media_type() == 1) { // audio
       audio_decode.sendPacket(pkt);
       AVFrame* frame = audio_decode.receiveFrame();
       int len = resample.resample(frame, pcm);
       while (len > 0) {
           if (MyAudioPlayer::check_space() >= len) {
               MyAudioPlayer::write(pcm, len);
               break;
           }
           msleep(1);
       }              
    }
  • ffmpeg clean all noise background silences in a poscast

    23 mars 2019, par fireDevelop.com

    I have hundreds of podcast without music, just the voice and the room silence.
    In the silences, I have many clicks, respirations, etc...
    I need to clean all silences with a script, keeping intact the voice.

    In this picture you can see my dirty silences

    And here the result I want in all my audios

    When I use some scripts of sox. I don`t get the result I spect because the voice is affected by the script, the room-silence disappear and some clic still in the silences.

    Then in order to keep intact the voice, I want to do this :

    1. Delete all the silences longer than 3 seconds.

    1. Split all the audio and silences with in a sequence numbers. ie. :

      • 001-Silence-2.0seconds.wav
      • 002-voice.wav
      • 003-Silence-0.25seconds.wav
      • 004-voice.wav
      • 005-Silence-0.75seconds.wav
      • 006-voice.wav
      • ...
      • ...

    1. Before, run the script I created manually many files with silences of diferents silences I will use :

      • myManuallySilence-0.25seconds.wav
      • myManuallySilence-0.50seconds.wav
      • myManuallySilence-0.75seconds.wav
      • myManuallySilence-0.1seconds.wav
      • myManuallySilence-1.25seconds.wav
      • ...
      • ...
      • myManuallySilence-2.50seconds.wav
      • myManuallySilence-2.75seconds.wav
      • myManuallySilence-3.0seconds.wav

    1. the script will check the dirty silences duration and replace by the files myManuallySilence-x.xseconds.wav

    1. merge all files in one wav file, with the original voice and all the silences cleanned.

    At the moment I have only this script :

    # get the path of Adobe Audition and add timestamp in the output
    filename
    fileName=out
    current_time=$(date "+%Y.%m.%d-%H.%M.%S")
    newFileName=$fileName.$current_time.wav
    #yourPathAPP=/Applications/Adobe\ Audition\ CC\ 2019/Adobe\ Audition\
    CC\ 2019.app
    yourPathAPP=/Volumes/6TB/Applications/ocenaudio.app
    # # First denoise audio

    # ## Get noise sample
    ffmpeg -i in.wav -vn -ss 00:00:00 -t 00:00:01 noise-sample.wav

    # ## Create noise profile
    sox noise-sample.wav -n noiseprof noise.prof

    # ## Clean audio from noise
    sox in.wav $newFileName noisered noise.prof 0.50
    # # Split audio by noise
    sox -V3 $newFileName output.wav silence 1 00:00:02.000 - 80d 1
    00:00:02.000 -80d : newfile : restart

    # ####### (these settings worked for my computer mic - maybe we need to
    finetune them later) #######

    Is getting all the voice in separate files like this :
    output001.wav
    output002.wav
    output003.wav
    output004.wav
    ...
    output00x.wav

    Please, any suggestion will be appreciated.
    Thanks so much in advance !