
Recherche avancée
Médias (2)
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
-
GetID3 - Boutons supplémentaires
9 avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (4)
-
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
Configuration spécifique d’Apache
4 février 2011, parModules spécifiques
Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
Création d’un (...)
Sur d’autres sites (1078)
-
how to add effect to audio, sound like a phone call phone, inner monologue, or sounds like a man/woman ? [closed]
7 mars, par MathewI'm trying to apply different audio effects, such as making audio sound like a phone call. Below is my current approach. As you can see, I'm using multiple filters and simple algorithms to achieve this effect, but the output quality isn't ideal.


I've looked into FFmpeg filters and noticed mentions of LADSPA/LV2 plugins. Are these viable solutions ? Any other suggestions would be greatly appreciated.


public static void applySceneEffect(String inputPath, String outputPath, int sceneType) {
 LOGGER.info("apply scene effect {} to {}", sceneType, inputPath);

 try (FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(inputPath);
 FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(outputPath, grabber.getAudioChannels())) {

 grabber.setOption("vn", ""); 
 grabber.start();

 
 recorder.setAudioCodec(avcodec.AV_CODEC_ID_PCM_S16LE); 
 recorder.setSampleRate(grabber.getSampleRate());
 recorder.setAudioChannels(grabber.getAudioChannels());
 recorder.setAudioBitrate(grabber.getAudioBitrate());
 recorder.setFormat("wav"); 


 String audioFilter = String.join(",",
 "aresample=8000", 
 "highpass=f=300, lowpass=f=3400", 
 "acompressor=threshold=-15dB:ratio=4:attack=10:release=100", 
 "volume=1.5", 
 "aecho=0.9:0.4:10:0.6"
 );

 FFmpegFrameFilter f1 = new FFmpegFrameFilter(audioFilter, grabber.getAudioChannels());
 f1.setSampleRate(grabber.getSampleRate());
 f1.start();

 recorder.start();

 Random random = new Random();
 double noiseLevel = 0.02; 

 
 while (true) {
 var frame = grabber.grabFrame(true, false, true, true);
 if (frame == null) {
 break;
 }

 ShortBuffer audioBuffer = (ShortBuffer) frame.samples[0];
 short[] audioData = new short[audioBuffer.remaining()];
 audioBuffer.get(audioData);

 applyElectricNoise(audioData, grabber.getSampleRate());

 audioData = applyDistortion(audioData, 1.5, 30000);

 audioBuffer.rewind();
 audioBuffer.put(audioData);
 audioBuffer.flip();


 f1.push(frame); 
 Frame filteredFrame;
 while ((filteredFrame = f1.pull()) != null) {
 recorder.record(filteredFrame); 
 }
 }

 recorder.stop();
 recorder.release();
 grabber.stop();
 grabber.release();
 } catch (FrameGrabber.Exception | FrameRecorder.Exception | FFmpegFrameFilter.Exception e) {
 throw new RuntimeException(e);
 }
}


private static final double NOISE_LEVEL = 0.005; 
private static final int NOISE_FREQUENCY = 60; 

public static void applyElectricNoise(short[] audioData, int sampleRate) {
 Random random = new Random();

 
 for (int i = 0; i < audioData.length; i++) {
 double noise = Math.sin(2 * Math.PI * NOISE_FREQUENCY * i / sampleRate);

 double electricNoise = random.nextGaussian() * NOISE_LEVEL * Short.MAX_VALUE + noise;

 audioData[i] = (short) Math.max(Math.min(audioData[i] + electricNoise, Short.MAX_VALUE), Short.MIN_VALUE); 
 }
}

public static short[] applyTremolo(short[] audioData, int sampleRate, double frequency, double depth) {
 double phase = 0.0;
 double phaseIncrement = 2 * Math.PI * frequency / sampleRate;

 for (int i = 0; i < audioData.length; i++) {
 double modulator = 1.0 - depth + depth * Math.sin(phase); 
 audioData[i] = (short) (audioData[i] * modulator);

 phase += phaseIncrement;
 if (phase > 2 * Math.PI) {
 phase -= 2 * Math.PI;
 }
 }
 return audioData;
}

public static short[] applyDistortion(short[] audioData, double gain, double threshold) {
 for (int i = 0; i < audioData.length; i++) {
 double sample = audioData[i] * gain;

 if (sample > threshold) {
 sample = threshold;
 } else if (sample < -threshold) {
 sample = -threshold;
 }

 audioData[i] = (short) sample;
 }
 return audioData;
}



-
Streaming without Content-Length in response
29 août 2011, par kainI'm using Node.js, Express (and connect), and fluent-ffmpeg.
We want to stream audio files that are stored on Amazon S3 through http.
We have all working, except that we would like to add a feature, the on-the-fly conversion of the stream through ffmpeg.
This is working well, the problem is that some browsers checks in advance before actually getting the file.
Incoming requests containing the Range header, for which we reply with a 206 with all the info from S3, have a fundamental problem : we need to know in advance the content-length of the file.
We don't know that since it is going through ffmpeg.
One solution might be to write out the resulting content-length directly on S3 when storing the file (in a special header), but this means we have to go through the pain of having queues to encode after upload just to know the size for future requests.
It also means that if we change compressor or preset we have to go through all this over again, so it is not a viable solution.We also noticed big differencies in the way Chrome and Safari request the audio tag src, but this may be discussion for another topic.
Fact is that without a proper content-length header in response everything seems to break or browsers goes in an infinite loop or restart the stream at pleasure.
Ideas ?
-
A way to convert bitrate/format of audio files (between upload & storage to S3)
5 octobre 2011, par Jonathan CoeCurrently using PHP 5.3.x & Fedora
Ok. I'll try to keep this simple. I'm working on a tool that allows the upload & storing of audio files on S3 for playback. Essentially, the user uploads a file (currently only allowing mp3 & m4a) to the server, and the file is then pushed to S3 for storage via the PHP SDK for amazon aws.
The missing link is that I would like to perform a simple bitrate & format conversion of the file prior to uploading the file. (ensuring that all files are 160kbs and .mp3).
I've looked into ffmpeg, although it seems that the PHP library only allows for reading bitrates and other meta, not for actual conversion.
Does anyone have any thoughts on the best way to approach this ? Would running a shell_exec() command that performs the conversion be sufficient to do this, or is there a more efficient/better way of doing this ?
Thanks in advance ! Any help or advice is much appreciated.