Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP 0.2

Autres articles (96)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

Sur d’autres sites (10722)

  • 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;

  • electron ffmpeg mas build "Illegal instruction : 4"

    8 mars 2021, par Martin

    I am trying to release an electron app on the Mac Apple Store (mas), my electron app uses ffmpeg to render videos. In order to release my app on the mac apple store, It needs to be sandboxed, and by default ffmpeg makes calls to external libraries so I need to statically build ffmpeg and package it with my app. My code is on the 'mas-ffmpeg-fix' branch : https://github.com/MartinBarker/digify/tree/mas-ffmpeg-fix

    &#xA;

    My static ffmpeg build works before I build my app, but after running electron-builder build --mac, the ffmpeg executable now fails with Illegal instruction: 4

    &#xA;

    This is the full timeline of building/packaging/submitting my app to the mac apple store and where the error first appears :

    &#xA;

      &#xA;
    • In Digify repo :

      &#xA;

    • &#xA;

    • clone, configure, and build static ffpmeg : “sudo rm -rf ffmpeg-mac/ && npm run download-ffmpeg”

      &#xA;

    • &#xA;

    • download-ffmpeg command is inside package.json and runs this :&#xA;git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg-mac &amp;&amp; cd ffmpeg-mac &amp;&amp; ./configure pkg_config=&#x27;pkg-config --static&#x27; --pkg-config-flags=&#x27;--static&#x27; --libdir=/usr/local/lib --extra-version=ntd_20150128 --disable-shared --disable-lzma --enable-gpl --enable-pthreads --enable-nonfree --enable-libass --enable-libfdk-aac  --enable-libmp3lame  --enable-libx264 --enable-static --enable-filters --enable-runtime-cpudetect &amp;&amp; make &amp;&amp; cd ..

      &#xA;

    • &#xA;

    • Check if any dylibb files in the static ffmpeg build with command : “otool -L ffmpeg-mac/ffmpeg | grep /usr/local”

      &#xA;

    • &#xA;

    • If there are any, move them to folder in desktop, run ‘otool’ again to ensure there are no dynamic libraries, rebuild static ffmpeg.

      &#xA;

    • &#xA;

    • there will now be a folder 'ffmpeg-mac' which contains static versions of ffmpeg and ffprobe

      &#xA;

    • &#xA;

    &#xA;

    Using ffmpeg with electron UI : works&#xA;Using Ffmpeg with command-line command :&#xA;/Users/martinbarker/Documents/projects/digify-new/ffmpeg-mac/ffmpeg -h&#xA;Works

    &#xA;

      &#xA;
    • Build mac mass app with “npm run build-mas“
    • &#xA;

    • When this command finishes it will output two files inside the /dist/mas/ folder : Digify.app and Digify-01.20.pkg (or whatever version number it is)&#xA;Ffmpeg command-line check :&#xA;/Users/martinbarker/Documents/projects/digify-new/dist/mas/Digify.app/Contents/Resources/ffmpeg -h&#xA;Illegal instruction : 4
    • &#xA;

    &#xA;

    This is the first place the error appears, after building my mac mac-apple-store app, ffmpeg fails with this err.

    &#xA;

      &#xA;
    • Sign built app with .sh file : “sh mas-sign-script.sh”&#xA;view .sh file here&#xA;
        &#xA;
      • the .sh file will output Digify-mac.pkg
      • &#xA;

      &#xA;

    • &#xA;

    • Easier command to both build & sign : “sudo rm -rf dist/mas/ && npm run build-mas && sh mas-sign-script.sh”
    • &#xA;

    • Upload the outputted “Digify-mac.pkg” file & submit to apple for review
    • &#xA;

    &#xA;

    Once this app gets published in the store, if you download it and try to run an ffmpeg command with the electron UI, it fails with this error :

    &#xA;

    /Applications/Digify.app/Contents/Resources/app.asar/node_modules/execa/lib/error.js:59 Uncaught (in promise) Error: Command failed with exit code 1: /Applications/Digify.app/Contents/Resources/ffmpeg -i /Users/martinbarker/Downloads/Felix Lebarty - Bobo/01. Bobo.mp3 -y -filter_complex concat=n=1:v=0:a=1 -c:a libmp3lame -b:a 320k /Users/martinbarker/Downloads/Felix Lebarty - Bobo/output-064237.mp3&#xA;ffmpeg version N-101191-g51a9f487ae-ntd_20150128 Copyright (c) 2000-2021 the FFmpeg developers&#xA;  built with Apple LLVM version 10.0.1 (clang-1001.0.46.4)&#xA;  configuration: pkg_config=&#x27;pkg-config --static&#x27; --pkg-config-flags=--static --libdir=/usr/local/lib --extra-version=ntd_20150128 --disable-shared --disable-lzma --enable-gpl --enable-pthreads --enable-nonfree --disable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libx264 --enable-static --enable-filters --enable-runtime-cpudetect&#xA;  libavutil      56. 65.100 / 56. 65.100&#xA;  libavcodec     58.125.100 / 58.125.100&#xA;  libavformat    58. 68.100 / 58. 68.100&#xA;  libavdevice    58. 12.100 / 58. 12.100&#xA;  libavfilter     7.107.100 /  7.107.100&#xA;  libswscale      5.  8.100 /  5.  8.100&#xA;  libswresample   3.  8.100 /  3.  8.100&#xA;  libpostproc    55.  8.100 / 55.  8.100&#xA;[mp3 @ 0x7feeae809c00] Estimating duration from bitrate, this may be inaccurate&#xA;Input #0, mp3, from &#x27;/Users/martinbarker/Downloads/Felix Lebarty - Bobo/01. Bobo.mp3&#x27;:&#xA;  Metadata:&#xA;    comment         : &#xA;    album           : Bobo&#xA;    artist          : Felix Lebarty&#xA;    title           : Funkytown Eklablog&#xA;    genre           : Boogie&#xA;    date            : 1984&#xA;  Duration: 00:05:19.53, start: 0.000000, bitrate: 320 kb/s&#xA;  Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 320 kb/s&#xA;/Users/martinbarker/Downloads/Felix Lebarty - Bobo/output-064237.mp3: Operation not permitted&#xA;    at makeError (/Applications/Digify.app/Contents/Resources/app.asar/node_modules/execa/lib/error.js:59)&#xA;    at handlePromise (/Applications/Digify.app/Contents/Resources/app.asar/node_modules/execa/index.js:114)&#xA;    at async file:/Applications/Digify.app/Contents/Resources/app.asar/src/js/newindex.js:1162&#xA;

    &#xA;

    Command failed with exit code 1: Operation not permitted

    &#xA;

  • avutil/common, macros : Move several macros from common.h to macros.h

    23 juillet 2021, par Andreas Rheinhardt
    avutil/common, macros : Move several macros from common.h to macros.h
    

    common.h currently contains several things : Math macros, UTF-8 macros,
    other fundamental macros ; furthermore it also contains miscellaneous
    math functions and it (directly and indirectly) includes lots of other
    headers.

    This commit moves the "other fundamental macros" to macros.h which is
    a more fitting place.

    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

    • [DH] doc/APIchanges
    • [DH] libavutil/common.h
    • [DH] libavutil/macros.h
    • [DH] libavutil/version.h