
Recherche avancée
Autres articles (83)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
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 (...) -
(Dés)Activation de fonctionnalités (plugins)
18 février 2011, parPour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)
Sur d’autres sites (11930)
-
Is there risk of shell/command injection when using FFmpeg or when there's no user input ?
10 mai 2021, par TrisI am new when it comes to thinking about the security of my web applications. I have done research on shell injections and most of the time they say to just avoid using shell/command calls in the web applications. However, my alternative seems to limit which browsers clients can use. So I would prefer executing a shell command in my nodejs server. I am using FFmpeg and calling it through system command in nodejs child processes.


I have a FFmpeg bash script like so :


VIDSOURCE="rtsp:cameraurl"
AUDIO_OPTS="-c:a aac -b:a 160000 -ac 2"
VIDEO_OPTS="-s 854x480 -c:v libx264 -b:v 800000"
OUTPUT_HLS="-hls_time 10 -hls_list_size 10 -start_number 1 -hls_wrap 10"
ffmpeg -i "$VIDSOURCE" -y $AUDIO_OPTS $VIDEO_OPTS $OUTPUT_HLS mystream.m3u8



I am wondering if I should worry about shell injection risk and if I should try another approach. I don't think there is any user input in this besides my own hard coded inputs. Therefore, I think it should be safe to use this script in a web browser... I just want to be safe and be sure. Thank you !


-
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.


-
Write and read from memory using : avio_alloc_context
26 juillet 2020, par Pol.HMy overall goal is to capture the desktop screen and encapsulate in a webm container with encoding such as VP8 or VP9. I can save it as a file, but my intention is to stream the video to a webbrowser and using mediasource extension to view the content.


Now am stuck att writing/reading the data of memory using avio_alloc_context .


avio_alloc_context(ioBuffer, IOBUFSIZE, 1, nullptr, readFromBuffer, writeToBuffer, nullptr) ;


Does anyone have code snippets for both read and write functions ?


From this question i found the write function :


std::vector outputData;

int mediaMuxCallback(void *opaque, uint8_t *buf, int bufSize)
{
 outputData.insert(outputData.end(), buf, buf + bufSize);
 return bufSize;
}



- 

- How should the read function be implemented any idea ?
- Is a vector the best alternative or how about an IStream which one is easier ?