Recherche avancée

Médias (91)

Autres articles (75)

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

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

Sur d’autres sites (9810)

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

  • How to build FFmpeg with Apple Symbols ?

    22 septembre 2021, par Meh.

    MOVED FROM : https://superuser.com/questions/1676856/how-to-build-ffmpeg-with-apple-symbols?noredirect=1#comment2572799_1676856

    &#xA;

    I'm trying to build FFmpeg 3.2.4 with OpenSSL >= 2.0.7 (3.0.0) from source so I can use it's binaries to build Dolphin-Emu.

    &#xA;

    I just do this : ./configure --enable-gnutls and when I build with make -j5 (-j5 speeds up the process) then make install. When I use it in compiling Dolphin , I get an error somewhat like this :

    &#xA;

    Undefined symbols for architecture x86_64:&#xA;  "_kCVImageBufferColorPrimaries_ITU_R_709_2", referenced from:&#xA;      _vtenc_init in libavcodec.a(videotoolboxenc.o)&#xA;      _vtenc_init in libavcodec.a(videotoolboxenc.o)&#xA;  "_kVDADecoderConfiguration_SourceFormat", referenced from:&#xA;  "_kCVImageBufferTransferFunction_ITU_R_2020", referenced from:&#xA;      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)&#xA;      _vtenc_init in libavcodec.a(videotoolboxenc.o)&#xA;  "_kVDADecoderConfiguration_avcCData", referenced from:&#xA;  "_CMBlockBufferCopyDataBytes", referenced from:&#xA;      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)&#xA;      _vtenc_frame in libavcodec.a(videotoolboxenc.o)&#xA;  "_kCVImageBufferYCbCrMatrixKey", referenced from:&#xA;      _vtenc_init in libavcodec.a(videotoolboxenc.o)&#xA;      _vtenc_send_frame in libavcodec.a(videotoolboxenc.o)&#xA;  "_SSLSetCertificate", referenced from:&#xA;      _tls_open in libavformat.a(tls_securetransport.o)&#xA;  "_CMTimeMake", referenced from:&#xA;      _vtenc_send_frame in libavcodec.a(videotoolboxenc.o)&#xA;  "_kCVPixelBufferWidthKey", referenced from:&#xA;      _vtenc_init in libavcodec.a(videotoolboxenc.o)&#xA;  "_VDADecoderCreate", referenced from:&#xA;      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)&#xA;  "_kVTProfileLevel_H264_High_4_2", referenced from:&#xA;      _vtenc_init in libavcodec.a(videotoolboxenc.o)&#xA;  "_kCVPixelBufferIOSurfacePropertiesKey", referenced from:&#xA;      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)&#xA;  "_kVTProfileLevel_H264_Baseline_1_3", referenced from:&#xA;      _vtenc_init in libavcodec.a(videotoolboxenc.o)&#xA;(example)&#xA;

    &#xA;

    These _kV(blahblahblah) symbols are provided by Apple... under <coremedia></coremedia>CoreMedia.h> so my mac should DEFINITELY have this. OpenSSL version is 3.0.0 as there's an error about _SSLSetCertificate not existing.

    &#xA;

    Does anyone have any ideas why this is throwing undefined symbols for existing symbols ? (My FFmpeg is compiled by clang whenever I use make, and I use gnutls(installed by brew) which should rely on openssl3.0)

    &#xA;

    Xcode version : 11.3.1 (Only has macos 10.15 SDK)

    &#xA;

    Linker command to link Dolphin and FFmpeg w/ OpenSSL binaries/libs

    &#xA;

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c&#x2B;&#x2B; -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14.0 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/usr/local/lib -Wl,-dead_strip,-dead_strip_dylibs CMakeFiles/dolphin-nogui.dir/Platform.cpp.o CMakeFiles/dolphin-nogui.dir/PlatformHeadless.cpp.o CMakeFiles/dolphin-nogui.dir/MainNoGUI.cpp.o -o ../../../Binaries/dolphin-emu-nogui  ../Core/libcore.a ../UICommon/libuicommon.a ../../../Externals/cpp-optparse/libcpp-optparse.a ../VideoBackends/Null/libvideonull.a ../VideoBackends/OGL/libvideoogl.a ../VideoBackends/Software/libvideosoftware.a ../VideoBackends/Vulkan/libvideovulkan.a ../VideoCommon/libvideocommon.a ../Core/libcore.a ../VideoBackends/Null/libvideonull.a ../VideoBackends/OGL/libvideoogl.a ../VideoBackends/Software/libvideosoftware.a ../VideoBackends/Vulkan/libvideovulkan.a ../VideoCommon/libvideocommon.a ../AudioCommon/libaudiocommon.a /usr/local/lib/libpulse.dylib ../../../Externals/soundtouch/libSoundTouch.a ../../../Externals/FreeSurround/libFreeSurround.a ../../../Externals/cubeb/libcubeb.a -framework AudioUnit -framework CoreAudio -framework CoreServices ../DiscIO/libdiscio.a /usr/lib/libbz2.dylib ../../../Externals/liblzma/liblzma.a ../../../Externals/zstd/libzstd.a ../InputCommon/libinputcommon.a -framework Carbon -framework ForceFeedback /usr/local/lib/libSDL2.dylib -framework Cocoa ../../../Externals/SFML/libsfml-network.a ../../../Externals/SFML/libsfml-system.a ../../../Externals/LZO/liblzo2.a -framework CoreServices -framework IOBluetooth ../../../Externals/mGBA/mgba/libmgba.a -framework Foundation -lm ../../../Externals/hidapi/libhidapi.a ../../../Externals/glslang/libglslang.a ../../../Externals/xxhash/libxxhash.a ../../../Externals/imgui/libimgui.a /usr/local/lib/libavformat.a /usr/local/lib/libavcodec.a /usr/local/lib/libswscale.a /usr/local/lib/libavutil.a ../Common/libcommon.a ../../../Externals/enet/libenet.a ../../../Externals/mbedtls/library/libmbedtls.a ../../../Externals/mbedtls/library/libmbedx509.a ../../../Externals/mbedtls/library/libmbedcrypto.a /usr/lib/libcurl.dylib /usr/lib/libiconv.dylib ../../../Externals/libpng/libpng.a -framework AppKit ../../../Externals/miniupnpc/libminiupnpc.a ../../../Externals/pugixml/libpugixml.a ../../../Externals/fmt/libfmt.a ../../../Externals/Bochs_disasm/libbdisasm.a ../../../Externals/libusb/libusb.a -framework CoreFoundation -framework IOKit /usr/lib/libobjc.dylib ../../../Externals/minizip/libminizip.a /usr/lib/libz.dylib ../../../Externals/discord-rpc/src/libdiscord-rpc.a -lpthread -framework AppKit &#xA;

    &#xA;

  • How to resolve FFmpeg undefined symbols error when using libavformat in Dolphin

    24 septembre 2021, par Meh.

    MOVED FROM : https://superuser.com/questions/1676856/how-to-build-ffmpeg-with-apple-symbols?noredirect=1#comment2572799_1676856

    &#xA;

    I'm trying to build FFmpeg 3.2.4 with OpenSSL >= 2.0.7 (3.0.0) from source so I can use it's binaries to build Dolphin-Emu.

    &#xA;

    I just do this : ./configure --enable-gnutls and when I build with make -j5 (-j5 speeds up the process) then make install. When I use it in compiling Dolphin , I get an error somewhat like this :

    &#xA;

    Undefined symbols for architecture x86_64:&#xA;  "_kCVImageBufferColorPrimaries_ITU_R_709_2", referenced from:&#xA;      _vtenc_init in libavcodec.a(videotoolboxenc.o)&#xA;      _vtenc_init in libavcodec.a(videotoolboxenc.o)&#xA;  "_kVDADecoderConfiguration_SourceFormat", referenced from:&#xA;  "_kCVImageBufferTransferFunction_ITU_R_2020", referenced from:&#xA;      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)&#xA;      _vtenc_init in libavcodec.a(videotoolboxenc.o)&#xA;  "_kVDADecoderConfiguration_avcCData", referenced from:&#xA;  "_CMBlockBufferCopyDataBytes", referenced from:&#xA;      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)&#xA;      _vtenc_frame in libavcodec.a(videotoolboxenc.o)&#xA;  "_kCVImageBufferYCbCrMatrixKey", referenced from:&#xA;      _vtenc_init in libavcodec.a(videotoolboxenc.o)&#xA;      _vtenc_send_frame in libavcodec.a(videotoolboxenc.o)&#xA;  "_SSLSetCertificate", referenced from:&#xA;      _tls_open in libavformat.a(tls_securetransport.o)&#xA;  "_CMTimeMake", referenced from:&#xA;      _vtenc_send_frame in libavcodec.a(videotoolboxenc.o)&#xA;  "_kCVPixelBufferWidthKey", referenced from:&#xA;      _vtenc_init in libavcodec.a(videotoolboxenc.o)&#xA;  "_VDADecoderCreate", referenced from:&#xA;      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)&#xA;  "_kVTProfileLevel_H264_High_4_2", referenced from:&#xA;      _vtenc_init in libavcodec.a(videotoolboxenc.o)&#xA;  "_kCVPixelBufferIOSurfacePropertiesKey", referenced from:&#xA;      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)&#xA;  "_kVTProfileLevel_H264_Baseline_1_3", referenced from:&#xA;      _vtenc_init in libavcodec.a(videotoolboxenc.o)&#xA;(example)&#xA;

    &#xA;

    These _kV(blahblahblah) symbols are provided by Apple... under <coremedia></coremedia>CoreMedia.h> so my mac should DEFINITELY have this. OpenSSL version is 3.0.0 as there's an error about _SSLSetCertificate not existing.

    &#xA;

    Does anyone have any ideas why this is throwing undefined symbols for existing symbols ? (My FFmpeg is compiled by clang whenever I use make, and I use gnutls(installed by brew) which should rely on openssl3.0)

    &#xA;

    Xcode version : 11.3.1 (Only has macos 10.15 SDK)

    &#xA;

    Linker command to link Dolphin and FFmpeg w/ OpenSSL binaries/libs

    &#xA;

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c&#x2B;&#x2B; -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14.0 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/usr/local/lib -Wl,-dead_strip,-dead_strip_dylibs CMakeFiles/dolphin-nogui.dir/Platform.cpp.o CMakeFiles/dolphin-nogui.dir/PlatformHeadless.cpp.o CMakeFiles/dolphin-nogui.dir/MainNoGUI.cpp.o -o ../../../Binaries/dolphin-emu-nogui  ../Core/libcore.a ../UICommon/libuicommon.a ../../../Externals/cpp-optparse/libcpp-optparse.a ../VideoBackends/Null/libvideonull.a ../VideoBackends/OGL/libvideoogl.a ../VideoBackends/Software/libvideosoftware.a ../VideoBackends/Vulkan/libvideovulkan.a ../VideoCommon/libvideocommon.a ../Core/libcore.a ../VideoBackends/Null/libvideonull.a ../VideoBackends/OGL/libvideoogl.a ../VideoBackends/Software/libvideosoftware.a ../VideoBackends/Vulkan/libvideovulkan.a ../VideoCommon/libvideocommon.a ../AudioCommon/libaudiocommon.a /usr/local/lib/libpulse.dylib ../../../Externals/soundtouch/libSoundTouch.a ../../../Externals/FreeSurround/libFreeSurround.a ../../../Externals/cubeb/libcubeb.a -framework AudioUnit -framework CoreAudio -framework CoreServices ../DiscIO/libdiscio.a /usr/lib/libbz2.dylib ../../../Externals/liblzma/liblzma.a ../../../Externals/zstd/libzstd.a ../InputCommon/libinputcommon.a -framework Carbon -framework ForceFeedback /usr/local/lib/libSDL2.dylib -framework Cocoa ../../../Externals/SFML/libsfml-network.a ../../../Externals/SFML/libsfml-system.a ../../../Externals/LZO/liblzo2.a -framework CoreServices -framework IOBluetooth ../../../Externals/mGBA/mgba/libmgba.a -framework Foundation -lm ../../../Externals/hidapi/libhidapi.a ../../../Externals/glslang/libglslang.a ../../../Externals/xxhash/libxxhash.a ../../../Externals/imgui/libimgui.a /usr/local/lib/libavformat.a /usr/local/lib/libavcodec.a /usr/local/lib/libswscale.a /usr/local/lib/libavutil.a ../Common/libcommon.a ../../../Externals/enet/libenet.a ../../../Externals/mbedtls/library/libmbedtls.a ../../../Externals/mbedtls/library/libmbedx509.a ../../../Externals/mbedtls/library/libmbedcrypto.a /usr/lib/libcurl.dylib /usr/lib/libiconv.dylib ../../../Externals/libpng/libpng.a -framework AppKit ../../../Externals/miniupnpc/libminiupnpc.a ../../../Externals/pugixml/libpugixml.a ../../../Externals/fmt/libfmt.a ../../../Externals/Bochs_disasm/libbdisasm.a ../../../Externals/libusb/libusb.a -framework CoreFoundation -framework IOKit /usr/lib/libobjc.dylib ../../../Externals/minizip/libminizip.a /usr/lib/libz.dylib ../../../Externals/discord-rpc/src/libdiscord-rpc.a -lpthread -framework AppKit &#xA;

    &#xA;