
Recherche avancée
Médias (1)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (29)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...)
Sur d’autres sites (6452)
-
Anomalie #2240 (Nouveau) : Chaînes de langue manquantes
21 août 2011, par Johan PustochDans la dist : dans rubrique.html, mot.html, recherche.html et modeles/plan.html (chaîne de langue de l’extension breves a priori : ) dans inclure/forum.html, 2 fois. (chaîne de langue de l’extension forum a priori ) Dans lapartie privée : info_email dans (...)
-
Evolution #2633 : Pouvoir modifier _DIR_RESTREINT_ABS
10 juillet 2015, par jluc -Si on enlève les répertoires de tests, il ne reste plus grand chose :
// normal spip.php:14:if (!defined(’_DIR_RESTREINT_ABS’)) define(’_DIR_RESTREINT_ABS’, ’ecrire/’) ; ecrire/inc_version.php:38 : define(’_DIR_RESTREINT_ABS’, ’ecrire/’) ;
// pb ecrire
ecrire/public/debusquer.php:366 : if ($reg[1]==’ecrire/public’)// dist
plugins-dist/forum/prive/modeles/forum-actions-moderer.html:2 :[(#SETretour,[(#REM|test_espace_prive| ?[(#VALecrire/|concat#SELF|replace’./’,’’)],#SELF|ancre_urlforum#ID_FORUM)])]// installation ’normale’
config/ecran_securite.php:113 : OR @file_exists(’ecrire/inc_version.php’))
config/ecran_securite.php:259:if (strpos($_SERVER[’REQUEST_URI’],"ecrire/") !==false)spip_loader.php:44:define(’_SPIP_LOADER_PLUGIN_RETOUR’, "ecrire/ ?exec=admin_plugin&voir=tous") ;
spip_loader.php:923:if (@file_exists(’ecrire/inc_version.php’))
spip_loader.php:924 : define(’_SPIP_LOADER_URL_RETOUR’, "ecrire/ ?exec=accueil") ;
spip_loader.php:925 : include_once ’ecrire/inc_version.php’ ;
spip_loader.php:933 : else define(’_SPIP_LOADER_URL_RETOUR’, "ecrire/ ?exec=install") ; -
Error using FFmpeg.wasm for audio files in react : "ffmpeg.FS('readFile', 'output.mp3') error. Check if the path exists"
25 février 2021, par Rayhan MemonI'm currently building a browser-based audio editor and I'm using ffmpeg.wasm (a pure WebAssembly/JavaScript port of FFmpeg) to do it.


I'm using this excellent example, which allows you to uploaded video file and convert it into a gif :


import React, { useState, useEffect } from 'react';
import './App.css';

import { createFFmpeg, fetchFile } from '@ffmpeg/ffmpeg';
const ffmpeg = createFFmpeg({ log: true });

function App() {
 const [ready, setReady] = useState(false);
 const [video, setVideo] = useState();
 const [gif, setGif] = useState();

 const load = async () => {
 await ffmpeg.load();
 setReady(true);
 }

 useEffect(() => {
 load();
 }, [])

 const convertToGif = async () => {
 // Write the file to memory 
 ffmpeg.FS('writeFile', 'test.mp4', await fetchFile(video));

 // Run the FFMpeg command
 await ffmpeg.run('-i', 'test.mp4', '-t', '2.5', '-ss', '2.0', '-f', 'gif', 'out.gif');

 // Read the result
 const data = ffmpeg.FS('readFile', 'out.gif');

 // Create a URL
 const url = URL.createObjectURL(new Blob([data.buffer], { type: 'image/gif' }));
 setGif(url)
 }

 return ready ? (
 
 <div classname="App">
 { video && 

 }


 <input type="file" />> setVideo(e.target.files?.item(0))} />

 <h3>Result</h3>

 <button>Convert</button>

 { gif && <img src="http://stackoverflow.com/feeds/tag/{gif}" width="250" style='max-width: 300px; max-height: 300px' />}

 </div>
 )
 :
 (
 <p>Loading...</p>
 );
}

export default App;



I've modified the above code to take an mp3 file recorded in the browser (recorded using the npm package 'mic-recorder-to-mp3' and passed to this component as a blobURL in the global state) and do something to it using ffmpeg.wasm :


import React, { useContext, useState, useEffect } from 'react';
import Context from '../../store/Context';
import Toolbar from '../Toolbar/Toolbar';
import AudioTranscript from './AudioTranscript';

import { createFFmpeg, fetchFile } from '@ffmpeg/ffmpeg';

//Create ffmpeg instance and set 'log' to true so we can see everything
//it does in the console
const ffmpeg = createFFmpeg({ log: true });

const AudioEditor = () => {
 //Setup Global State and get most recent recording
 const { globalState } = useContext(Context);
 const { blobURL } = globalState;

 //ready flag for when ffmpeg is loaded
 const [ready, setReady] = useState(false);

 const [outputFileURL, setOutputFileURL] = useState('');

 //Load FFmpeg asynchronously and set ready when it's ready
 const load = async () => {
 await ffmpeg.load();
 setReady(true);
 }

 //Use UseEffect to run the 'load' function on mount
 useEffect(() => {
 load();
 }, []);

 const ffmpegTest = async () => {
 //must first write file to memory as test.mp3
 ffmpeg.FS('writeFile', 'test.mp3', await fetchFile(blobURL));

 //Run the FFmpeg command
 //in this case, trim file size down to 1.5s and save to memory as output.mp3
 ffmpeg.run('-i', 'test.mp3', '-t', '1.5', 'output.mp3');

 //Read the result from memory
 const data = ffmpeg.FS('readFile', 'output.mp3');

 //Create URL so it can be used in the browser
 const url = URL.createObjectURL(new Blob([data.buffer], { type: 'audio/mp3' }));
 setOutputFileURL(url);
 }

 return ready ? ( 
 <div>
 <audiotranscript></audiotranscript>
 <toolbar></toolbar>
 <button>
 Edit
 </button>
 {outputFileURL && 
 
 }
 </div>
 ) : (
 <div>
 Loading...
 </div>
 )
}

export default AudioEditor;



This code returns the following error when I press the edit button to call the ffmpegTest function :



I've experimented, and when I tweak the culprit line of code to :


const data = ffmpeg.FS('readFile', 'test.mp3');



the function runs without error, simply returning the input file. So I assume there must be something wrong with ffmpeg.run() line not storing 'output.mp3' in memory perhaps ? I can't for the life of me figure out what's going on...any help would be appreciated !