Recherche avancée

Médias (91)

Autres articles (56)

  • 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 (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (6999)

  • Evolution #2456 : Déclarer un article syndiqué sans syndiquer le site

    28 janvier 2014, par Fil Up

    Je ferme mais ma suggestion : adapter un script comme le "bouton memo" de manière à ce qu’il crée un article (faussement) syndiqué au lieu d’un article ; ensuite avec les crayons, il serait éditable depuis le site public.

  • Are there any alternatives to SharedArrayBuffer, or methods for video editing in a web browser ?

    26 juillet 2023, par Govinda Regmi

    I'm working on a web-based video editing application using ffmeg that heavily relies on SharedArrayBuffer. Unfortunately, I've encountered a roadblock with the "Cross-Origin-Embedder-Policy : require-corp | credentialless" and "Cross-Origin-Opener-Policy : same-origin" headers. While these headers allow the usage of SharedArrayBuffer, they restrict other essential features, such as rendering images from an s3 bucket and script of TinyMce text editor.

    


    I am trying to achieve
video editor like this

    


    I am using "next" : "12.1.6" and
I tried to implement ffmeg like this :

    


    import { useEffect, useState } from "react";&#xA;&#xA;import { useDebounce } from "use-debounce";&#xA;import { createFFmpeg, fetchFile } from "@ffmpeg/ffmpeg";&#xA;&#xA;import styles from "../videoEditor.module.scss";&#xA;import RangeInput from "../range-input/RangeInput";&#xA;import * as helpers from "../../../../utils/videoHelpers";&#xA;&#xA;const FF = createFFmpeg({&#xA;    log: true,&#xA;    corePath: "https://unpkg.com/@ffmpeg/core@0.10.0/dist/ffmpeg-core.js",&#xA;});&#xA;&#xA;(async function () {&#xA;    await FF.load();&#xA;})();&#xA;&#xA;export const VideoTrimmer = ({&#xA;    videoFile,&#xA;    trimmedVideoFile,&#xA;    isConfirmClicked,&#xA;    setTrimmedVideoFile,&#xA;    onConfirmClickHandler,&#xA;}) => {&#xA;    const [URL, setURL] = useState([]);&#xA;    const [thumbNails, setThumbNails] = useState([]);&#xA;    const [videoMeta, setVideoMeta] = useState(null);&#xA;    const [inputVideoFile, setInputVideoFile] = useState(null);&#xA;    const [thumbnailIsProcessing, setThumbnailIsProcessing] = useState(false);&#xA;&#xA;    const [rStart, setRstart] = useState(0);&#xA;    const [debouncedRstart] = useDebounce(rStart, 500);&#xA;&#xA;    const [rEnd, setRend] = useState(10);&#xA;    const [debouncedRend] = useDebounce(rEnd, 500);&#xA;&#xA;    const handleLoadedData = async (e) => {&#xA;        const el = e.target;&#xA;        const meta = {&#xA;            name: inputVideoFile.name,&#xA;            duration: el.duration,&#xA;            videoWidth: 50,&#xA;            videoHeight: 50,&#xA;        };&#xA;        setVideoMeta(meta);&#xA;        const thumbNails = await getThumbnails(meta);&#xA;        setThumbNails(thumbNails);&#xA;    };&#xA;&#xA;    const getThumbnails = async ({ duration }) => {&#xA;        if (!FF.isLoaded()) await FF.load();&#xA;        setThumbnailIsProcessing(true);&#xA;        let MAX_NUMBER_OF_IMAGES = 15;&#xA;        let NUMBER_OF_IMAGES = duration &lt; MAX_NUMBER_OF_IMAGES ? duration : 15;&#xA;        let offset =&#xA;            duration === MAX_NUMBER_OF_IMAGES ? 1 : duration / NUMBER_OF_IMAGES;&#xA;&#xA;        const arrayOfImageURIs = [];&#xA;        FF.FS("writeFile", inputVideoFile.name, await fetchFile(inputVideoFile));&#xA;&#xA;        for (let i = 0; i &lt; NUMBER_OF_IMAGES; i&#x2B;&#x2B;) {&#xA;            let startTimeInSecs = helpers.toTimeString(Math.round(i * offset));&#xA;&#xA;            try {&#xA;                await FF.run(&#xA;                    "-ss",&#xA;                    startTimeInSecs,&#xA;                    "-i",&#xA;                    inputVideoFile.name,&#xA;                    "-t",&#xA;                    "00:00:1.000",&#xA;                    "-vf",&#xA;                    `scale=150:-1`,&#xA;                    `img${i}.png`,&#xA;                );&#xA;                const data = FF.FS("readFile", `img${i}.png`);&#xA;&#xA;                let blob = new Blob([data.buffer], { type: "image/png" });&#xA;                let dataURI = await helpers.readFileAsBase64(blob);&#xA;                FF.FS("unlink", `img${i}.png`);&#xA;                arrayOfImageURIs.push(dataURI);&#xA;            } catch (error) {&#xA;                // console.log({ message: error });&#xA;            }&#xA;        }&#xA;        setThumbnailIsProcessing(false);&#xA;&#xA;        return arrayOfImageURIs;&#xA;    };&#xA;    const handleTrim = async () => {&#xA;        // setTrimIsProcessing(true);&#xA;        let startTime = ((rStart / 100) * videoMeta.duration).toFixed(2);&#xA;        let offset = ((rEnd / 100) * videoMeta.duration - startTime).toFixed(2);&#xA;        try {&#xA;            FF.FS("writeFile", inputVideoFile.name, await fetchFile(inputVideoFile));&#xA;            await FF.run(&#xA;                "-ss",&#xA;                helpers.toTimeString(startTime),&#xA;                "-i",&#xA;                inputVideoFile.name,&#xA;                "-t",&#xA;                helpers.toTimeString(offset),&#xA;                "-c",&#xA;                "copy",&#xA;                "ping.mp4",&#xA;            );&#xA;            const data = FF.FS("readFile", "ping.mp4");&#xA;            const dataURL = await helpers.readFileAsBase64(&#xA;                new Blob([data.buffer], { type: "video/mp4" }),&#xA;            );&#xA;&#xA;            setTrimmedVideoFile(dataURL);&#xA;        } catch (error) {&#xA;            // console.log(error);&#xA;        } finally {&#xA;            // setTrimIsProcessing(false);&#xA;        }&#xA;    };&#xA;&#xA;    const handleRangeChange = (type, event) => {&#xA;        const limit = parseInt((120 / videoMeta.duration) * 100);&#xA;        if (type === "start") {&#xA;            if (rEnd - rStart > limit) {&#xA;                setRend(parseInt(event.target.value) &#x2B; limit);&#xA;                setRstart(parseInt(event.target.value));&#xA;            } else {&#xA;                setRstart(parseInt(event.target.value));&#xA;            }&#xA;        } else if (type === "end") {&#xA;            if (rEnd - rStart > limit) {&#xA;                setRstart(parseInt(event.target.value) - limit);&#xA;                setRend(parseInt(event.target.value));&#xA;            } else {&#xA;                setRend(parseInt(event.target.value));&#xA;            }&#xA;        }&#xA;    };&#xA;&#xA;    useEffect(() => {&#xA;        if (videoMeta?.duration > 120) {&#xA;            const limit = parseInt((120 / videoMeta.duration) * 100);&#xA;            setRend(limit);&#xA;        }&#xA;    }, [videoMeta?.duration]);&#xA;&#xA;    useEffect(() => {&#xA;        const videoFormData = new FormData();&#xA;        if (videoFile) {&#xA;            videoFormData.append("file", videoFile);&#xA;            const handleChange = async () => {&#xA;                setInputVideoFile(videoFile);&#xA;                setURL(await helpers.readFileAsBase64(videoFile));&#xA;            };&#xA;            handleChange();&#xA;        }&#xA;    }, []);&#xA;&#xA;    useEffect(() => {&#xA;        if (videoMeta) {&#xA;            onConfirmClickHandler(handleTrim);&#xA;        }&#xA;    }, [isConfirmClicked]);&#xA;&#xA;    useEffect(() => {&#xA;        if (debouncedRend == rEnd &amp;&amp; debouncedRstart == rStart &amp;&amp; videoMeta) {&#xA;            handleTrim();&#xA;        }&#xA;    }, [debouncedRend, debouncedRstart, videoMeta]);&#xA;&#xA;    return (&#xA;        &lt;>&#xA;            <article classname="grid_txt_2">&#xA;                &#xA;                    {trimmedVideoFile ? (&#xA;                        &#xA;                    ) : (&#xA;                        &#xA;                    )}&#xA;                &#xA;            </article>&#xA;            &#xA;        >&#xA;    );&#xA;};&#xA;

    &#xA;

    next.config.js

    &#xA;

    const nextConfig = {&#xA;    async headers() {&#xA;        return [&#xA;            {&#xA;                source: "/(.*)",&#xA;                headers: [&#xA;                    { key: "Cross-Origin-Opener-Policy", value: "same-origin" },&#xA;                    { key: "Cross-Origin-Embedder-Policy", value: "credentialless" },&#xA;                ],&#xA;            },&#xA;        ];&#xA;    },&#xA;    &#xA;};&#xA;

    &#xA;

    This works seamlessly in Chrome and Edge, but it encounter issues (SharedArrayBuffer is not defined) in Firefox and Safari. How can we ensure it functions impeccably across all major browsers ?

    &#xA;

    When utilizing key : "Cross-Origin-Embedder-Policy", value : "require-corp" , I encounter an error while fetching images/scripts from cross-origin sources, resulting in "net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 200 (OK)". Cany you suggest me how can I resolve this issue ?

    &#xA;

  • FFmpeg returns negative PTS and DTS for first non key frame

    18 février 2020, par Olga Pshenichnikova

    We have some envelope of FFmpeg, that processes the video.
    The tree first frames of video are : B -> B -> I as shown below :

    enter image description here

    PTS and DTS returns negative for first frame :

    enter image description here

    We have some code, that skips the frames that are below some timepoint (0 for first frame).
    Is it possible to ask FFmpeg to start from first frame and not from first I frame ?