
Recherche avancée
Autres articles (74)
-
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
Gestion de la ferme
2 mars 2010, parLa ferme est gérée dans son ensemble par des "super admins".
Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
Dans un premier temps il utilise le plugin "Gestion de mutualisation"
Sur d’autres sites (7068)
-
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'

 



-
Feed raw data to ffmpeg from python
27 octobre 2020, par eriI want to wrap h264 stream to mp4 container on fly. But ffmpeg exits after first buffer


ffmpeg = subprocess.Popen("ffmpeg -f h264 -i pipe: -c copy -f mp4 -movflags frag_keyframe+empty_moov+faststart pipe:".split(), stdout=subprocess.PIPE, stdin=subprocess.PIPE)

fd = ffmpeg.stdout.fileno()
fl = fcntl.fcntl(fd, fcntl.F_GETFL)
fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)

while True:
 data = infile.read(32768)
 ffmpeg.stdin.write(data)
 data = ffmpeg.stdout.read()
 outfile.write(data)



-
Piping PCM data from FFMPEG to another process with Python subprocess
13 février 2017, par Pete BleackleyI am trying to transcribe a podcast. To do so, I am decoding the mp3 stream with FFMPEG, and piping the resulting PCM output to the speech recognition component. My code looks like this.
mp3=subprocess.Popen(['ffmpeg','-i',audio_url,
'-f','s16le','-ac','1','-ar','16000','pipe:0'],
stdout=subprocess.PIPE)
sphinx=subprocess.Popen(['java','-jar','transcriber.jar'],
stdin=mp3.stdout,
stdout=subprocess.PIPE)Where
audio_url
is the url of the mp3 file.When I try to run this, it hangs. It appears that feeding the decoded PCM data through the pipe has deadlocked. What can I do to fix this ? The size of the output data is likely to be too big for
subprocess.Popen.communicate
to be an option, and explicitly callingmp3.stdout.close()
has had no effect.