Recherche avancée

Médias (91)

Autres articles (112)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (14494)

  • Control noise and duration values while extracting silences of a video using FFMPEG

    15 avril 2017, par Jitender Kumar

    I have a requirement where I need to cut the video in chunk size of 10 mints. For that I need to detect silences first . I know the command, which is given below :

    -i "C:\tmp\Test1.mp4" -af silencedetect=noise=-20dB:d=.2-f null -

    But I am really struggling to set the value of duration and noise in proportion that it can detect the silence near about 10 mints.
    I need a help to set it out and also little bit of more information how both together work ?

    I have found link https://ffmpeg.org/ffmpeg-filters.html and under this section 6.60 silencedetect they have tried to explain about them. I see there that duration, we need to provide in seconds but I am completely fail to understand the purpose of noise.

    Also I am executing this command on Window.

  • Problem with calculating and writing silence

    3 mars 2023, par Bohdan Petrenko

    Because Discord sends no audio if user isn't talking, I need to calculate time after their latest voice data received and write some amout of silence to the buffer. I have this code for handling audio data :

    


    private async Task OnVoiceReceived(VoiceNextConnection sender, VoiceReceiveEventArgs e)
{
    try
    {
        if (!_isRecording) return;
        
        if (e.User is null) return;

        if (!_circularBuffers.TryGetValue(e.User.Id, out var circularBuffer))
        {
            circularBuffer = new CircularBuffer(e.AudioFormat.SampleRate * e.AudioFormat.ChannelCount * 2 * _bufferDurationSeconds, 
                e.AudioFormat.ChannelCount);
            _circularBuffers[e.User.Id] = circularBuffer;
        }

        TimeSpan delay;

        if (!_lastVoiceActivity.TryGetValue(e.User.Id, out var lastData))
        {
            // If we don't have any data for this user, we assume that last data from this user was received at the same time as recording started
            delay = DateTimeOffset.Now - _recordingStartedAt;
        }
        else delay = DateTimeOffset.Now - lastData;

        // calculate how much silence we need to add to the buffer
        var silence = new byte[e.AudioFormat.SampleRate * e.AudioFormat.ChannelCount * 2 * (int)Math.Round(delay.TotalSeconds)];
        
        await circularBuffer.WriteAsync(silence);

        _lastVoiceActivity[e.User.Id] = DateTimeOffset.Now;
        
        
        await circularBuffer.WriteAsync(e.PcmData);
    }
    catch (Exception exception)
    {
        Log.Error(exception, "Error while receiving voice data");
    }
}


    


    After the recording finishes, with ffmpeg I write buffers to .wav files and then mix audios.

    


    I have a problem that sometimes amount of silence is wrong and espacially this can be heard after mixing audios of multiple users. Sometimes amount of silence is not enough and somtimes it's too long. For example, In conversation recording user 1 can respond to user 2 even before user 2 asks him or vice-versa, user 1 can respond too late. Also I found that the problem appears often after some data of the buffer was removed due to overfilling.

    


    I tried to change formula to calculate silence, and add data duration when setting new value of _lastVoiceActivity but that just made the problem worse. Also I tried to add silence only if delay is more than 100ms but this also didn't help. For testing I use circular buffers which can contain 30 seconds of audio.

    


    I use DSharpPlus for Discord and ffmpeg for mixing audios.

    


    UPD : I found that if I don't remove data from buffers due to overfilling, the probles becomes almost invisible. So here is my CircularBuffer implementation :

    


        public class CircularBuffer&#xA;{&#xA;    private readonly ConcurrentQueue<byte> _buffer;&#xA;    &#xA;    private readonly object _lockObject;&#xA;    private readonly int _bufferSize;&#xA;&#xA;    public int Channels { get; private set; }&#xA;&#xA;    public int Count&#xA;    {&#xA;        get&#xA;        {&#xA;            lock (_lockObject)&#xA;            {&#xA;                return _buffer.Count;&#xA;            }&#xA;        }&#xA;    }&#xA;&#xA;    public CircularBuffer(int size, int channels)&#xA;    {&#xA;        _buffer = new ConcurrentQueue<byte>();&#xA;        _bufferSize = size;&#xA;        Channels = channels;&#xA;        _lockObject = new object();&#xA;    }&#xA;&#xA;    public async Task WriteAsync(ReadOnlyMemory<byte> data)&#xA;    {&#xA;        lock (_lockObject)&#xA;        {&#xA;            if (data.Length > _bufferSize) data = data[^_bufferSize..];&#xA;&#xA;            if (_buffer.Count &#x2B; data.Length > _bufferSize)&#xA;            {&#xA;                var bytesToRemove = _buffer.Count &#x2B; data.Length - _bufferSize;&#xA;                &#xA;                for (var i = 0; i &lt; bytesToRemove; i&#x2B;&#x2B;)&#xA;                {&#xA;                    _buffer.TryDequeue(out _);&#xA;                }&#xA;            }&#xA;            &#xA;            for (var index = 0; index &lt; data.Span.Length; index&#x2B;&#x2B;)&#xA;            {&#xA;                var b = data.Span[index];&#xA;                _buffer.Enqueue(b);&#xA;            }&#xA;        }&#xA;        &#xA;        await Task.CompletedTask;&#xA;    }&#xA;    &#xA;    public async Task ReadAsync(Memory<byte> data)&#xA;    {&#xA;        lock (_lockObject)&#xA;        {&#xA;            if (data.Length > _buffer.Count)&#xA;            {&#xA;                data = data[.._buffer.Count];&#xA;            }&#xA;            &#xA;            for (var index = 0; index &lt; data.Span.Length; index&#x2B;&#x2B;)&#xA;            {&#xA;                _buffer.TryDequeue(out var b);&#xA;                data.Span[index] = b;&#xA;            }&#xA;        }&#xA;&#xA;        await Task.CompletedTask;&#xA;    }&#xA;&#xA;    public void Clear()&#xA;    {&#xA;        lock (_lockObject)&#xA;        {&#xA;            _buffer.Clear();&#xA;        }&#xA;    }&#xA;}&#xA;</byte></byte></byte></byte>

    &#xA;

  • Revision 97da8b8c33 : Minor rate control refactoring and experiments. Some minor refactoring code rel

    25 février 2013, par Paul Wilkins

    Changed Paths : Modify /vp9/encoder/vp9_firstpass.c Modify /vp9/encoder/vp9_onyx_if.c Modify /vp9/encoder/vp9_onyx_int.h Modify /vp9/encoder/vp9_ratectrl.c Modify /vp9/encoder/vp9_ratectrl.h Minor rate control refactoring and experiments. Some minor refactoring code relating to estimates (...)