
Recherche avancée
Autres articles (106)
-
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
MediaSPIP Core : La Configuration
9 novembre 2010, parMediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...) -
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, 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 (...)
Sur d’autres sites (15661)
-
Revision 3274 : pas nécessite mais utilise
18 avril 2010, par kent1 — Logpas nécessite mais utilise
-
Error with FFmpeg and FS in React : "ErrnoError : FS error"
23 juillet 2024, par namwanI'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";
import { FFmpeg } from "@ffmpeg/ffmpeg";

const ffmpeg = new FFmpeg();

const fetchFile = async (filePath) => {
 const file = await ffmpeg.readFile(filePath);
 alert("hello");
 return new Uint8Array(file).buffer;
};


const Main = () => {
 const [file, setFile] = useState(null);
 const [compressedFile, setCompressedFile] = useState("");

 const loadFFmpeg = async () => {
 if (!ffmpeg.isLoaded) {
 await ffmpeg.load();
 }
 }; 

 const getFile = (event) => {
 const selectedFile = event.target.files[0];
 
 if (selectedFile) {
 setFile(selectedFile);
 }
 };

 const compressImage = (selectedFile) => {
 const img = new Image();
 img.src = URL.createObjectURL(selectedFile);
 img.onload = () => {
 const canvas = document.createElement('canvas');
 const MAX_WIDTH = 300;
 const MAX_HEIGHT = 300;
 let width = img.width;
 let height = img.height;

 if (width > height) {
 if (width > MAX_WIDTH) {
 height *= MAX_WIDTH / width;
 width = MAX_WIDTH;
 }
 } else {
 if (height > MAX_HEIGHT) {
 width *= MAX_HEIGHT / height;
 height = MAX_HEIGHT;
 }
 }

 canvas.width = width;
 canvas.height = height;
 const ctx = canvas.getContext('2d');
 ctx.drawImage(img, 0, 0, width, height);
 const dataUrl = canvas.toDataURL('image/jpeg', 1.0);
 setCompressedFile(dataUrl);
 };
 };

 const compressVideo = async (selectedFile) => {
 try {
 await loadFFmpeg();
 
 const arrayBuffer = await selectedFile.arrayBuffer();
 const fileName = selectedFile.name;
 
 await ffmpeg.writeFile(fileName, new Uint8Array(arrayBuffer));
 
 await ffmpeg.exec(
 '-i',
 fileName,
 '-vf',
 'scale=640:-1',
 '-c:a',
 'aac',
 '-strict',
 '-2',
 'output.mp4'
 );
 
 const data = await fetchFile('output.mp4');
 const compressedVideoBlob = new Blob([data], { type: 'video/mp4' });
 const compressedVideoUrl = URL.createObjectURL(compressedVideoBlob);
 setCompressedFile(compressedVideoUrl);
 
 await ffmpeg.unlink(fileName);
 await ffmpeg.unlink('output.mp4');
 
 alert('Compression successful');
 } catch (error) {
 console.error('Error:', error);
 alert('Compression failed. Please check the console for more details.');
 }
 };
 

 const handleSubmit = async (e) => {
 e.preventDefault();

 if (file) {
 const fileType = file.name.split('.').pop().toLowerCase();

 if (fileType === 'png' || fileType === 'jpg' || fileType === 'jpeg') {
 compressImage(file);
 } else if (fileType === 'mp4' || fileType === 'h264') {
 compressVideo(file);
 } else {
 alert('Please select a valid file type (png, jpg, jpeg for images or mp4, h264 for videos).');
 }
 }
 };

 const handleDownload = () => {
 if (file) {
 const downloadLink = document.createElement('a');
 downloadLink.href = compressedFile;

 const fileExtension = file.name.split('.').pop().toLowerCase();

 downloadLink.download = `compressed_file.${fileExtension}`;
 
 document.body.appendChild(downloadLink);
 downloadLink.click();
 document.body.removeChild(downloadLink);
 }
 };

 return (
 <>
 <h1>Main Page</h1>
 <form>
 <label>Upload</label>
 <input type="'file'" />
 <br /><br />
 <input type="submit" value="Compress" />
 </form>
 {compressedFile && (
 <>
 <h2>Compressed File Preview</h2>
 {file && file.name && ( 
 file.name.split('.').pop().toLowerCase() === 'mp4' || file.name.split('.').pop().toLowerCase() === 'h264' ? (
 <video width="300" controls="controls">
 <source src="{compressedFile}" type="video/mp4"></source>
 Your browser does not support the video tag.
 </video>
 ) : (
 <img src="http://stackoverflow.com/feeds/tag/{compressedFile}" alt="Compressed file preview" style='max-width: 300px; max-height: 300px' />
 )
 )}
 <br /><br />
 <button>Download Compressed File</button>
 >
 )}
 >
 );
};

export default Main;



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.


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


-
What does "dash" - mean as ffmpeg output filename
26 août 2020, par DDSI'm trying to use ffmpeg with gnuplot to draw some audio spectra, I'm following this ffmpeg doc link.


Now I'm asking what "dash"
-
means on this line right after-f data
, it should be a filename : the last element of ffmpeg command should the output file but I have no files named-
in the directory after running the command.

ffmpeg -y -i in.wav -ac 1 -filter:a aresample=8000 -map 0:a -c:a pcm_s16le -f data - | gnuplot -p -e "plot 'code>


I looked on ffmpeg docs but I didn't find anything.