
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 (80)
-
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...) -
Récupération d’informations sur le site maître à l’installation d’une instance
26 novembre 2010, parUtilité
Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (6046)
-
ffmpeg send video to ffserver without reencode, CPU usage still very high.How ?
3 septembre 2019, par Wayne ChenI’m using ffmpeg to send H.264 video to ffserver. Command looks like this :
ffmpeg -re -stream_loop -1 -i test.mp4 -c copy http://localhost:8090/feed1.ffm
I thought with
-c copy
option, the CPU usage of ffmpeg should be very low, but it actually used 99% of CPU.Please help cutdown the usage of CPU.
Thanks----------------------
ffserver.conf :
<feed>
File /tmp/feed1.ffm
FileMaxSize 5M
ACL allow 127.0.0.1
ACL allow 192.168.1.250
</feed>
<stream>
Feed feed1.ffm
Format rtp
VideoCodec libx264
VideoFrameRate 25
VideoBufferSize 80000
VideoSize 1920x1080
PreRoll 15
NoDefaults
NoAudio
</stream>ffserver log:
ffserver -d -f /etc/ffserver.conf
ffserver version 3.3.9 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.11) 20160609
configuration: --enable-gpl --enable-nonfree --enable-pthreads --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-version3 --enable-ffplay --enable-ffserver --enable-shared
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
Tue Sep 3 09:45:38 2019 Codecs do not match for stream 0
Tue Sep 3 09:45:38 2019 [ffm @ 0x1072d80]Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Tue Sep 3 09:45:38 2019 Codecs do not match for stream 0
Tue Sep 3 09:45:38 2019 [ffm @ 0x10695e0]Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Tue Sep 3 09:45:38 2019 FFserver started.
Tue Sep 3 09:45:39 2019 192.168.1.240 - - [] " " 200 0
Tue Sep 3 09:45:39 2019 192.168.1.240 - - [] " " 200 0
Tue Sep 3 09:45:39 2019 192.168.1.240:0 - - "PLAY test2-rtsp/streamid=0 RTP/TCP"
Tue Sep 3 09:45:39 2019 192.168.1.240:0 - - "PLAY test1-rtsp/streamid=0 RTP/TCP"
Tue Sep 3 09:45:39 2019 192.168.1.240:0 - - "PLAY test2-rtsp/streamid=0 RTP/TCP"
Tue Sep 3 09:45:39 2019 192.168.1.240:0 - - "PLAY test1-rtsp/streamid=0 RTP/TCP"FFmpeg log:
wayne@ubuntu:~$ ffmpeg -re -stream_loop -1 -i test_main.mp4 -c copy http://localhost:8090/feed1.ffm & ffmpeg -re -stream_loop -1 -i test_minor.mp4
4 -c copy http://localsudffmpeg -re -stream_loop -1 -i test_main.mp4 -c copy http://localhost:8090/feed1.ffm & ffmpm
ffmpeg version 3.3.9 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.11) 20160609
configuration: --enable-gpl --enable-nonfree --enable-pthreads --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-version3 --enable-ffplay --enable-ffserver --enable-shared
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_main.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.40.101
Duration: 00:00:51.60, start: 0.000000, bitrate: 987 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 985 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
[tcp @ 0x19ca600] Connection to tcp://localhost:8090 failed (Connection refused), trying next address
[tcp @ 0x19d58a0] Connection to tcp://localhost:8090 failed (Connection refused), trying next address
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x19d67c0] VBV bufsize set but maxrate unspecified, ignored
[libx264 @ 0x19d67c0] using SAR=1/1
[libx264 @ 0x19d67c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x19d67c0] profile Progressive High, level 4.0, 4:2:0, 8-bit
Output #0, ffm, to 'http://localhost:8090/feed1.ffm':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : now
encoder : Lavf57.71.100
Stream #0:0(eng): Video: h264 (libx264), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 1000k tbn, 25 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc57.89.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 655360000 vbv_delay: -1
frame= 13 fps=0.0 q=0.0 size= 4kB time=00:00:00.00 bitrate=N/A speed= 0x
frame= 26 fps= 26 q=0.0 size= 4kB time=00:00:00.00 bitrate=N/A speed= 0x
frame= 38 fps= 25 q=0.0 size= 4kB time=00:00:00.00 bitrate=N/A speed= 0x
frame= 43 fps= 18 q=28.0 size= 4kB time=-00:00:00.03 bitrate=N/A speed=N/A
frame= 55 fps= 19 q=28.0 size= 16kB time=00:00:00.44 bitrate= 297.9kbits/s speed=0.151x
frame= 59 fps= 17 q=28.0 size= 44kB time=00:00:00.60 bitrate= 600.7kbits/s speed=0.171x -
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 ?


-
High Definition Compatible Digital (HDCD) decoder filter, using libhdcd
26 août 2016, par Burt PHigh Definition Compatible Digital (HDCD) decoder filter, using libhdcd
Signed-off-by : Burt P <pburt0@gmail.com>
Signed-off-by : Diego Biurrun <diego@biurrun.de>
Signed-off-by : Luca Barbato <lu_zero@gentoo.org>