Recherche avancée

Médias (91)

Autres articles (50)

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

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

Sur d’autres sites (9463)

  • Converting and cropping video in the same time by ffpmeg with qsv [closed]

    7 août 2024, par pgru

    I have .h264 video file and want to crop it to size 200x200 and save as .mp4. I have a lot of videos to crop so I would like to use my integrated graphic card for this task.

    


    I tried with this ffpmag command :

    


    ffmpeg -hwaccel qsv -c:v h264_qsv -i input.h264 -vf "crop=200:200" -c:v h264_qsv -b:v 5M output.mp4

    


    and the file is converted, but not cropped. I tried also without qsv :

    


    ffmpeg -i input.h264 -vf "crop=200:200" -b:v 5M output.mp4

    


    and it works, but obviously slower. How can I make it work with graphic card ? I work on Windows.

    


  • Last subprocess call not working in concatenation code with FFMPEG. How should I go about fixing this ?

    28 novembre 2019, par S1mple
    clips = []

    #generates a list of mp4 files in a folder
    def clipFinder(CurrentDir, fileType):
       clips.clear()
       for r,d,f in os.walk(CurrentDir):
           for file in f:
               if fileType in file:
                   clips.append(r+file)
       random.shuffle(clips)

    #removes all files that have the string 'vod' in them as they cause problems during concatenation
    def removeVods(r):
       for f in clips:
           if 'vod' in clips:
               os.remove(r+f)

    #generates a string using the clips list to insert into the ffmpeg command
    def clipString():
       string = 'intermediate'
       clipList = []
       clipNum = 1
       for f in clips:
           clipList.append(string+str(clipNum)+'.ts'+'|')
           clipNum+=1
       string1 = ''.join(clipList)
       string2 = string1[0:len(string1)-1]
       return string2

    #concatenates the mp4 files in the clipString
    def concatFiles():
       clipFinder('***', '.mp4')
       removeVods('***')
       i = 0
       intermediates = []
       for f in clips:
           subprocess.call(['***', '-i', clips[i], '-c', 'copy', '-bsf:v', 'h264_mp4toannexb', '-f', 'mpegts', 'intermediate'+ str(i+1) +'.ts'])
           i += 1
       clipsLength = len(clips)
       subprocess.call['***', '-i', '"concat:' + clipString() + '"', '-c', 'copy', '-bsf:a
       aac_adtstoasc', 'output.mp4']

    I am trying to make a clip concatenator, but the last subprocess call won’t run and gives me no error. When I run the script the first FFmpeg call works fine and gives me my intermediate mp4 files, however, the second command, which works when I run it in terminal, does not work when I run it from python using subprocess.call.

    Problematic code :

    subprocess.call(['***', '-i', '"concat:' + clipString() + '"', '-c', 'copy', '-bsf:a aac_adtstoasc', 'output.mp4'])

    all places with * were paths such as : /davidscomputer/bin/ffmpeg/

  • Error with FFmpeg and FS in React : "ErrnoError : FS error"

    23 juillet 2024, par namwan

    I'm working on a React application where I'm using the @ffmpeg/ffmpeg library to compress images and videos. I'm facing an issue with the virtual file system (FS) when trying to read and write files using FFmpeg. I'm getting the following error :

    


    ErrnoError: FS error


    


    Here's the relevant part of my code :

    


    import React, { useState } from "react";&#xA;import { FFmpeg } from "@ffmpeg/ffmpeg";&#xA;&#xA;const ffmpeg = new FFmpeg();&#xA;&#xA;const fetchFile = async (filePath) => {&#xA;    const file = await ffmpeg.readFile(filePath);&#xA;    alert("hello");&#xA;    return new Uint8Array(file).buffer;&#xA;};&#xA;&#xA;&#xA;const Main = () => {&#xA;    const [file, setFile] = useState(null);&#xA;    const [compressedFile, setCompressedFile] = useState("");&#xA;&#xA;    const loadFFmpeg = async () => {&#xA;        if (!ffmpeg.isLoaded) {&#xA;          await ffmpeg.load();&#xA;        }&#xA;      };      &#xA;&#xA;    const getFile = (event) => {&#xA;        const selectedFile = event.target.files[0];&#xA;        &#xA;        if (selectedFile) {&#xA;            setFile(selectedFile);&#xA;        }&#xA;    };&#xA;&#xA;    const compressImage = (selectedFile) => {&#xA;        const img = new Image();&#xA;        img.src = URL.createObjectURL(selectedFile);&#xA;        img.onload = () => {&#xA;            const canvas = document.createElement(&#x27;canvas&#x27;);&#xA;            const MAX_WIDTH = 300;&#xA;            const MAX_HEIGHT = 300;&#xA;            let width = img.width;&#xA;            let height = img.height;&#xA;&#xA;            if (width > height) {&#xA;                if (width > MAX_WIDTH) {&#xA;                    height *= MAX_WIDTH / width;&#xA;                    width = MAX_WIDTH;&#xA;                }&#xA;            } else {&#xA;                if (height > MAX_HEIGHT) {&#xA;                    width *= MAX_HEIGHT / height;&#xA;                    height = MAX_HEIGHT;&#xA;                }&#xA;            }&#xA;&#xA;            canvas.width = width;&#xA;            canvas.height = height;&#xA;            const ctx = canvas.getContext(&#x27;2d&#x27;);&#xA;            ctx.drawImage(img, 0, 0, width, height);&#xA;            const dataUrl = canvas.toDataURL(&#x27;image/jpeg&#x27;, 1.0);&#xA;            setCompressedFile(dataUrl);&#xA;        };&#xA;    };&#xA;&#xA;    const compressVideo = async (selectedFile) => {&#xA;        try {&#xA;            await loadFFmpeg();&#xA;    &#xA;            const arrayBuffer = await selectedFile.arrayBuffer();&#xA;            const fileName = selectedFile.name;&#xA;    &#xA;            await ffmpeg.writeFile(fileName, new Uint8Array(arrayBuffer));&#xA;    &#xA;            await ffmpeg.exec(&#xA;                &#x27;-i&#x27;,&#xA;                fileName,&#xA;                &#x27;-vf&#x27;,&#xA;                &#x27;scale=640:-1&#x27;,&#xA;                &#x27;-c:a&#x27;,&#xA;                &#x27;aac&#x27;,&#xA;                &#x27;-strict&#x27;,&#xA;                &#x27;-2&#x27;,&#xA;                &#x27;output.mp4&#x27;&#xA;            );&#xA;    &#xA;            const data = await fetchFile(&#x27;output.mp4&#x27;);&#xA;            const compressedVideoBlob = new Blob([data], { type: &#x27;video/mp4&#x27; });&#xA;            const compressedVideoUrl = URL.createObjectURL(compressedVideoBlob);&#xA;            setCompressedFile(compressedVideoUrl);&#xA;    &#xA;            await ffmpeg.unlink(fileName);&#xA;            await ffmpeg.unlink(&#x27;output.mp4&#x27;);&#xA;    &#xA;            alert(&#x27;Compression successful&#x27;);&#xA;        } catch (error) {&#xA;            console.error(&#x27;Error:&#x27;, error);&#xA;            alert(&#x27;Compression failed. Please check the console for more details.&#x27;);&#xA;        }&#xA;    };&#xA;        &#xA;&#xA;    const handleSubmit = async (e) => {&#xA;        e.preventDefault();&#xA;&#xA;        if (file) {&#xA;            const fileType = file.name.split(&#x27;.&#x27;).pop().toLowerCase();&#xA;&#xA;            if (fileType === &#x27;png&#x27; || fileType === &#x27;jpg&#x27; || fileType === &#x27;jpeg&#x27;) {&#xA;                compressImage(file);&#xA;            } else if (fileType === &#x27;mp4&#x27; || fileType === &#x27;h264&#x27;) {&#xA;                compressVideo(file);&#xA;            } else {&#xA;                alert(&#x27;Please select a valid file type (png, jpg, jpeg for images or mp4, h264 for videos).&#x27;);&#xA;            }&#xA;        }&#xA;    };&#xA;&#xA;    const handleDownload = () => {&#xA;        if (file) {&#xA;            const downloadLink = document.createElement(&#x27;a&#x27;);&#xA;            downloadLink.href = compressedFile;&#xA;&#xA;            const fileExtension = file.name.split(&#x27;.&#x27;).pop().toLowerCase();&#xA;&#xA;            downloadLink.download = `compressed_file.${fileExtension}`;&#xA;    &#xA;            document.body.appendChild(downloadLink);&#xA;            downloadLink.click();&#xA;            document.body.removeChild(downloadLink);&#xA;        }&#xA;    };&#xA;&#xA;    return (&#xA;        &lt;>&#xA;            <h1>Main Page</h1>&#xA;            <form>&#xA;                <label>Upload</label>&#xA;                <input type="&#x27;file&#x27;" />&#xA;                <br /><br />&#xA;                <input type="submit" value="Compress" />&#xA;            </form>&#xA;            {compressedFile &amp;&amp; (&#xA;                &lt;>&#xA;                    <h2>Compressed File Preview</h2>&#xA;                    {file &amp;&amp; file.name &amp;&amp; ( &#xA;                        file.name.split(&#x27;.&#x27;).pop().toLowerCase() === &#x27;mp4&#x27; || file.name.split(&#x27;.&#x27;).pop().toLowerCase() === &#x27;h264&#x27; ? (&#xA;                            <video width="300" controls="controls">&#xA;                                <source src="{compressedFile}" type="video/mp4"></source>&#xA;                                Your browser does not support the video tag.&#xA;                            </video>&#xA;                        ) : (&#xA;                            <img src="http://stackoverflow.com/feeds/tag/{compressedFile}" alt="Compressed file preview" style='max-width: 300px; max-height: 300px' />&#xA;                        )&#xA;                    )}&#xA;                    <br /><br />&#xA;                    <button>Download Compressed File</button>&#xA;                >&#xA;            )}&#xA;        >&#xA;    );&#xA;};&#xA;&#xA;export default Main;&#xA;

    &#xA;

    I'm using ffmpeg.readFile and ffmpeg.writeFile to read and write files to FFmpeg's virtual file system. I've also tried using ffmpeg.read and ffmpeg.write but still encounter the same issue.

    &#xA;

    Could someone please help me understand what might be causing this FS error and how to resolve it ?

    &#xA;