
Recherche avancée
Médias (91)
-
Spitfire Parade - Crisis
15 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Wired NextMusic
14 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (96)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...)
Sur d’autres sites (5634)
-
Downloader downloads high quality video but muted
5 avril 2023, par Stef-LevI have created a next.js video downloader and I want to download videos of the highest quality. When I trigger the download I only get a muted mp4 file (in high quality) and a muted mp3 file. Here is the api file. How could I download the video, the audio and then merge them with ffmpeg correctly ?


import ytdl from "ytdl-core";
import fs from "fs";
import { Server } from "socket.io";
import ffmpeg from "fluent-ffmpeg";

export default async function handler(req, res) {
 if (res.socket.server.io) {
 console.log("Socket is already running");
 res.end();
 return;
 }
 console.log("Socket is initializing");
 const io = new Server(res.socket.server);
 res.socket.server.io = io;

 io.on("connection", async (socket) => {
 console.log(socket.id, "socketID");

 const sendError = async (msg) => {
 socket.emit("showError", msg);
 };

 const sendProgress = async (msg) => {
 console.log(msg);
 socket.emit("showProgress", msg);
 };

 const sendComplete = async (msg) => {
 console.log(msg);
 socket.emit("showComplete", msg);
 };

 const downloadVideo = async (url) => {
 try {
 const videoInfo = await ytdl.getInfo(url);
 const outputPath = path.join(
 process.cwd(),
 "mp4s",
 `${videoInfo.videoDetails.title}.mp4`
 );
 const audioPath = path.join(
 process.cwd(),
 "mp4s",
 `${videoInfo.videoDetails.title}.mp3`
 );

 const videoFormat = ytdl.chooseFormat(videoInfo.formats, {
 quality: "highestvideo",
 filter: "videoonly",
 });
 const audioFormat = ytdl.chooseFormat(videoInfo.formats, {
 quality: "highestaudio",
 filter: "audioonly",
 });
 const videoStream = ytdl(url, { quality: videoFormat.itag });
 const audioStream = ytdl(url, { quality: audioFormat.itag });

 const videoOutput = fs.createWriteStream(outputPath);
 const audioOutput = fs.createWriteStream(audioPath);

 audioStream.pipe(audioOutput);
 videoStream.pipe(videoOutput);

 let downloadedBytes = 0;
 let totalBytes =
 videoFormat.contentLength || videoInfo.length_seconds * 1000000;

 videoOutput.on("data", (chunk) => {
 downloadedBytes += chunk.length;
 const progress = Math.round((downloadedBytes / totalBytes) * 100);
 sendProgress({ progress });
 });

 videoOutput.on("error", (err) => {
 console.error(err);
 sendError({
 status: "error",
 message: "An error occurred while writing the video file",
 });
 });

 audioOutput.on("error", (err) => {
 console.error(err);
 sendError({
 status: "error",
 message: "An error occurred while writing the audio file",
 });
 });

 videoOutput.on("finish", () => {
 audioOutput.on("finish", () => {
 if (fs.existsSync(outputPath) && fs.existsSync(audioPath)) {
 const outputFile = path.join(
 process.cwd(),
 "mp4s",
 `${videoInfo.videoDetails.title}-with-audio.mp4`
 );
 const command = ffmpeg()
 .input(outputPath)
 .input(audioPath)
 .outputOptions("-c:v copy")
 .outputOptions("-c:a aac")
 .outputOptions("-b:a 192k")
 .outputOptions("-strict -2")
 .output(outputFile)
 .on("end", () => {
 fs.unlink(outputPath, () => {});
 fs.unlink(audioPath, () => {});
 sendComplete({
 status: "success",
 });
 })
 .on("error", (err) => {
 console.error("ffmpeg error:", err.message);
 sendError({
 status: "error",
 message:
 "An error occurred while processing the audio and video files",
 });
 });
 command.run();
 } else {
 console.error("Output or audio file not found");
 sendError({
 status: "error",
 message: "Output or audio file not found",
 });
 }
 });
 });
 } catch (error) {
 console.error(error);
 sendError({
 status: "error",
 message: "An error occurred while downloading the video",
 });
 }
 };
 socket.on("downloadVideo", downloadVideo);
 });
 res.end();
}



I am also using socket.io to show the progress in the frontend, but for some reason I don't get the progress correctly. Is it possible to do that ?


-
Next.js Youtube mp4 downloader downloads high quality video but muted
4 avril 2023, par Stef-LevI have created a next.js video downloader and I want to download videos of the highest quality. When I trigger the download I only get a muted mp4 file (in high quality) and a muted mp3 file. Here is the api file. How could I download the video, the audio and then merge them with ffmpeg correctly ?


import ytdl from "ytdl-core";
import fs from "fs";
import { Server } from "socket.io";
import ffmpeg from "fluent-ffmpeg";

export default async function handler(req, res) {
 if (res.socket.server.io) {
 console.log("Socket is already running");
 res.end();
 return;
 }
 console.log("Socket is initializing");
 const io = new Server(res.socket.server);
 res.socket.server.io = io;

 io.on("connection", async (socket) => {
 console.log(socket.id, "socketID");

 const sendError = async (msg) => {
 socket.emit("showError", msg);
 };

 const sendProgress = async (msg) => {
 console.log(msg);
 socket.emit("showProgress", msg);
 };

 const sendComplete = async (msg) => {
 console.log(msg);
 socket.emit("showComplete", msg);
 };

 const downloadVideo = async (url) => {
 try {
 const videoInfo = await ytdl.getInfo(url);
 const outputPath = path.join(
 process.cwd(),
 "mp4s",
 `${videoInfo.videoDetails.title}.mp4`
 );
 const audioPath = path.join(
 process.cwd(),
 "mp4s",
 `${videoInfo.videoDetails.title}.mp3`
 );

 const videoFormat = ytdl.chooseFormat(videoInfo.formats, {
 quality: "highestvideo",
 filter: "videoonly",
 });
 const audioFormat = ytdl.chooseFormat(videoInfo.formats, {
 quality: "highestaudio",
 filter: "audioonly",
 });
 const videoStream = ytdl(url, { quality: videoFormat.itag });
 const audioStream = ytdl(url, { quality: audioFormat.itag });

 const videoOutput = fs.createWriteStream(outputPath);
 const audioOutput = fs.createWriteStream(audioPath);

 audioStream.pipe(audioOutput);
 videoStream.pipe(videoOutput);

 let downloadedBytes = 0;
 let totalBytes =
 videoFormat.contentLength || videoInfo.length_seconds * 1000000;

 videoOutput.on("data", (chunk) => {
 downloadedBytes += chunk.length;
 const progress = Math.round((downloadedBytes / totalBytes) * 100);
 sendProgress({ progress });
 });

 videoOutput.on("error", (err) => {
 console.error(err);
 sendError({
 status: "error",
 message: "An error occurred while writing the video file",
 });
 });

 audioOutput.on("error", (err) => {
 console.error(err);
 sendError({
 status: "error",
 message: "An error occurred while writing the audio file",
 });
 });

 videoOutput.on("finish", () => {
 audioOutput.on("finish", () => {
 if (fs.existsSync(outputPath) && fs.existsSync(audioPath)) {
 const outputFile = path.join(
 process.cwd(),
 "mp4s",
 `${videoInfo.videoDetails.title}-with-audio.mp4`
 );
 const command = ffmpeg()
 .input(outputPath)
 .input(audioPath)
 .outputOptions("-c:v copy")
 .outputOptions("-c:a aac")
 .outputOptions("-b:a 192k")
 .outputOptions("-strict -2")
 .output(outputFile)
 .on("end", () => {
 fs.unlink(outputPath, () => {});
 fs.unlink(audioPath, () => {});
 sendComplete({
 status: "success",
 });
 })
 .on("error", (err) => {
 console.error("ffmpeg error:", err.message);
 sendError({
 status: "error",
 message:
 "An error occurred while processing the audio and video files",
 });
 });
 command.run();
 } else {
 console.error("Output or audio file not found");
 sendError({
 status: "error",
 message: "Output or audio file not found",
 });
 }
 });
 });
 } catch (error) {
 console.error(error);
 sendError({
 status: "error",
 message: "An error occurred while downloading the video",
 });
 }
 };
 socket.on("downloadVideo", downloadVideo);
 });
 res.end();
}



I am also using socket.io to show the progress in the frontend, but for some reason I don't get the progress correctly. Is it possible to do that ?


-
Piwik 2 reaches end of life soon (December 2017), update now !
7 décembre 2017, par Piwik Core Team — CommunityIn less than three weeks, Piwik 2 will be no longer supported. This means that no further (security) updates will be released for this version. As per our Long Term Support announcement, Piwik 2.X is supported for 12 months after the initial release of Piwik 3.0.0 which was on December 18th 2016. Therefore, Piwik 2 will no longer receive any updates after December 18th 2017.
It has been almost a year since we released Piwik 3 and we highly recommend updating to Piwik 3 ASAP. The major new release came with a new UI, performance and security improvements. If you are still on Piwik 2, the security improvements alone should be worth updating your Piwik to Piwik 3 now. We cannot recommend this enough.
The update to Piwik 3 should be smooth, but may take a while depending on the amount of data you have.
- If you have any problem with the update, feel free to get in touch with us, or ask in the forums.
- If you are currently using Piwik self-hosted and would like to be upgraded, plus your Piwik managed in the official Cloud-hosted service, contact InnoCraft Cloud and they will migrate your database.
At Piwik and InnoCraft, the company of the makers of Piwik, we have seen many thousands of Piwik installations upgraded over the past year and look forward to an exciting future for Piwik 3 and beyond !