
Recherche avancée
Médias (91)
-
Spoon - Revenge !
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
My Morning Jacket - One Big Holiday
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Zap Mama - Wadidyusay ?
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
David Byrne - My Fair Lady
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Beastie Boys - Now Get Busy
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Granite de l’Aber Ildut
9 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
Autres articles (41)
-
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 (...) -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
-
Configuration spécifique d’Apache
4 février 2011, parModules spécifiques
Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
Création d’un (...)
Sur d’autres sites (6630)
-
How exactly do I extract and merge a audio file using @ffmpeg/ffmpeg
5 octobre 2022, par jeff.gogoomaI have a lot of issues about audio transfer to server and frontend.


I am building a solution that is extracting and merging a file received from frontend.


I am using local ffmpeg file with node.js child_process package.


My Env :


framework : nest.js


runtime : node.js


lang : typescript


here is console.log(file : Express.Multer.File).
I am storing to S3 bucket these files. So I am not using multer's memory, disk storage.


// console.log(file);
 {
 fieldname: 'file',
 originalname: 'input1.mp3',
 encoding: '7bit',
 mimetype: 'audio/mpeg'
}



import cp from "child_process";

type Section = { from: number, to: number };

const files: Array = [];

export const setupAudioFileSection = async (file: Express.Multer.File, section: Section) => {
 try {
 const file1 = await cp.exec(`ffmpeg -i ${file} -y -ss 0 -t ${section.from}`);
 const file2 = await cp.exec(`ffmpeg -i ${file} -y -ss ${section.from} -t ${section.to}`);
 const file3 = await cp.exec(`ffmpeg -i ${file} -y -ss ${section.to}`);
 files.push(file1);
 files.push(file3);

 return file2;
 } catch (error) {
 console.log(error);
 throw new Error('setupAudioFileSection error');
 }



But, My Local ffmpeg is printing the error. because of [object Object]. I think local ffmpeg is not recognized the audio file received from client. So, I am resolving this issue by writing a file to disk or memory directly. but I am confusing this solution whether is right or not.


error Error: Command failed: ffmpeg -i [object Object] -y -ss 10 -t 20 -f mp3 ./TestOutput
ffmpeg version 5.1.1 Copyright (c) 2000-2022 the FFmpeg developers
 built with Apple clang version 13.1.6 (clang-1316.0.21.2.5)
 configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/5.1.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-neon
 libavutil 57. 28.100 / 57. 28.100
 libavcodec 59. 37.100 / 59. 37.100
 libavformat 59. 27.100 / 59. 27.100
 libavdevice 59. 7.100 / 59. 7.100
 libavfilter 8. 44.100 / 8. 44.100
 libswscale 6. 7.100 / 6. 7.100
 libswresample 4. 7.100 / 4. 7.100
 libpostproc 56. 6.100 / 56. 6.100

[object: No such file or directory




How can I write file on my server and read ? if that can be, I can resolve [object Object] of ffmpeg issue maybe. Please some answer or advise my issue. Thank you !


-
Cannot merge audio and video streams from ytdl-core
20 août 2022, par Abhigyan KumarI am trying to merge ytdl-core video only and audio only streams and sending the merged stream are response to user (for download in browser). With JavaScript only, its working perfectly fine. But typeScript is saying child process stdio is undefined


import express, { Request } from "express";
import ytdl from "ytdl-core";
import cp from "child_process";
import ffmpeg from "ffmpeg-static"; 
app.get("/downloadmerged", (req, res) => {
res.setHeader("Content-Type", "video/mp4");
res.setHeader(
 `Content-Disposition`,
 `attachment; filename="Merged.mp4"`
);
 const ref = "https://www.youtube.com/watch?v=aR-KAldshAE";
 const audio = ytdl(ref, { filter: "audioonly", quality: "highestaudio" });
 const video = ytdl(ref, { filter: "videoonly", quality: "highestvideo" });
 const ffmpegProcess = cp.spawn(
 ffmpeg,
 [
 // Remove ffmpeg's console spamming
 "-loglevel",
 "0",
 "-hide_banner",
 // 3 second audio offset
 "-itsoffset",
 "3.0",
 "-i",
 "pipe:3",
 "-i",
 "pipe:4",
 // Rescale the video
 "-vf",
 "scale=320:240",
 // Choose some fancy codes
 "-c:v",
 "libx265",
 "-x265-params",
 "log-level=0",
 "-c:a",
 "flac",
 // Define output container
 "-f",
 "matroska",
 "pipe:5",
 ],
 {
 windowsHide: true,
 stdio: [
 /* Standard: stdin, stdout, stderr */
 "inherit",
 "inherit",
 "inherit",
 /* Custom: pipe:3, pipe:4, pipe:5 */
 "pipe",
 "pipe",
 "pipe",
 ],
 }
 );
 ffmpegProcess.on("close", () => {
 process.stdout.write("\n\n\n");
 console.log("done");
 });
 
 audio.pipe(ffmpegProcess.stdio[3]);
 video.pipe(ffmpegProcess.stdio[4]);
 ffmpegProcess.stdio[5].pipe(res);
});



line
ffmpegProcess.stdio[3]
andffmpegProcess.stdio[4]
are giving type error

Argument of type 'Readable | Writable | null | undefined' is not assignable to parameter of type 'WritableStream'.Type 'undefined' is not assignable to type 'WritableStream'

 



-
NodeJS : Fail to write byte array input from webcam to ffmpeg spawn process
23 mai 2024, par Thanesh PrabaghanI'm using NodeJS server to display an HTML page which has webcam option. Once user visited to my NodeJS server, it will serve html page. User can allow webcam option and see webcam view on the page.


In the backend, I send webcam stream (byte array) using
socket.io
. I receive byte array successfully in backend with the help ofsocket.io
. BUT MY PROBLEM IS, I can't pipe this byte array to theffmpeg
spawn process. I don't know how to properly pipe this data to theffmpeg
. Once it done, all my problem will be solved.

On the other side, I have
node-media-server
as RTMP server to publish this stream to VLC player and other devices. Kindly help me to complete this task. I will attach all my code to this question. Kindly run this in your environment and answer the question.

MY HTML PAGE




 
 
 

 

 <code class="echappe-js"><script src="https://cdn.socket.io/4.7.5/socket.io.min.js" &#xA; integrity="integrity_code" &#xA; crossorigin="anonymous"></script>

 
 

 

<script>&#xA; const socket = io(&#x27;http://localhost:8080/&#x27;);&#xA; var video = document.getElementById("video");&#xA;&#xA; if (navigator.mediaDevices.getUserMedia) {&#xA; navigator.mediaDevices.getUserMedia({ video: true, audio:true })&#xA; .then(function (stream) {&#xA; const recorder = new MediaRecorder(stream);&#xA;&#xA; recorder.ondataavailable = event => {&#xA; socket.emit(&#x27;VideoStream&#x27;, event.data);&#xA; };&#xA; recorder.start(1000); &#xA; video.srcObject = stream;&#xA; }).catch(function (error) {&#xA; console.log("Something went wrong!");&#xA; });&#xA; } &#xA; </script>

 




FFMPEG IMPLEMENTATION


const express = require('express');
const app = express();
const http = require('http');
const server = http.createServer(app);
const { Server } = require("socket.io");
const io = new Server(server);
const path = require('node:path'); 
const { spawn } = require('node:child_process');

let cmd = spawn('ffmpeg.exe', [
 '-c:v', 'copy', '-preset', 'ultrafast', '-tune', 'zerolatency',
 '-c:a', 'aac', '-strict', '-2', '-ar', '44100', '-b:a', '64k',
 '-y',
 '-use_wallclock_as_timestamps', '1',
 '-async', '1',
 '-flush_packets', '1',
 '-rtbufsize', '1000',
 '-bufsize', '1000',
 '-f', 'flv',
 '-i','-',
 'rtmp://localhost:1935',
 ]);

app.use(express.static(path.join(__dirname, 'public')));

app.get('/', (req, res) => {
 res.sendFile(path.join(__dirname + 'index.html'));
});

io.on('connection', (socket) => {
 socket.on("VideoStream", (data) => {
 cmd.stdin.write(data);
 });
});

server.listen(8080, () => {
 console.log('listening on *:8080');
});

```
**NODE MEDIA SERVER IMPLEMENTATION**

```
const NodeMediaServer = require('node-media-server');

const config = {
 rtmp: {
 port: 1935,
 chunk_size: 60000,
 gop_cache: true,
 ping: 30,
 ping_timeout: 60
 },
 http: {
 port: 8000,
 allow_origin: '*'
 }
};

var nms = new NodeMediaServer(config)
nms.run();
```