
Recherche avancée
Médias (1)
-
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 (30)
-
Publier sur MédiaSpip
13 juin 2013Puis-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 -
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, (...) -
Création définitive du canal
12 mars 2010, parLorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
A la validation, vous recevez un email vous invitant donc à créer votre canal.
Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...)
Sur d’autres sites (5193)
-
Streaming audio from FFMPEG to browser via WebSocket and WebAudioApi
17 novembre 2022, par Sebi O.My project has 2 parts :


- 

- a web interface that the user accesses
- and a standalone app installed on the computer, that acts as a websocket server.






From the web UI, the user has to hear his computer's microphone.
At this moment, I have a working solution that listens to microphone and sends the raw PCM audio chunks back to web-UI which is able to play them. But some serious lag gets added in time, despite it all runs on the same computer, so there's no internet latency/etc. That is why I am testing FFMPEG now.


So, here's the FFMPEG command for streaming microphone data :


ffmpeg.exe -re -f dshow -i audio="Microphone (HD Pro Webcam C920)" -ar 44100 -ac 1 -f f32le pipe:1



Data gets sent successfully via websocket, but playing it using WebAudioApi is not working, i mean i don't hear anything.


Can anyone point me to what am I doing wrong ?
Here's the web javascript :


let ipOfAudioServer = 'localhost';

 let wsClient = null;
 
 var audioCtx = null;
 var subcounter = 0;
 var audiobuffer = [];
 var source = null;
 
 // must match the values in the audio-server. Thought despite audio-server could send 2channels.. we resume to only one, to save bandwidth
 var sampleRate = 44100; 
 var channels = 1;
 
 var microphone = 'Microphone (HD Pro Webcam C920)';
 
 
 // this method reads current position from the audiobuffer and plays the audio
 // the method will re-call itself, in order to play the next item in queue
 this.play = function(soundName) {

 var ffs = audiobuffer[subcounter];
 
 if (ffs) {
 var frameCount = ffs.byteLength;
 console.log(frameCount, audiobuffer.length);
 
 var myAudioBuffer = audioCtx.createBuffer(channels, frameCount, sampleRate); 
 myAudioBuffer.getChannelData(0).set(ffs)
 
 if (myAudioBuffer != null)
 { 
 subcounter += 1;
 
 source = audioCtx.createBufferSource();
 source.buffer = myAudioBuffer;
 source.connect(audioCtx.destination);
 source.onended = () => { console.log("finished, continuing to seek buffer!"); play(soundName); }
 source.start();
 } 
 }
 // just in case the counter got to be bigger than the actual amount of items in the list, set it back to last one
 if (subcounter > audiobuffer.length)
 subcounter = audiobuffer.length;
 };
 
 
 // the method to initialize WS client
 this.initWebsocketClient = function ()
 {
 if (wsClient == null)
 {
 wsClient = new WebSocket(`ws://${ipOfAudioServer}:23233`, "protocol");
 wsClient.binaryType = "arraybuffer";
 
 wsClient.onmessage = function (event) 
 {
 if (typeof event.data === 'object') {
 
 console.log(event.data, event.data.size);
 
 // clear memory in case buffer is already too big
 if (subcounter > 50) {
 console.log('cleared memory');
 audiobuffer = [];
 subcounter = 0;
 }
 
 
 audiobuffer.push(event.data);
 if (audiobuffer.length == 1) {
 play('sinewave');
 }
 
 }
 else {
 if (event.data == 'stopMicrophone=ok') {
 wsClient.close();
 wsClient = null;
 
 audiobuffer = [];
 subcounter = 0;
 }
 
 console.log(event.data);
 }
 }
 }
 };

 // method used in send() which will actually send the message only after connection has been established successfully.
 this.waitForConnection = function (callback, interval) {
 if (wsClient.readyState === 1) {
 callback();
 } else {
 var that = this;
 // optional: implement backoff for interval here
 setTimeout(function () {
 that.waitForConnection(callback, interval);
 }, interval);
 }
 };
 
 // using this method to send WS messages to the audio-server
 this.send = function (message, callback) 
 {
 this.initWebsocketClient();
 
 this.waitForConnection(function () {
 wsClient.send(message);
 if (typeof callback !== 'undefined') {
 callback();
 }
 }, 1000);
 };
 
 // called by clicking the start button
 function startCapture() {
 if (audioCtx == null)
 audioCtx = new (window.AudioContext || window.webkitAudioContext)();
 
 audiobuffer = [];
 subcounter = 0;
 
 this.send(`startMicrophone?device=${microphone}`);
 }

 // called by clicking the stop button
 function stopCapture() {
 this.send('stopMicrophone');
 } 



-
FFmpeg Loop Streaming
21 septembre 2022, par DanI'm trying to run a stream on YouTube with a video that loops 24/7, using FFmpeg 4.4 from a server with Ubuntu 22, it works but I'm loosing the "Live" red light on YouTube, and here is the message from the "Stream health" tab :


"YouTube is not currently receiving data for this stream. If you believe this is incorrect, ensure you’re sending a stream and that it is configured with the correct stream key."


Here's the script I made :



VBR="1500k" 
FPS="24" 
QUAL="superfast" 

YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" 
SOURCE="/home/ubuntu/Video.mp4" 
KEY="mykey" 
ffmpeg \
-stream_loop -1 -i "$SOURCE" -deinterlace \
-vcodec libx264 -pix_fmt yuv420p -preset $QUAL -r $FPS -g $(($FPS * 2)) -b:v $VBR \
-acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b:a 712000 -bufsize 512k \
-f flv "$YOUTUBE_URL/$KEY"



Any help would be appreciated.
Thanks.


-
avformat/hevc : Fix crash on allocation failure, avoid allocations
26 août 2022, par Andreas Rheinhardtavformat/hevc : Fix crash on allocation failure, avoid allocations
The HEVC code currently uses an array of arrays of NALUs ; one such array
contains all the SPS NALUs, one all PPS NALUs etc. The array of arrays
is grown dynamically via av_reallocp_array(), but given that the latter
function automatically frees its buffer upon reallocation error,
it may only be used with PODs, which this case is not. Even worse :
While the pointer to the arrays is reset, the counter for the number
of arrays is not, leading to a segfault in hvcc_close().Fix this by avoiding the allocations of the array of arrays altogether.
This is easily possible because their number is bounded (by five).
Furthermore, as a byproduct we can ensure that the code always
produces the recommended ordering of VPS-SPS-PPS-SEI (which was
not guaranteed before).Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>