
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (45)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Supporting all media types
13 avril 2011, parUnlike 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 (...)
-
HTML5 audio and video support
13 avril 2011, parMediaSPIP 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 (6811)
-
avutil/tile : check clock_gettime at runtime for apple platforms
9 janvier 2017, par Wang Binavutil/tile : check clock_gettime at runtime for apple platforms
clock_gettime is avalible since macOS 10.12 and iOS 10.0. Because of
weak linking, clock_gettime can be build without error with new
macOS/iOS sdk, but the symbol may not exist on the target system.
Explicitly checking the symbol is required.
https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.htmlSigned-off-by : Wang Bin <wbsecg1@gmail.com>
Signed-off-by : Steven Liu <lq@chinaffmpeg.org> -
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.