
Recherche avancée
Médias (1)
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (25)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
Qu’est ce qu’un éditorial
21 juin 2013, parEcrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
Vous pouvez personnaliser le formulaire de création d’un éditorial.
Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...)
Sur d’autres sites (5228)
-
webrtc to rtmp send video from camera to rtmp link
14 avril 2024, par Leo-Mahendrai cant send the video from webrtc which is converted to bufferd data for every 10seconds and send to server.js where it takes it via websockets and convert it to flv format using ffmpeg.


i am trying to send it to rtmp server named restreamer for start, here i tried to convert the buffer data and send it to rtmp link using ffmpeg commands, where i initially started to suceesfully save the file from webrtc to mp4 format for a duration of 2-3 minute.


after i tried to use webrtc to send video data for every 10 seconds and in server i tried to send it to rtmp but i cant send it, but i can see the connection of rtmp url and server is been taken place but i cant see the video i can see the logs in rtmp server as


2024-04-14 12:35:45 ts=2024-04-14T07:05:45Z level=INFO component="RTMP" msg="no streams available" action="INVALID" address=":1935" client="172.17.0.1:37700" path="/3d30c5a9-2059-4843-8957-da963c7bc19b.stream" who="PUBLISH"
2024-04-14 12:35:45 ts=2024-04-14T07:05:45Z level=INFO component="RTMP" msg="no streams available" action="INVALID" address=":1935" client="172.17.0.1:37716" path="/3d30c5a9-2059-4843-8957-da963c7bc19b.stream" who="PUBLISH"
2024-04-14 12:35:45 ts=2024-04-14T07:05:45Z level=INFO component="RTMP" msg="no streams available" action="INVALID" address=":1935" client="172.17.0.1:37728" path="/3d30c5a9-2059-4843-8957-da963c7bc19b.stream" who="PUBLISH" 



my frontend code


const handleSendVideo = async () => {
 console.log("start");
 
 if (!ws) {
 console.error('WebSocket connection not established.');
 return;
 }
 
 try {
 const videoStream = await navigator.mediaDevices.getUserMedia({ video: true });
 const mediaRecorder = new MediaRecorder(videoStream);
 
 const requiredFrameSize = 460800;
 const frameDuration = 10 * 1000; // 10 seconds in milliseconds
 
 mediaRecorder.ondataavailable = async (event) => {
 if (ws.readyState !== WebSocket.OPEN) {
 console.error('WebSocket connection is not open.');
 return;
 }
 
 if (event.data.size > 0) {
 const arrayBuffer = await event.data.arrayBuffer();
 const uint8Array = new Uint8Array(arrayBuffer);
 
 const width = videoStream.getVideoTracks()[0].getSettings().width;
 const height = videoStream.getVideoTracks()[0].getSettings().height;
 
 const numFrames = Math.ceil(uint8Array.length / requiredFrameSize);
 
 for (let i = 0; i < numFrames; i++) {
 const start = i * requiredFrameSize;
 const end = Math.min((i + 1) * requiredFrameSize, uint8Array.length);
 let frameData = uint8Array.subarray(start, end);
 
 // Pad or trim the frameData to match the required size
 if (frameData.length < requiredFrameSize) {
 // Pad with zeros to reach the required size
 const paddedData = new Uint8Array(requiredFrameSize);
 paddedData.set(frameData, 0);
 frameData = paddedData;
 } else if (frameData.length > requiredFrameSize) {
 // Trim to match the required size
 frameData = frameData.subarray(0, requiredFrameSize);
 }
 
 const dataToSend = {
 buffer: Array.from(frameData), // Convert Uint8Array to array of numbers
 width: width,
 height: height,
 pixelFormat: 'yuv420p',
 mode: 'SendRtmp'
 };
 
 console.log("Sending frame:", i);
 ws.send(JSON.stringify(dataToSend));
 }
 }
 };
 
 // Start recording and send data every 10 seconds
 mediaRecorder.start(frameDuration);
 
 console.log("MediaRecorder started.");
 } catch (error) {
 console.error('Error accessing media devices or starting recorder:', error);
 }
 };



and my backend


wss.on('connection', (ws) => {
 console.log('WebSocket connection established.');

 ws.on('message', async (data) => {
 try {
 const parsedData = JSON.parse(data);

 if (parsedData.mode === 'SendRtmp' && Array.isArray(parsedData.buffer)) {
 const { buffer, pixelFormat, width, height } = parsedData;
 const bufferArray = Buffer.from(buffer);

 await sendRtmpVideo(bufferArray, pixelFormat, width, height);
 } else {
 console.log('Received unknown or invalid mode or buffer data');
 }
 } catch (error) {
 console.error('Error parsing WebSocket message:', error);
 }
 });

 ws.on('close', () => {
 console.log('WebSocket connection closed.');
 });
 });
 const sendRtmpVideo = async (frameBuffer, pixelFormat, width, height) => {
 console.log("ffmpeg data",frameBuffer)
 try {
 const ratio = `${width}x${height}`;
 const ffmpegCommand = [
 '-re',
 '-f', 'rawvideo',
 '-pix_fmt', pixelFormat,
 '-s', ratio,
 '-i', 'pipe:0',
 '-c:v', 'libx264',
 '-preset', 'fast', // Specify the preset for libx264
 '-b:v', '3000k', // Specify the video bitrate
 '-loglevel', 'debug',
 '-f', 'flv',
 // '-flvflags', 'no_duration_filesize', 
 RTMPLINK
 ];


 const ffmpeg = spawn('ffmpeg', ffmpegCommand);

 ffmpeg.on('exit', (code, signal) => {
 if (code === 0) {
 console.log('FFmpeg process exited successfully.');
 } else {
 console.error(`FFmpeg process exited with code ${code} and signal ${signal}`);
 }
 });

 ffmpeg.on('error', (error) => {
 console.error('FFmpeg spawn error:', error);
 });

 ffmpeg.stderr.on('data', (data) => {
 console.error(`FFmpeg stderr: ${data}`);
 });

 ffmpeg.stdin.write(frameBuffer, (err) => {
 if (err) {
 console.error('Error writing to FFmpeg stdin:', err);
 } else {
 console.log('Data written to FFmpeg stdin successfully.');
 }
 ffmpeg.stdin.end(); // Close stdin after writing the buffer
 });
 } catch (error) {
 console.error('Error in sendRtmpVideo:', error);
 }
 };




-
Flutter error in Ffmpeg, "Unhandled Exception : ProcessException : No such file or directory" in macOS desktop version
19 avril 2024, par pratik vekariyaI'm trying video trim video using ffmpeg, for macOS desktop application.


I have downloaded ffmpeg from here for macOS.


Here is my code


String mainPath = 'Users/apple/Workspace/User/2024/Project/videoapp/build/macos/Build/Products/Debug/';
 mainPath = mainPath.substring(0, mainPath.lastIndexOf("/"));
 
 Directory directoryExe3 = Directory("$mainPath");
 var dbPath = path.join(directoryExe3.path,
 "App.framework/Resources/flutter_assets/assets/ffmpeg/ffmpegmacos");
//here in "Products/Debug/" folder desktop app will generate

//directoryExe3 path will be, Users/apple/Workspace/User/2024/Project/videoapp/build/macos/Build/Products/Debug

//and dbPath will be, Users/apple/Workspace/User/2024/Project/videoapp/build/macos/Build/Products/Debug/App.framework/Resources/flutter_assets/assets/ffmpeg/ffmpegmacos

//so when app will run it can access it from this path

//executable code, command for ffmpeg

String transpose_str += "crop=" +
 out_w.toInt().toString() +
 ":" +
 out_h.toInt().toString() +
 ":" +
 x!.toInt().toString() +
 ":" +
 y!.toInt().toString() +
 ",";
 transpose_str += "scale=960:192";

Future<processresult> result_ = Process.run(dbPath, [
 "-ss",
 timestamp,
 "-i",
 inputFilePath,
 "-t",
 endTime,
 "-vf",
 transpose_str,
 "-an",
 "./temp.mp4",
 ]); 
</processresult>


Now when I run this in macOS desktop verison, it gives me error at Process.run that in dbPath, Unhandled Exception : ProcessException : No such file or directory.


Any help would be appreciate !


when i run this as desktop version it should get file from assets.


-
Apache Tika 2.0.9 programm ffmpeg and exiftool not found ?
6 avril 2024, par mj44I use an JavaFX Maven Project to use Apache Tika Version 2.9.0.
The Java Test program will be finished and all methods that I create will done right.
I have in the log file a lot of DEBUG errors and Idon't know why ?
I habe spent many hours to clear the problem.


Here's an excerpt of the logfile


2024-04-03 14:56:12 [main] DEBUG org.apache.tika.parser.external.ExternalParser - exception trying to run ffmpeg
java.io.IOException: Cannot run program "ffmpeg": CreateProcess error=2, Das System kann die angegebene Datei nicht finden
 at java.lang.ProcessBuilder.start(ProcessBuilder.java:1140) ~[?:?]
 at java.lang.ProcessBuilder.start(ProcessBuilder.java:1074) ~[?:?]
...
2024-04-03 14:56:12 [main] DEBUG org.apache.tika.parser.external.ExternalParser - exception trying to run exiftool
java.io.IOException: Cannot run program "exiftool": CreateProcess error=2, Das System kann die angegebene Datei nicht finden
 at java.lang.ProcessBuilder.start(ProcessBuilder.java:1140) ~[?:?]
 at java.lang.ProcessBuilder.start(ProcessBuilder.java:1074) ~[?:?]
...




The message says that ffmpeg and exiftool are not found.


This is my tika-config.xml


<?xml version="1.0" encoding="UTF-8"?>
<properties>
 <parsers>
 <parser class="org.apache.tika.parser.DefaultParser"></parser>
 <parser class="org.apache.tika.parser.pdf.PDFParser"></parser>
 
 <parser class="org.apache.tika.parser.external.ExternalParser">
 <params>
 true
 
 "D:\Tools\ffmpeg-6.1.1\bin\ffmpeg.exe"
 </params>
 </parser>
 
 <parser class="org.apache.tika.parser.external.ExternalParser">
 <params>
 true
 
 "D:\Tools\exiftool.exe"
 </params>
 </parser>
 </parsers>
 <detector>
 <detector class="org.apache.tika.detect.DefaultDetector"></detector>
 </detector>
</properties>



I tested the path of the programms in a console ant it worked fine ?
I don't know what I can do now ?


Thanks for Help


I have downloaded new copies of the ffmpeg and exiftool and installed them.
I tested it in a console to run and both tools work fine.
I tested the permissions, no problems with permissions
I tested that the tika-config.xml will be loaded, it loaded.