
Recherche avancée
Autres articles (50)
-
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" ; -
Les statuts des instances de mutualisation
13 mars 2010, parPour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...)
Sur d’autres sites (8758)
-
How to read realtime microphone audio volume in python and ffmpeg or similar
1er septembre 2023, par Ryan MartinI'm trying to read, in near-realtime, the volume coming from the audio of a USB microphone in Python.


I have the pieces, but can't figure out how to put it together.


If I already have a .wav file, I can pretty simply read it using wavefile :


from wavefile import WaveReader

with WaveReader("/Users/rmartin/audio.wav") as r:
 for data in r.read_iter(size=512):
 left_channel = data[0]
 volume = np.linalg.norm(left_channel)
 print(volume)



This works great, but I want to process the audio from the microphone in real-time, not from a file.


So my thought was to use something like ffmpeg to PIPE the real-time output into WaveReader, but my Byte knowledge is somewhat lacking.


import subprocess
import numpy as np

command = ["/usr/local/bin/ffmpeg",
 '-f', 'avfoundation',
 '-i', ':2',
 '-t', '5',
 '-ar', '11025',
 '-ac', '1',
 '-acodec','aac', '-']

pipe = subprocess.Popen(command, stdout=subprocess.PIPE, bufsize=10**8)
stdout_data = pipe.stdout.read()
audio_array = np.fromstring(stdout_data, dtype="int16")

print audio_array



That looks pretty, but it doesn't do much. It fails with a
[NULL @ 0x7ff640016600] Unable to find a suitable output format for 'pipe:'
error.

I assume this is a fairly simple thing to do given that I only need to check the audio for volume levels.


Anyone know how to accomplish this simply ? FFMPEG isn't a requirement, but it does need to work on OSX & Linux.


-
Inputting Audio Stream to FFMPEG
5 avril 2018, par WijayaI’m building a real time chat application with C# and ffmpeg.exe. My requirement is to get a memory stream from Microsoft Speech API and feed it to ffmpeg process in real time. I can take a memory stream from Microsoft Speech API. I’m using following code to create the memory stream.
using (MemoryStream stream = new MemoryStream())
{
MemoryStream streamAudio = new MemoryStream();
System.Media.SoundPlayer m_SoundPlayer = new System.Media.SoundPlayer();
_speechSynthesizerVisemesSender.SetOutputToWaveStream(streamAudio);
_speechSynthesizerVisemesSender.SetOutputToNull();
stream.WriteTo(proc.StandardInput.BaseStream);
}I’m already using another datapipe with another command to feed video content to ffmpeg. But I couldn’t find a stable solution to feed audio through a datapipe. This article briefly explains about audio datapipe. I’m using following command to stream audio.
"ffmpeg -re -f s16le -i pipe:wav -f mpegts udp://127.0.0.1:1234"
But it is not working with the datapipe. If I try the command with mp3 or wav file, it works.
-
Send RTSP + Audio to RTMP server with ffmpeg
7 février 2018, par Emiliano SpadaI successfully sent an rtsp video stream to rtmp server (facebook) but have not been able to use audio using ffmpeg.
If I play RTSP from camera locally audio works fine.
This is the command I use (ubuntu server 16.0.4 LTS - ffmpeg 2.8.11) :
sudo ffmpeg -f lavfi -i anullsrc -rtsp_transport tcp -i "rtsp://admin:admin@192.168.1.2/mode=real&idc=1&ids=1" -tune zerolatency -vcodec libx264 -g 60 -keyint_min 60 -r 30 -pix_fmt + -b:v 4000k -acodec copy -ar 44100 -b:a 128k -strict experimental -f flv "rtmp://live-api.facebook.com:80/rtmp/STREAM-KEY"
Here the full log :
https://www.dropbox.com/s/vo05n0kehs75iba/ffmpeg-20180207-100549.log?dl=0