
Recherche avancée
Autres articles (46)
-
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 -
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...) -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)
Sur d’autres sites (9357)
-
Use ffmpeg to show a webcam live stream in a browser
20 juillet 2020, par ToastI have a webcam that is connected to a server and I'd like to view a live stream of it in a web browser.


I'd like to include a
video
tag like this :

<video></video>



What is an
ffmpeg
command that will send a video stream to browser clients ?
I managed to record a video to disk with this command :

ffmpeg -f v4l2 -i /dev/video0 output.mkv



I'm not sure if
rtsp
andffmpeg
are a good choice and I'm open for alternative suggestions.
I'm looking for a solution that is simple to setup and demo. Scalability and support for older browsers don't matter and audio isn't needed. I'd prefer a solution that sends compressed video instead of individual images (MJPG).

-
I have use the ffmpeg in my react konva project but it not import correclty ?
5 septembre 2024, par Humayoun SaeedI use ffmpeg in my react konva project to record video and download it, but when i import it give me error, when i give to to gpt or google it giveme another way of export when i do this one it same give me error of import from ffpmg


Error :


ERROR in ./src/components/Preview.jsx 29:25-37
export 'createFFmpeg' (imported as 'createFFmpeg') was not found in '@ffmpeg/ffmpeg' (possible exports : FFmpeg)
ERROR in ./src/components/Preview.jsx 123:34-43
export 'fetchFile' (imported as 'fetchFile') was not found in '@ffmpeg/ffmpeg' (possible exports : FFmpeg)


Preview.jsx :


import React, { useEffect, useState, useRef } from "react";
// import { createFFmpeg } from "@ffmpeg/ffmpeg";
// import { createFFmpeg, fetchFile } from "@ffmpeg/ffmpeg/dist/ffmpeg.min.js";
// import { FFmpeg } from "@ffmpeg/ffmpeg";
// import { fetchFile } from "@ffmpeg/util";
import { createFFmpeg, fetchFile } from "@ffmpeg/ffmpeg";



const Preview = ({ layout, onClose }) => {
 const [currentContent, setCurrentContent] = useState([]);
 const [progress, setProgress] = useState(0);
 const totalDuration = useRef(0);
 const elapsedDuration = useRef(0); // Track total elapsed duration
 const progressInterval = useRef(null);
 const ffmpeg = useRef(null); // Use useRef to store ffmpeg instance
 const [ffmpegReady, setFfmpegReady] = useState(false);

 // Initialize FFmpeg instance
 useEffect(() => {
 const loadFFmpeg = async () => {
 if (!ffmpeg.current) {
 ffmpeg.current = createFFmpeg({ log: true });
 await ffmpeg.current.load();
 setFfmpegReady(true);
 }
 };
 loadFFmpeg();
 }, []);




const handleDownload = async () => {
 try {
 if (!ffmpegReady) {
 alert("FFmpeg is still loading, please wait...");
 return;
 }

 // Fetch all media files from the layout
 const inputFiles = [];

 // Process each division of the layout
 for (const division of layout.divisions) {
 for (let i = 0; i < division.imageSrcs.length; i++) {
 const src = division.imageSrcs[i];

 // Fetch and store media data
 const mediaData = await fetchFile(src);
 const fileName = `input${inputFiles.length + 1}${
 src.endsWith(".mp4") ? ".mp4" : ".png"
 }`;

 // Write file to ffmpeg virtual filesystem
 ffmpeg.current.FS("writeFile", fileName, mediaData);
 inputFiles.push(fileName);
 }
 }

 // Create a list of inputs for ffmpeg
 let concatList = "";
 inputFiles.forEach((fileName) => {
 concatList += `file '${fileName}'\n`;
 });

 // Write the concat list file to FFmpeg FS
 ffmpeg.current.FS(
 "writeFile",
 "concatList.txt",
 new TextEncoder().encode(concatList)
 );

 // Run the ffmpeg command to concatenate all files into one video
 await ffmpeg.current.run(
 "-f",
 "concat",
 "-safe",
 "0",
 "-i",
 "concatList.txt",
 "-c",
 "copy",
 "output.mp4"
 );

 // Read the result video
 const data = ffmpeg.current.FS("readFile", "output.mp4");

 // Create a Blob from the data and download it
 const videoBlob = new Blob([data.buffer], { type: "video/mp4" });
 const url = URL.createObjectURL(videoBlob);
 const link = document.createElement("a");
 link.href = url;
 link.download = `${layout.name || "layout_video"}.mp4`;
 document.body.appendChild(link);
 link.click();
 document.body.removeChild(link);

 alert("Video download completed.");
 } catch (error) {
 console.error("Error during video creation:", error);
 }
 };


 



return (
 
 
 
 Close
 
 
 {/* Download button */}
 > (e.target.style.backgroundColor = "#218838")}
 onMouseOut={(e) => (e.target.style.backgroundColor = "#28a745")}
 >
 Download Video
 
 
 
 );
};

export default Preview;




Ignore all other main issue in just ffmpeg , import, declaration and in it usage in download function, if anyone solution or ability to resolve it, then check it.


I try to use ffmpeg in my project for video downloading but it not importing and not use , i want to download video i made using ffmpeg.


-
Need to reduce video size for my symfony project since it's taking too much time to upload 300MB+ videos
18 juin 2020, par manuI have tried
FFmpeg
its showing error"Your FFProbe version is too old and does not support -help option, please upgrade"
. I have tried few fixes already available in stackoverflow and other sites but it won't work for me. If u know any alternative packages please share. The symfony version am using is 4.4. Now am planning to usesymfony/process
. This is an API where users can upload their recorded video from mobile app. please share better option