Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (58)

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

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (7772)

  • Is there a way to improve video fetching speed when using FFmpeg for trimming ?

    14 janvier 2024, par Otis

    I have a React component that uses the @ffmpeg/ffmpeg library to trim videos. The trimming process involves fetching a video file from a URL and then using FFmpeg to perform the actual trim. I've noticed that when I execute the trimVideo function on a new URL for the first time, it takes a considerable amount of time to fetch the file. However, on subsequent executions with the same URL, it executes in less than 5 seconds.

    


    import { useEffect, useRef, useState } from &#x27;react&#x27;;&#xA;import { FFmpeg } from &#x27;@ffmpeg/ffmpeg&#x27;;&#xA;import { fetchFile, toBlobURL } from &#x27;@ffmpeg/util&#x27;;&#xA;&#xA;&#xA;export default function TrimVideo() {&#xA;    const [loaded, setLoaded] = useState(false);&#xA;    const [isLoading, setIsLoading] = useState(false);&#xA;    const [trimmedBlobUrl, setTrimmedBlobUrl] = useState(&#x27;&#x27;);&#xA;    const [progress, setProgress] = useState<any>(0);&#xA;    const ffmpegRef = useRef<any>(new FFmpeg());&#xA;    const videoRef = useRef<any>(null);&#xA;    const messageRef = useRef<any>(null);&#xA;&#xA;    const [exporting, setExporting] = useState(false);&#xA;&#xA;    const onlineVideoUrl =&#xA;        &#x27;http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4&#x27;;&#xA;&#xA;    const loadFFmpeg = async () => {&#xA;        setIsLoading(true);&#xA;&#xA;        const baseURL = &#x27;https://unpkg.com/@ffmpeg/core@0.12.2/dist/umd&#x27;;&#xA;        const ffmpeg = ffmpegRef.current;&#xA;&#xA;        ffmpeg.on(&#x27;log&#x27;, ({ message }: any) => {&#xA;            if (messageRef.current) messageRef.current.innerHTML = message;&#xA;        });&#xA;&#xA;        // Load FFmpeg core and wasm files&#xA;        await ffmpeg.load({&#xA;            coreURL: await toBlobURL(&#xA;                `${baseURL}/ffmpeg-core.js`,&#xA;                &#x27;text/javascript&#x27;,&#xA;            ),&#xA;            wasmURL: await toBlobURL(&#xA;                `${baseURL}/ffmpeg-core.wasm`,&#xA;                &#x27;application/wasm&#x27;,&#xA;            ),&#xA;        });&#xA;&#xA;        setLoaded(true);&#xA;        setIsLoading(false);&#xA;    };&#xA;&#xA;    useEffect(() => {&#xA;        loadFFmpeg();&#xA;    }, []);&#xA;&#xA;    const trimVideo = async () => {&#xA;        const ffmpeg = ffmpegRef.current;&#xA;        setExporting(true);&#xA;        setProgress(0);&#xA;&#xA;        const trimStart = 1;&#xA;        const trimEnd = 40;&#xA;        const trimmedVideo = trimEnd - trimStart;&#xA;&#xA;&#xA;        try {&#xA;            console.log(&#x27;Fetching Video...&#x27;);&#xA;            await ffmpeg.writeFile(&#xA;                &#x27;myFile.mp4&#x27;,&#xA;                await fetchFile(onlineVideoUrl),&#xA;            );&#xA;            console.log(&#x27;Executing FFMPEG...&#x27;);&#xA;            await ffmpeg.exec([&#xA;                &#x27;-ss&#x27;,&#xA;                `${trimStart}`,&#xA;                &#x27;-accurate_seek&#x27;,&#xA;                &#x27;-i&#x27;,&#xA;                &#x27;myFile.mp4&#x27;,&#xA;                &#x27;-to&#x27;,&#xA;                `${trimmedVideo}`,&#xA;                &#x27;-codec&#x27;,&#xA;                &#x27;copy&#x27;,&#xA;                &#x27;output.mp4&#x27;,&#xA;            ]);&#xA;&#xA;            const data: any = await ffmpeg?.readFile(&#x27;output.mp4&#x27;);&#xA;            const url = URL.createObjectURL(&#xA;                new Blob([data.buffer], { type: &#x27;video/mp4&#x27; }),&#xA;            );&#xA;            setTrimmedBlobUrl(url);&#xA;        } catch (error) {&#xA;            console.log(error);&#xA;        } finally {&#xA;            setProgress(0);&#xA;            setExporting(false);&#xA;        }&#xA;    };&#xA;&#xA;&#xA;    return loaded ? (&#xA;      <div>&#xA;        {trimmedBlobUrl &amp;&amp; (&#xA;          <video ref="{videoRef}" controls="controls" src="{trimmedBlobUrl}"></video>&#xA;        )}&#xA;        <br />&#xA;&#xA;        <button>> trimVideo()}>Trim Video</button>&#xA;        <h3>Progress: {progress}</h3>&#xA;        <p ref="{messageRef}"></p>&#xA;      </div>&#xA;    ) : (&#xA;      <p>Loading FFmpeg...</p>&#xA;    );&#xA;}&#xA;</any></any></any></any>

    &#xA;

    Is there a way to improve the fetching of the video to be consistently fast across all executions ?

    &#xA;

  • Install gstreamer on EC2 Amazon Linux AMI ?

    6 décembre 2015, par vy32

    I’m trying to install QT5.5 on Amazon EC2 Linux, which apparently requires that I install some kind of multimedia support. It looks like that comes from gstreamer.

    yum search gstreamer turns up :

    [ec2-user@ip-172-30-1-58 ~]$ yum search gstreamer
    Loaded plugins: priorities, update-motd, upgrade-helper
    23 packages excluded due to repository priority protections
    ============================================== N/S matched: gstreamer ==============================================
    gstreamer-ffmpeg.x86_64 : GStreamer FFmpeg-based plug-ins
    gstreamer-ffmpeg-debuginfo.x86_64 : Debug information for package gstreamer-ffmpeg
    gstreamer-plugins-bad.x86_64 : GStreamer streaming media framework "bad" plug-ins
    gstreamer-plugins-bad-debuginfo.x86_64 : Debug information for package gstreamer-plugins-bad
    gstreamer-plugins-bad-nonfree.x86_64 : Non Free GStreamer streaming media framework "bad" plug-ins
    gstreamer-plugins-bad-nonfree-debuginfo.x86_64 : Debug information for package gstreamer-plugins-bad-nonfree
    gstreamer-plugins-ugly.x86_64 : GStreamer streaming media framework "ugly" plug-ins
    gstreamer-plugins-ugly-debuginfo.x86_64 : Debug information for package gstreamer-plugins-ugly
    gstreamer-plugins-ugly-devel-docs.noarch : Development documentation for the GStreamer "ugly" plug-ins
    gstreamer1-libav.x86_64 : GStreamer 1.0 libav-based plug-ins
    gstreamer1-libav-debuginfo.x86_64 : Debug information for package gstreamer1-libav
    gstreamer1-plugins-bad-freeworld.x86_64 : GStreamer 1.0 streaming media framework "bad" plug-ins
    gstreamer1-plugins-bad-freeworld-debuginfo.x86_64 : Debug information for package gstreamer1-plugins-bad-freeworld
    gstreamer1-plugins-ugly.x86_64 : GStreamer 1.0 streaming media framework "ugly" plug-ins
    gstreamer1-plugins-ugly-debuginfo.x86_64 : Debug information for package gstreamer1-plugins-ugly
    gstreamer1-plugins-ugly-devel-docs.noarch : Development documentation for the GStreamer "ugly" plug-ins
    gstreamer1-vaapi.x86_64 : GStreamer plugins to use VA API video acceleration
    gstreamer1-vaapi-debuginfo.x86_64 : Debug information for package gstreamer1-vaapi
    gstreamer1-vaapi-devel.x86_64 : Development files for gstreamer1-vaapi
    qt-gstreamer.x86_64 : C++ bindings for GStreamer with a Qt-style API
    qt-gstreamer-debuginfo.x86_64 : Debug information for package qt-gstreamer
    qt-gstreamer-devel.x86_64 : Header files and development documentation for qt-gstreamer

     Name and summary matches only, use "search all" for everything.
    [ec2-user@ip-172-30-1-58 ~]$ %

    However, when I try to install one of these, I get this error :

    $ sudo yum install -y gstreamer-ffmpeg
    Loaded plugins: priorities, update-motd, upgrade-helper
    23 packages excluded due to repository priority protections
    Resolving Dependencies
    --> Running transaction check
    ---> Package gstreamer-ffmpeg.x86_64 0:0.10.13-15.el7.nux will be installed
    --> Processing Dependency: liborc-0.4.so.0()(64bit) for package: gstreamer-ffmpeg-0.10.13-15.el7.nux.x86_64
    --> Processing Dependency: libgstvideo-0.10.so.0()(64bit) for package: gstreamer-ffmpeg-0.10.13-15.el7.nux.x86_64
    --> Processing Dependency: libgstreamer-0.10.so.0()(64bit) for package: gstreamer-ffmpeg-0.10.13-15.el7.nux.x86_64
    --> Processing Dependency: libgstpbutils-0.10.so.0()(64bit) for package: gstreamer-ffmpeg-0.10.13-15.el7.nux.x86_64
    --> Processing Dependency: libgstbase-0.10.so.0()(64bit) for package: gstreamer-ffmpeg-0.10.13-15.el7.nux.x86_64
    --> Processing Dependency: libgstaudio-0.10.so.0()(64bit) for package: gstreamer-ffmpeg-0.10.13-15.el7.nux.x86_64
    --> Finished Dependency Resolution
    Error: Package: gstreamer-ffmpeg-0.10.13-15.el7.nux.x86_64 (nux-dextop)
              Requires: liborc-0.4.so.0()(64bit)
    Error: Package: gstreamer-ffmpeg-0.10.13-15.el7.nux.x86_64 (nux-dextop)
              Requires: libgstreamer-0.10.so.0()(64bit)
    Error: Package: gstreamer-ffmpeg-0.10.13-15.el7.nux.x86_64 (nux-dextop)
              Requires: libgstbase-0.10.so.0()(64bit)
    Error: Package: gstreamer-ffmpeg-0.10.13-15.el7.nux.x86_64 (nux-dextop)
              Requires: libgstaudio-0.10.so.0()(64bit)
    Error: Package: gstreamer-ffmpeg-0.10.13-15.el7.nux.x86_64 (nux-dextop)
              Requires: libgstpbutils-0.10.so.0()(64bit)
    Error: Package: gstreamer-ffmpeg-0.10.13-15.el7.nux.x86_64 (nux-dextop)
              Requires: libgstvideo-0.10.so.0()(64bit)
    You could try using --skip-broken to work around the problem
    You could try running: rpm -Va --nofiles --nodigest
    [ec2-user@ip-172-30-1-58 ~]$

    Supplying the suggested --skip-broken doesn’t help :

    [ec2-user@ip-172-30-1-58 ~]$ sudo yum install -y gstreamer-ffmpeg --skip-broken
    Loaded plugins: priorities, update-motd, upgrade-helper
    23 packages excluded due to repository priority protections
    Resolving Dependencies
    --> Running transaction check
    ---> Package gstreamer-ffmpeg.x86_64 0:0.10.13-15.el7.nux will be installed
    --> Processing Dependency: liborc-0.4.so.0()(64bit) for package: gstreamer-ffmpeg-0.10.13-15.el7.nux.x86_64
    --> Processing Dependency: libgstvideo-0.10.so.0()(64bit) for package: gstreamer-ffmpeg-0.10.13-15.el7.nux.x86_64
    --> Processing Dependency: libgstreamer-0.10.so.0()(64bit) for package: gstreamer-ffmpeg-0.10.13-15.el7.nux.x86_64
    --> Processing Dependency: libgstpbutils-0.10.so.0()(64bit) for package: gstreamer-ffmpeg-0.10.13-15.el7.nux.x86_64
    --> Processing Dependency: libgstbase-0.10.so.0()(64bit) for package: gstreamer-ffmpeg-0.10.13-15.el7.nux.x86_64
    --> Processing Dependency: libgstaudio-0.10.so.0()(64bit) for package: gstreamer-ffmpeg-0.10.13-15.el7.nux.x86_64

    Packages skipped because of dependency problems:
       gstreamer-ffmpeg-0.10.13-15.el7.nux.x86_64 from nux-dextop
    [ec2-user@ip-172-30-1-58 ~]$

    So how do I install gstreamer-ffmpeg ? Why aren’t the dependencies automatically being followed ?

  • Converting MP3/MP4 to WAV in the Frontend Using ffmpegwasm with Next.js Results in Module Not Found Error

    31 mars 2024, par ryuma

    I'm attempting to use ffmpegwasm in a Next.js project to convert MP3 or MP4 files to WAV format directly in the frontend. However, I encounter a "Module not found" error during the process. I have made sure to use the latest version of Next.js. Below is the error message and the code snippet where the issue occurs. I'm seeking assistance to resolve this problem, as it has become quite troubling.

    &#xA;

    error

    &#xA;

    ./node_modules/@ffmpeg/ffmpeg/dist/esm/classes.js:104:27 Module not found&#xA;  102 |         if (!this.#worker) {&#xA;  103 |             this.#worker = classWorkerURL ?&#xA;> 104 |                 new Worker(new URL(classWorkerURL, import.meta.url), {&#xA;      |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  105 |                     type: "module",&#xA;  106 |                 }) :&#xA;  107 |                 // We need to duplicated the code here to enable webpack&#xA;

    &#xA;

    "use client"&#xA;&#xA;import { FFmpeg } from "@ffmpeg/ffmpeg"&#xA;import { fetchFile, toBlobURL } from "@ffmpeg/util"&#xA;import React, { useEffect, useRef, useState } from "react"&#xA;&#xA;export default function TestPage() {&#xA;  const [loaded, setLoaded] = useState(false)&#xA;  const ffmpegRef = useRef(new FFmpeg())&#xA;  const messageRef = useRef(null)&#xA;&#xA;  useEffect(() => {&#xA;    load()&#xA;  }, [])&#xA;&#xA;  const load = async () => {&#xA;    const baseURL = "https://unpkg.com/@ffmpeg/core@0.12.6/dist/umd"&#xA;    const ffmpeg = ffmpegRef.current&#xA;    ffmpeg.on("log", ({ message }) => {&#xA;      if (messageRef.current) messageRef.current.innerHTML = message&#xA;      console.log(message)&#xA;    })&#xA;&#xA;    await ffmpeg.load({&#xA;      coreURL: await toBlobURL(`${baseURL}/ffmpeg-core.js`, "text/javascript"),&#xA;      wasmURL: await toBlobURL(`${baseURL}/ffmpeg-core.wasm`, "application/wasm"),&#xA;    })&#xA;    setLoaded(true)&#xA;  }&#xA;&#xA;  const convertToWav = async ({ target: { files } }) => {&#xA;    const ffmpeg = ffmpegRef.current&#xA;    const file = files[0]&#xA;&#xA;    await ffmpeg.writeFile("input.mp4", await fetchFile(file))&#xA;    await ffmpeg.exec(["-i", "input.mp4", "output.wav"])&#xA;    const data = await ffmpeg.readFile("output.wav")&#xA;&#xA;    const url = URL.createObjectURL(new Blob([data.buffer], { type: "audio/wav" }))&#xA;    const link = document.createElement("a")&#xA;    link.href = url&#xA;    link.setAttribute("download", "output.wav")&#xA;    document.body.appendChild(link)&#xA;    link.click()&#xA;  }&#xA;&#xA;  return (&#xA;    <div>&#xA;      {loaded ? (&#xA;        &lt;>&#xA;          <input type="file" accept="audio/mp3,video/mp4" />&#xA;          <p ref="{messageRef}"></p>&#xA;        >&#xA;      ) : (&#xA;        <button>Load ffmpeg-core</button>&#xA;      )}&#xA;    </div>&#xA;  )&#xA;}&#xA;&#xA;

    &#xA;

    Attempted Solutions :

    &#xA;

    I've ensured that I'm using the latest version of Next.js.&#xA;I've tried various configurations for the ffmpeg instance.

    &#xA;

    Questions :

    &#xA;

    How can I resolve the "Module not found" error when using ffmpegwasm with Next.js ?&#xA;Are there any specific configurations or setups within Next.js that I need to be aware of to successfully use ffmpegwasm ?&#xA;Any guidance or assistance with this issue would be greatly appreciated. Thank you in advance for your help.

    &#xA;