
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (51)
-
Demande de création d’un canal
12 mars 2010, parEn fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...) -
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 -
Taille des images et des logos définissables
9 février 2011, parDans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)
Sur d’autres sites (8418)
-
Can't upload huge video to google storage. I using "@ffmpeg-installer/ffmpeg" and @google-cloud/storage
20 juillet 2022, par Dmytro PetskovychI upload file to google storage using "@ffmpeg-installer/ffmpeg" and @google-cloud/storage in my node.js App.
Step 1. file uploading to fs is in child processes - one process for each type of resolution (totaly six).
step 2. encription (converting to stream)
step 3. upload to google storage


I use "Upload a directory to a bucket" in order to send the video from the client to the Google Cloud Storage bucket.


This way is working fine only with small file.


when I upload video, actually I upload six videos, one for each type resolution


for example when I upload video with duration one hour it split on chunk and totally I get more three thousands files.


So actually i upload folder with large amount of files, but not all of this files are uploaded to cloud.


maybe someone had the similar problem and helps fix it.




const uploadFolder = async (bucketName, directoryPath, socketInstance) => {
 try {
 let dirCtr = 1;
 let itemCtr = 0;
 const fileList = [];

 const onComplete = async () => {
 const folderName = nanoid(46);

 await Promise.all(
 fileList.map(filePath => {
 const fileName = path.relative(directoryPath, filePath);
 const destination = `${ folderName }/${ fileName }`;

 return storage
 .bucket(bucketName)
 .upload(filePath, { destination })
 .then(
 uploadResp => ({ fileName: destination, status: uploadResp[0] }),
 err => ({ fileName: destination, response: err })
 );
 })
 );

 if (socketInstance) socketInstance.emit('uploadProgress', {
 message: `Added files to Google bucket`,
 last: false,
 part: false
 });

 return folderName;
 };

 const getFiles = async directory => {
 const items = await fs.readdir(directory);
 dirCtr--;
 itemCtr += items.length;
 for(const item of items) {
 const fullPath = path.join(directory, item);
 const stat = await fs.stat(fullPath);
 itemCtr--;
 if (stat.isFile()) {
 fileList.push(fullPath);
 } else if (stat.isDirectory()) {
 dirCtr++;
 await getFiles(fullPath);
 }
 }
 }

 await getFiles(directoryPath);

 return onComplete();
 } catch (e) {
 log.error(e.message);
 throw new Error('Can\'t store folder.');
 }
 };







-
FFMPEG creating mp3 with "Junk" at the end
13 juillet 2022, par JohnarasI have a web application which converts WebM files to mp3 using FFMPEG.js in the Client-Side. Once the mp3 conversion finishes, users are prompted to download their file.


Lately, I realized that a lot of mp3 files which I tried to converted have a different duration value than the original WebM file. The duration is usually longer. For instance, a WebM file with duration of 2:16 gets converted to an mp3 file with a duration of 2:29. Once the player reaches at 2:16 it just goes back to the start.


I have tried to open the file in Audacity but it keeps saying that this MP3 file seems to be "Malformed".


I also tried to use MP3val and it says the file has junk at the end.


Code Snippets :


const worker = new Worker("/ffmpeg-worker-mp4.js");
import { fetchFile } from "@ffmpeg/ffmpeg"; // https://www.npmjs.com/package/@ffmpeg/ffmpeg

const convertSong = async (title, id, bitrate) => {
 setProgress("Initializing...")
 ffmpegVars = [title]
 
 worker.postMessage({
 type: "run",
 arguments: ["-i", `input.webm`, "-c:a", "libmp3lame", "-vn", "-ab", `${bitrate ? bitrate : 256}k`, "-ar", "44100", "-f", "mp3", `output.mp3`],
 MEMFS: [{ name: "input.webm", data: await fetchFile(`/api/download/stream?video=${id}`) }]
 });
}

convertSong(data.title, data.id, data.bitrate)



I'm literally willing to pay anyone who helps me fix this.


-
Failed to convert web-saved .wemb audio to .wav by using php "shell_exec" and javascript
30 mai 2022, par AnirbasgnawI'm working on an online experimenter which could record participants' audio from the browser. The audio data I get has an extension of .wemb, so I plan to use ffmpeg to convert it to .wav while I save the data.


I tried to use PHP's
shell_exec
but nothing happens when I run the scripts. Then I found that myecho
andprint_r
also did not work. I'm new to PHP and javascript, so I''m really confused now.

Below are the relevant codes, I really appreciate it if you could help !


write_data.php
:

<?php
 $post_data = json_decode(file_get_contents('php://input'), true); 
 // the directory "data" must be writable by the server
 $name = "../".$post_data['filename'];
 $data = $post_data['filedata'];
 // write the file to disk
 file_put_contents($name, $data);
 
 $INPUT = trim($name) . ".webm";
 $OUTPUT = trim($name) . ".wav";
 echo "start converting...";

 // check if ffmprg is available
 $ffmpeg = trim(shell_exec('which ffmpeg'));
 print_r($ffmpeg);
 // call ffmpeg
 shell_exec("ffmpeg -i '$INPUT' -ac 1 -f wav '$OUTPUT' 2>&1 ");
?>



javascript
:

saveData: function(fileName,format){
 // save as json by default
 if (!format){ format = 'json';}
 // add extension to filename
 fileName = `${fileName}.${format}`
 // create saveData object using fetch
 let saveData = [];
 if (format == 'json') {
 saveData = {
 type: 'call-function',
 async: true,
 func: async function(done) {
 let data = jsPsych.data.get().json();
 const response = await fetch("../write_data.php", {
 method: "POST",
 headers: {
 "content-type": "application/json"
 },
 body: JSON.stringify({ filename: fileName, filedata: data })
 });
 if (response.ok) {
 const responseBody = await response.text();
 done(responseBody);
 }
 }
 }
 } else {
 saveData = {
 type: 'call-function',
 async: true,
 func: async function(done) {
 let data = jsPsych.data.get().csv();
 const response = await fetch("../write_data.php", {
 method: "POST",
 headers: {
 "content-type": "application/json"
 },
 body: JSON.stringify({ filename: fileName, filedata: data })
 });
 if (response.ok) {
 const responseBody = await response.text();
 done(responseBody);
 }
 }
 }
 }
 return saveData;
 },