
Recherche avancée
Médias (2)
-
Exemple de boutons d’action pour une collection collaborative
27 février 2013, par
Mis à jour : Mars 2013
Langue : français
Type : Image
-
Exemple de boutons d’action pour une collection personnelle
27 février 2013, par
Mis à jour : Février 2013
Langue : English
Type : Image
Autres articles (27)
-
Contribute to translation
13 avril 2011You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
MediaSPIP is currently available in French and English (...) -
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...) -
Gestion de la ferme
2 mars 2010, parLa ferme est gérée dans son ensemble par des "super admins".
Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
Dans un premier temps il utilise le plugin "Gestion de mutualisation"
Sur d’autres sites (5523)
-
Find a great Google Tag Manager alternative in Matomo Tag Manager
-
Is there any way to change file FPS in javascript browser or prepare wav conventer to 60FPS videos ?
16 novembre 2020, par SZtyroI'm making web application which stores short audio files that have been cut from large video files. User uploads .mp4 file, chooses sound length and here's a little trick. Cutting audio can only be done in backend (correct me if I'm wrong) and sending 700MB data is not good option, so I use code below to decode audio data from .mp4 and then I send it with start and stop params. Backend (Node.js) use's FFMPEG to cut audio and save's it.


This part works, but i realised that decoded audio from 60FPS video doesn't sound good (not terrible but totally useless in my app). My goal is to avoid third party, especially desktop, apps (like audacity) and allow user to cut revelant part of audio from any mp4 video. Is there any way to convert 60FPS video to 30FPS video (ArrayBuffer) in browser and then decode audio ?


fileInput.onchange = event => {
 this.file = event.target["files"][0];
 //.mp4 file
 this.fileURL = URL.createObjectURL(this.file)

 let baseAudioContext = new AudioContext();
 this.file.arrayBuffer().then(buff => {

 baseAudioContext.decodeAudioData(buff,
 success => {
 console.log(success)
 this.bufferToWave(success, 0, success.length);
 },
 err => console.log(err));
 })
 }

 bufferToWave(abuffer, offset, len) {

 var numOfChan = abuffer.numberOfChannels,
 length = len * numOfChan * 2 + 44,
 buffer = new ArrayBuffer(length),
 view = new DataView(buffer),
 channels = [], i, sample,
 pos = 0;

 // write WAVE header
 setUint32(0x46464952); // "RIFF"
 setUint32(length - 8); // file length - 8
 setUint32(0x45564157); // "WAVE"

 setUint32(0x20746d66); // "fmt " chunk
 setUint32(16); // length = 16
 setUint16(1); // PCM (uncompressed)
 setUint16(numOfChan);
 setUint32(abuffer.sampleRate);
 setUint32(abuffer.sampleRate * 2 * numOfChan); // avg. bytes/sec
 setUint16(numOfChan * 2); // block-align
 setUint16(16); // 16-bit (hardcoded in this demo)

 setUint32(0x61746164); // "data" - chunk
 setUint32(length - pos - 4); // chunk length

 // write interleaved data
 for (i = 0; i < abuffer.numberOfChannels; i++)
 channels.push(abuffer.getChannelData(i));

 while (pos < length) {
 for (i = 0; i < numOfChan; i++) { // interleave channels
 sample = Math.max(-1, Math.min(1, channels[i][offset])); // clamp
 sample = (0.5 + sample < 0 ? sample * 32768 : sample * 32767) | 0; // scale to 16-bit signed int
 view.setInt16(pos, sample, true); // update data chunk
 pos += 2;
 }
 offset++ // next source sample
 }

 // create Blob
 //return (URL || webkitURL).createObjectURL(new Blob([buffer], { type: "audio/wav" }));
 var u = (URL || webkitURL).createObjectURL(new Blob([buffer], { type: "audio/wav" }));

 //temporary part
 //downloading file to check quality
 //in this part sound is already broken, no need to show backend code
 const a = document.createElement('a');
 a.style.display = 'none';
 a.href = u;
 a.download = name;
 document.body.appendChild(a);
 a.click();



 function setUint16(data) {
 view.setUint16(pos, data, true);
 pos += 2;
 }

 function setUint32(data) {
 view.setUint32(pos, data, true);
 pos += 4;
 }
 }



-
JavaScript Audio Decoder Library or Way to Decode Browser Unsupported Audio Formats ?
20 mars 2023, par user21338683The issue :


I've spent a week trying to figure out how I can play or decode ALAC files in my Electron application.


Libraries I have tried or looked at :


- 

-
Aurora - Github issues have been stale for years. Last updates were in 2016. It doesn't work when I install it with npm.


-
Audio Decode - Doesn't support ALAC.


-
WASM Audio Decoders - Doesn't support ALAC.


-
Web Audio API from AudioJS - Depends on Aurora. Same issue where it fails to load coffee files.


-
FFmpeg.JS from Kagami - Has a memory leak then crashes.


-
FFmpeg.wasm - I went down a very deep rabbit hole trying to figure out if this was the tool I needed. More on that later.


-
A few backend audio players for NodeJS - I don't remember their names but they're all unmaintained.


-
HowlerJS - I don't know what formats they support, but it looks like it's the same as the browser, which would mean no ALAC. Still unsure.




















Things I've tried :


Web Audio API | MSE


I have tried looking into the Web Audio API and MSE and left disappointed in their lack of support for a variety of audio formats.


FFmpeg.wasm


I got it to convert an ALAC file into a format the Electron browser (which is Chrome) would accept, however, it can take several seconds to convert the whole file which is not acceptable to wait that long after you click play.


I tried reading a file stream and converting chunks, however, I was limited by what I could pass through the IPC as it's not possible to pass functions or things that can't be stringified.


Ultimately I would need to coordinate when to fetch the chunks and then play them, which sounded like a job for MSE until I read the formats it supported were even less than the Web Audio API and HTML audio tag.


I tried to set it up anyway by converting chunks in FFmpeg and reading from its memory, then passing that to an AudioContext originally, but it never played as the source was invalid. I then tried converting to a supported MSE format but that required getting the MIME type and codecs. I now needed a library for that or read the bytes myself... I used Google and the only results I get are for video decoding. Not what I need. Mux.JS is ESM based, won't work on Electron aside from its scope looking more like it's used for videos. Same for MP4Box, I just don't know yet if they will work for audio.


I got something to play using MSE by lying and saying the MIME type would be audio/mpeg. That's not scalable, not to mention MP3 is lossy and the audio tag already plays it. I don't want to convert a FLAC (which MSE doesn't support) to an MP3 just to play it when the audio tag already plays FLAC natively. That would also degrade the quality of the audio.


I also tried writing to a specific decode file and reading it while it was being written to (no idea if that could work). I didn't get the results I was looking for. Basically the file wasn't valid when it was accessed and it never got re-queried once it finished being decoded. And again, I can't pass a callback through the IPC to run once it finishes because that doesn't work. IPC doesn't pass functions.


My Next Steps


I'm reaching out here on StackOverflow to see if there is anything I can do, or try, or think of, or use. Something tells me there is a way to get this to work.


If you need extra info I can provide it. If I asked my question wrong I apologize, I'm new here. I have done some searching for existing issues, which is how I found the libraries I listed as well as browser support for different audio formats. However, the ones I found didn't dive deeper into the issue. They issues simply ended with links to browser support specs or giving the author libraries to check out. FFmpeg.wasm seems to be the most promising one, I still have it installed and trying to use it.


-