
Recherche avancée
Médias (91)
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#2 Typewriter Dance
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#1 The Wires
11 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
ED-ME-5 1-DVD
11 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (87)
-
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa 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 (...) -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
MediaSPIP Player : problèmes potentiels
22 février 2011, parLe lecteur ne fonctionne pas sur Internet Explorer
Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)
Sur d’autres sites (11684)
-
tests/tiny_psnr : do not ignore errors from run_psnr
23 avril 2015, par Michael Niedermayer -
Problem with calculating and writing silence
3 mars 2023, par Bohdan PetrenkoBecause 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
{
 private readonly ConcurrentQueue<byte> _buffer;
 
 private readonly object _lockObject;
 private readonly int _bufferSize;

 public int Channels { get; private set; }

 public int Count
 {
 get
 {
 lock (_lockObject)
 {
 return _buffer.Count;
 }
 }
 }

 public CircularBuffer(int size, int channels)
 {
 _buffer = new ConcurrentQueue<byte>();
 _bufferSize = size;
 Channels = channels;
 _lockObject = new object();
 }

 public async Task WriteAsync(ReadOnlyMemory<byte> data)
 {
 lock (_lockObject)
 {
 if (data.Length > _bufferSize) data = data[^_bufferSize..];

 if (_buffer.Count + data.Length > _bufferSize)
 {
 var bytesToRemove = _buffer.Count + data.Length - _bufferSize;
 
 for (var i = 0; i < bytesToRemove; i++)
 {
 _buffer.TryDequeue(out _);
 }
 }
 
 for (var index = 0; index < data.Span.Length; index++)
 {
 var b = data.Span[index];
 _buffer.Enqueue(b);
 }
 }
 
 await Task.CompletedTask;
 }
 
 public async Task ReadAsync(Memory<byte> data)
 {
 lock (_lockObject)
 {
 if (data.Length > _buffer.Count)
 {
 data = data[.._buffer.Count];
 }
 
 for (var index = 0; index < data.Span.Length; index++)
 {
 _buffer.TryDequeue(out var b);
 data.Span[index] = b;
 }
 }

 await Task.CompletedTask;
 }

 public void Clear()
 {
 lock (_lockObject)
 {
 _buffer.Clear();
 }
 }
}
</byte></byte></byte></byte>


-
avcodec/libtheora : fix setting keyframe_mask
7 février, par James Almeravcodec/libtheora : fix setting keyframe_mask
t_info.keyframe_granule_shift is set to the library default of 6, which is ok
for gop sizes up to 63. Since there's apparently no way to query the updated
value after having forced a gop value with TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE,
calculate it manually instead.Fixes ticket #11454.
Signed-off-by : James Almer <jamrial@gmail.com>