
Recherche avancée
Autres articles (101)
-
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...) -
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.
Sur d’autres sites (14646)
-
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');
 } 



-
Find/extract the frames which are different in two videos
24 novembre 2022, par GreendrakeI have two H.264 video files roughly 30GB each, with 256291 frames in each. Most, if not all, frames in the 1st video appear identical to their counterparts in the 2nd video. That said, the video content is seemingly almost (maybe completely) identical.


The raw H.264 streams extracted from the video files are actually supposed to be identical but they are not : one is bigger than the other by about 2MB. So, it seems like there ought to be some differences in the picture somewhere.


I have used the following command to extract a frame each 0.5s from the files and then compared the frames' md5 hashes. All 21356 frame files extracted from the first video exactly match their counterparts from the second video.


for i in {0..21356} ; do ffmpeg -hide_banner -loglevel error -accurate_seek -ss `echo $i*0.5 | bc` -i video.mp4 -frames:v 1 frames/period_down_$i.bmp ; done



So, the odds that the video is anyhow different are low. But not 0% chance as the one or a few different frames could just fall outside of the 0.5s picks that I tried.


Is there any smart way to find/extract the diffing frames only ?


I could extract all frames and compare them but that's not smart at all and would take lots of time / disk space.


-
Copied .ass Subtitle Has Font Size Changed
7 novembre 2022, par RaptaThis is happening when doing an mkv to mkv conversion, with a simple -c:s copy, and whilst the font style, and position are the same, the size ends up being bigger. I'm also playing it with VLC ,if that matters.


Here're the sub settings :
[Script Info]
 ; Script generated by Aegisub r8942
 ; http://www.aegisub.org/
Title : Default Aegisub file
ScriptType : v4.00+
PlayDepth : 0
YCbCr Matrix : TV.601
PlayResX : 708
PlayResY : 480
WrapStyle : 0
ScaledBorderAndShadow : yes


[Aegisub Project Garbage]
Last Style Storage : Default
Video AR Mode : 4
Video AR Value : 1.333333
Video Zoom Percent : 1.000000
Video Position : 35410


[V4+ Styles]
Format : Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style : Default,Funimitation,28,&H00FFFFFF,&H0300FFFF,&H00000000,&H02000000,-1,0,0,0,100,100,1,0,1,2,0,2,40,40,25,1
Style : Lyrics JPN,Faxfont Tone,40,&H00FFFFFF,&H000000FF,&H00000000,&H501D0032,0,0,0,0,100,100,0,0,1,0,0,8,0,0,10,0
Style : Lyrics ENG,Faxfont Tone,36,&H00FFFFFF,&H000000FF,&H00000000,&H501D0032,0,0,0,0,100,100,0,0,1,0,0,2,0,0,6,0
Style : Title,Faxfont Tone,55,&H00FFFFFF,&H000000FF,&H28616161,&H28E0E0E0,-1,0,0,0,100,100,0,0,1,0.5,0.1,2,10,10,20,1
Style : Credits ENG,Faxfont Tone,42,&H00FFFFFF,&H000000FF,&H00000000,&H501D0032,0,0,0,0,100,100,0,0,1,0,0,8,0,0,0,0


And here's a sub example :
[Events]
Format : Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue : 0,0:00:17.95,0:00:20.79,Credits ENG,,0,0,0,,\blur0.6\c&HFFF3ED&\fscx60\fscy76\pos(102.882,73)Planning


If I export the sub from the converted file, all of the settings are the same.


Is there any way to stop the size from changing ?


Thanks


Tried : -c:s copy
Expected : Complete copy.
Resulted : Not a complete copy — the font size was bigger.