Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (29)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains 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, par

    Pré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 2011

    Unfortunately 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 Pustoch

    Dans 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 Memon

    I'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 &#x27;react&#x27;;&#xA;import &#x27;./App.css&#x27;;&#xA;&#xA;import { createFFmpeg, fetchFile } from &#x27;@ffmpeg/ffmpeg&#x27;;&#xA;const ffmpeg = createFFmpeg({ log: true });&#xA;&#xA;function App() {&#xA;  const [ready, setReady] = useState(false);&#xA;  const [video, setVideo] = useState();&#xA;  const [gif, setGif] = useState();&#xA;&#xA;  const load = async () => {&#xA;    await ffmpeg.load();&#xA;    setReady(true);&#xA;  }&#xA;&#xA;  useEffect(() => {&#xA;    load();&#xA;  }, [])&#xA;&#xA;  const convertToGif = async () => {&#xA;    // Write the file to memory &#xA;    ffmpeg.FS(&#x27;writeFile&#x27;, &#x27;test.mp4&#x27;, await fetchFile(video));&#xA;&#xA;    // Run the FFMpeg command&#xA;    await ffmpeg.run(&#x27;-i&#x27;, &#x27;test.mp4&#x27;, &#x27;-t&#x27;, &#x27;2.5&#x27;, &#x27;-ss&#x27;, &#x27;2.0&#x27;, &#x27;-f&#x27;, &#x27;gif&#x27;, &#x27;out.gif&#x27;);&#xA;&#xA;    // Read the result&#xA;    const data = ffmpeg.FS(&#x27;readFile&#x27;, &#x27;out.gif&#x27;);&#xA;&#xA;    // Create a URL&#xA;    const url = URL.createObjectURL(new Blob([data.buffer], { type: &#x27;image/gif&#x27; }));&#xA;    setGif(url)&#xA;  }&#xA;&#xA;  return ready ? (&#xA;    &#xA;    <div classname="App">&#xA;      { video &amp;&amp; &#xA;&#xA;      }&#xA;&#xA;&#xA;      <input type="file" />> setVideo(e.target.files?.item(0))} />&#xA;&#xA;      <h3>Result</h3>&#xA;&#xA;      <button>Convert</button>&#xA;&#xA;      { gif &amp;&amp; <img src="http://stackoverflow.com/feeds/tag/{gif}" width="250" style='max-width: 300px; max-height: 300px' />}&#xA;&#xA;    </div>&#xA;  )&#xA;    :&#xA;    (&#xA;      <p>Loading...</p>&#xA;    );&#xA;}&#xA;&#xA;export default App;&#xA;

    &#xA;

    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 :

    &#xA;

    import React, { useContext, useState, useEffect } from &#x27;react&#x27;;&#xA;import Context from &#x27;../../store/Context&#x27;;&#xA;import Toolbar from &#x27;../Toolbar/Toolbar&#x27;;&#xA;import AudioTranscript from &#x27;./AudioTranscript&#x27;;&#xA;&#xA;import { createFFmpeg, fetchFile } from &#x27;@ffmpeg/ffmpeg&#x27;;&#xA;&#xA;//Create ffmpeg instance and set &#x27;log&#x27; to true so we can see everything&#xA;//it does in the console&#xA;const ffmpeg = createFFmpeg({ log: true });&#xA;&#xA;const AudioEditor = () => {&#xA;    //Setup Global State and get most recent recording&#xA;    const { globalState } = useContext(Context);&#xA;    const { blobURL } = globalState;&#xA;&#xA;    //ready flag for when ffmpeg is loaded&#xA;    const [ready, setReady] = useState(false);&#xA;&#xA;    const [outputFileURL, setOutputFileURL] = useState(&#x27;&#x27;);&#xA;&#xA;    //Load FFmpeg asynchronously and set ready when it&#x27;s ready&#xA;    const load = async () => {&#xA;        await ffmpeg.load();&#xA;        setReady(true);&#xA;    }&#xA;&#xA;    //Use UseEffect to run the &#x27;load&#x27; function on mount&#xA;    useEffect(() => {&#xA;        load();&#xA;    }, []);&#xA;&#xA;    const ffmpegTest = async () => {&#xA;        //must first write file to memory as test.mp3&#xA;        ffmpeg.FS(&#x27;writeFile&#x27;, &#x27;test.mp3&#x27;, await fetchFile(blobURL));&#xA;&#xA;        //Run the FFmpeg command&#xA;        //in this case, trim file size down to 1.5s and save to memory as output.mp3&#xA;        ffmpeg.run(&#x27;-i&#x27;, &#x27;test.mp3&#x27;, &#x27;-t&#x27;, &#x27;1.5&#x27;, &#x27;output.mp3&#x27;);&#xA;&#xA;        //Read the result from memory&#xA;        const data = ffmpeg.FS(&#x27;readFile&#x27;, &#x27;output.mp3&#x27;);&#xA;&#xA;        //Create URL so it can be used in the browser&#xA;        const url = URL.createObjectURL(new Blob([data.buffer], { type: &#x27;audio/mp3&#x27; }));&#xA;        setOutputFileURL(url);&#xA;    }&#xA;&#xA;    return ready ? ( &#xA;        <div>&#xA;            <audiotranscript></audiotranscript>&#xA;            <toolbar></toolbar>&#xA;            <button>&#xA;                Edit&#xA;            </button>&#xA;            {outputFileURL &amp;&amp; &#xA;                &#xA;            }&#xA;        </div>&#xA;    ) : (&#xA;        <div>&#xA;            Loading...&#xA;        </div>&#xA;    )&#xA;}&#xA;&#xA;export default AudioEditor;&#xA;

    &#xA;

    This code returns the following error when I press the edit button to call the ffmpegTest function :&#xA;enter image description here

    &#xA;

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

    &#xA;

    const data = ffmpeg.FS(&#x27;readFile&#x27;, &#x27;test.mp3&#x27;);&#xA;

    &#xA;

    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 !

    &#xA;