
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 (21)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
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 ) (...) -
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
Sur d’autres sites (4501)
-
Error : spawn process ffmpeg ChildProcessError
10 juin 2019, par KarnonI wanted to make a program like OBS simply.
My ideal code behavior is to create a child process in Node.js and execute FFMPEG commands to send a webcam stream to yourtube live RTMP server. However, the actual behavior is caused by an error in the child-process-promise module used in node.js.
I’ve checked several questions, but I don’t have enough experience to understand them, and I hope there’s a clear solution.
I guess it was because I couldn’t find the command address of FFMPEG in the Node environment. Or is calling from the socket environment a problem ?
I checked that the FFMPEG command works in a Windows prompt environment.
※ Note : FFMPEG environment variables are registered.
Environment :
Window10
,node.js
,ffmpeg
The code took advantage of a simple WebSocket example.
When I first investigated, I thought that the only way to do this was to use "fluent-effmpeg."
I tried "fluent-ffmpeg" but I couldn’t get my laptop webcam up and running in Windows environments as a parameter for the "fluent-ffmppeg" command.
I’ve also thought about using WebRTC, but I think it’s not for personal use because it’s a P2P connection. (I also saw how to connect a peer connection to a WebRTC server like Janus, but I didn’t have enough references to understand it.)
Below is the code of the problem.
const SocketIO = require("socket.io");
const ffmpeg = require("fluent-ffmpeg");
const spawn = require("child-process-promise").spawn;
module.exports = server => {
const io = SocketIO(server, { path: "/socket.io" });
io.on("connection", socket => {
const req = socket.request;
const ip = req.headers["x-forwarded-for"] || req.connection.remoteAddress;
console.log("새로운 클라이언트 접속!", ip, socket.id, req.ip);
socket.on("disconnect", () => {
console.log("클라이언트 접속해제", ip, socket.id);
clearInterval(socket.interval);
});
socket.on("error", error => {
console.error(error);
});
socket.on("reply", data => {
console.log(data);
ffmpeg_command();
});
});
function ffmpeg_command() {
let arg = [
"-f",
"lavfi",
"-i",
"anullsrc=r=16000:cl=mono",
"-f",
"dshow",
"-ac",
"2",
"-i",
"video='HP Truevision HD'",
"-s",
"1280x720",
"-r",
"10",
"-vcodec",
"libx264",
"-pix_fmt",
"yuv420p",
"-preset",
"ultrafast",
"-r",
"25",
"-g",
"20",
"-b:v",
"2500k",
"-codec:a",
"libmp3lame",
"-ar",
"44100",
"-threads",
"6",
"-b:a",
"11025",
"-bufsize",
"512k",
"-f",
"flv",
"rtmp://a.rtmp.youtube.com/live2/8dfu-69k0-dxyw-896q"
];
spawn("ffmpeg", arg).catch(e => {
console.log(e);
});
}
};Here’s the error : The expected result is that your webcam is working and YouTube live streaming is successful.
{ ChildProcessError: `ffmpeg -f lavfi -i anullsrc=r=16000:cl=mono -f dshow -ac 2 -i video='HP Truevision HD' -s 1280x720 -r 10 -vcodec libx264 -pix_fmt yuv420p -preset ultrafast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/8dfu-69k0-dxyw-896q` failed with code 1
at ChildProcess.<anonymous> (C:\Users\Tricky\Desktop\Work\ESC\ESC_temp\node_modules\child-process-promise\lib\index.js:132:23)
at ChildProcess.emit (events.js:182:13)
at ChildProcess.cp.emit (C:\Users\Tricky\Desktop\Work\ESC\ESC_temp\node_modules\child-process-promise\node_modules\cross-spawn\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:962:16)
at Socket.stream.socket.on (internal/child_process.js:381:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close (net.js:606:12)
name: 'ChildProcessError',
code: 1,
childProcess:
ChildProcess {
_events: { error: [Function], close: [Function] },
_eventsCount: 2,
_maxListeners: undefined,
_closesNeeded: 3,
_closesGot: 3,
connected: false,
signalCode: null,
exitCode: 1,
killed: false,
spawnfile: 'ffmpeg',
_handle: null,
spawnargs:
[ 'ffmpeg',
'-f',
'lavfi',
'-i',
'anullsrc=r=16000:cl=mono',
'-f',
'dshow',
'-ac',
'2',
'-i',
'video=\'HP Truevision HD\'',
'-s',
'1280x720',
'-r',
'10',
'-vcodec',
'libx264',
'-pix_fmt',
'yuv420p',
'-preset',
'ultrafast',
'-r',
'25',
'-g',
'20',
'-b:v',
'2500k',
'-codec:a',
'libmp3lame',
'-ar',
'44100',
'-threads',
'6',
'-b:a',
'11025',
'-bufsize',
'512k',
'-f',
'flv',
'rtmp://a.rtmp.youtube.com/live2/8dfu-69k0-dxyw-896q' ],
pid: 18928,
stdin:
Socket {
connecting: false,
_hadError: false,
_handle: null,
_parent: null,
_host: null,
_readableState: [ReadableState],
readable: false,
_events: [Object],
_eventsCount: 1,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: null,
_server: null,
[Symbol(asyncId)]: 132,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0 },
stdout:
Socket {
connecting: false,
_hadError: false,
_handle: null,
_parent: null,
_host: null,
_readableState: [ReadableState],
readable: false,
_events: [Object],
_eventsCount: 2,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: null,
_server: null,
write: [Function: writeAfterFIN],
[Symbol(asyncId)]: 133,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0 },
stderr:
Socket {
connecting: false,
_hadError: false,
_handle: null,
_parent: null,
_host: null,
_readableState: [ReadableState],
readable: false,
_events: [Object],
_eventsCount: 2,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: null,
_server: null,
write: [Function: writeAfterFIN],
[Symbol(asyncId)]: 134,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBytesRead)]: 1615,
[Symbol(kBytesWritten)]: 0 },
stdio: [ [Socket], [Socket], [Socket] ],
emit: [Function] },
stdout: undefined,
stderr: undefined }
</anonymous> -
Node.js Error : spawn process ffmpeg ChildProcessError
12 juin 2019, par KarnonI wanted to make a program like OBS simply.
My ideal code behavior is to create a child process in Node.js and execute FFMPEG commands to send a webcam stream to yourtube live RTMP server. However, the actual behavior is caused by an error in the child-process-promise module used in node.js.
I’ve checked several questions, but I don’t have enough experience to understand them, and I hope there’s a clear solution.
I guess it was because I couldn’t find the command address of FFMPEG in the Node environment. Or is calling from the socket environment a problem ?
I checked that the FFMPEG command works in a Windows prompt environment.
※ Note : FFMPEG environment variables are registered.
Environment :
Window10
,node.js
,ffmpeg
The code took advantage of a simple WebSocket example.
When I first investigated, I thought that the only way to do this was to use "fluent-effmpeg."
I tried "fluent-ffmpeg" but I couldn’t get my laptop webcam up and running in Windows environments as a parameter for the "fluent-ffmppeg" command.
I’ve also thought about using WebRTC, but I think it’s not for personal use because it’s a P2P connection. (I also saw how to connect a peer connection to a WebRTC server like Janus, but I didn’t have enough references to understand it.)
Below is the code of the problem.
const SocketIO = require("socket.io");
const ffmpeg = require("fluent-ffmpeg");
const spawn = require("child-process-promise").spawn;
module.exports = server => {
const io = SocketIO(server, { path: "/socket.io" });
io.on("connection", socket => {
const req = socket.request;
const ip = req.headers["x-forwarded-for"] || req.connection.remoteAddress;
console.log("새로운 클라이언트 접속!", ip, socket.id, req.ip);
socket.on("disconnect", () => {
console.log("클라이언트 접속해제", ip, socket.id);
clearInterval(socket.interval);
});
socket.on("error", error => {
console.error(error);
});
socket.on("reply", data => {
console.log(data);
ffmpeg_command();
});
});
function ffmpeg_command() {
let arg = [
"-f",
"lavfi",
"-i",
"anullsrc=r=16000:cl=mono",
"-f",
"dshow",
"-ac",
"2",
"-i",
"video='HP Truevision HD'",
"-s",
"1280x720",
"-r",
"10",
"-vcodec",
"libx264",
"-pix_fmt",
"yuv420p",
"-preset",
"ultrafast",
"-r",
"25",
"-g",
"20",
"-b:v",
"2500k",
"-codec:a",
"libmp3lame",
"-ar",
"44100",
"-threads",
"6",
"-b:a",
"11025",
"-bufsize",
"512k",
"-f",
"flv",
"rtmp://a.rtmp.youtube.com/live2/8dfu-69k0-dxyw-896q"
];
spawn("ffmpeg", arg).catch(e => {
console.log(e);
});
}
};Here’s the error : The expected result is that your webcam is working and YouTube live streaming is successful.
{ ChildProcessError: `ffmpeg -f lavfi -i anullsrc=r=16000:cl=mono -f dshow -ac 2 -i video='HP Truevision HD' -s 1280x720 -r 10 -vcodec libx264 -pix_fmt yuv420p -preset ultrafast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/8dfu-69k0-dxyw-896q` failed with code 1
at ChildProcess.<anonymous> (C:\Users\Tricky\Desktop\Work\ESC\ESC_temp\node_modules\child-process-promise\lib\index.js:132:23)
at ChildProcess.emit (events.js:182:13)
at ChildProcess.cp.emit (C:\Users\Tricky\Desktop\Work\ESC\ESC_temp\node_modules\child-process-promise\node_modules\cross-spawn\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:962:16)
at Socket.stream.socket.on (internal/child_process.js:381:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close (net.js:606:12)
name: 'ChildProcessError',
code: 1,
childProcess:
ChildProcess {
_events: { error: [Function], close: [Function] },
_eventsCount: 2,
_maxListeners: undefined,
_closesNeeded: 3,
_closesGot: 3,
connected: false,
signalCode: null,
exitCode: 1,
killed: false,
spawnfile: 'ffmpeg',
_handle: null,
spawnargs:
[ 'ffmpeg',
'-f',
'lavfi',
'-i',
'anullsrc=r=16000:cl=mono',
'-f',
'dshow',
'-ac',
'2',
'-i',
'video=\'HP Truevision HD\'',
'-s',
'1280x720',
'-r',
'10',
'-vcodec',
'libx264',
'-pix_fmt',
'yuv420p',
'-preset',
'ultrafast',
'-r',
'25',
'-g',
'20',
'-b:v',
'2500k',
'-codec:a',
'libmp3lame',
'-ar',
'44100',
'-threads',
'6',
'-b:a',
'11025',
'-bufsize',
'512k',
'-f',
'flv',
'rtmp://a.rtmp.youtube.com/live2/8dfu-69k0-dxyw-896q' ],
pid: 18928,
stdin:
Socket {
connecting: false,
_hadError: false,
_handle: null,
_parent: null,
_host: null,
_readableState: [ReadableState],
readable: false,
_events: [Object],
_eventsCount: 1,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: null,
_server: null,
[Symbol(asyncId)]: 132,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0 },
stdout:
Socket {
connecting: false,
_hadError: false,
_handle: null,
_parent: null,
_host: null,
_readableState: [ReadableState],
readable: false,
_events: [Object],
_eventsCount: 2,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: null,
_server: null,
write: [Function: writeAfterFIN],
[Symbol(asyncId)]: 133,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0 },
stderr:
Socket {
connecting: false,
_hadError: false,
_handle: null,
_parent: null,
_host: null,
_readableState: [ReadableState],
readable: false,
_events: [Object],
_eventsCount: 2,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: null,
_server: null,
write: [Function: writeAfterFIN],
[Symbol(asyncId)]: 134,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBytesRead)]: 1615,
[Symbol(kBytesWritten)]: 0 },
stdio: [ [Socket], [Socket], [Socket] ],
emit: [Function] },
stdout: undefined,
stderr: undefined }
</anonymous> -
Render Multiple Gifs with ffplay/ffmpeg in Winform
17 juin 2019, par PurqsI’m trying to get x number of animated gifs to render on like a Panel or PictureBox and using transparency that is in each gif. I’ve tried a couple approaches but am not super famiular with ffmpeg and such. Below is some code that I use to get it to render inside a panel, but I can’t figure out how to get like 5 gifs to stack/layer on one another and still render as you would expect.
I need/want this to render in the form and not outputted. I am a little confused to why the ffplay.exe doesn’t use the -i command and that might be why i can’t get it to render. any ideas ?
Working example below.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Diagnostics;
using System.Threading;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Drawing.Text;
using System.Text.RegularExpressions;
using System.Configuration;
using Microsoft.Win32;
using System.Windows.Forms.VisualStyles;
//FOR THIS EXAMPLE CREATE FORM HAVE BUTTON ON IT AND PANEL.
//button: button's click is "button1_Click"
//panel: Needed to output the render on it.
//FILES:
//Test.Gif
//These ff files came from the ffmpeg offical site.
//ffplay.exe //currently using
//ffmpeg.exe //thinking i need to use to get it how I want.
//I most of the code below from https://stackoverflow.com/questions/31465630/ffplay-successfully-moved-inside-my-winform-how-to-set-it-borderless which was a good starting point.
namespace Test_Form
{
public partial class Form1 : Form
{
[DllImport("user32.dll", SetLastError = true)]
private static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
[DllImport("user32.dll")]
private static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
//Process ffplay = null;
public Form1()
{
InitializeComponent();
Application.EnableVisualStyles();
this.DoubleBuffered = true;
}
public Process ffplay = new Process();
private void FFplay()
{
ffplay.StartInfo.FileName = "ffplay.exe";
ffplay.StartInfo.Arguments = "-noborder Test.gif"; //THIS IS WHERE I INPUT THE GIF FILE
ffplay.StartInfo.CreateNoWindow = true;
ffplay.StartInfo.RedirectStandardOutput = true;
ffplay.StartInfo.UseShellExecute = false;
ffplay.EnableRaisingEvents = true;
ffplay.OutputDataReceived += (o, e) => Debug.WriteLine(e.Data ?? "NULL", "ffplay");
ffplay.ErrorDataReceived += (o, e) => Debug.WriteLine(e.Data ?? "NULL", "ffplay");
ffplay.Exited += (o, e) => Debug.WriteLine("Exited", "ffplay");
ffplay.Start();
Thread.Sleep(1000); // you need to wait/check the process started, then...
// child, new parent
// make 'this' the parent of ffmpeg (presuming you are in scope of a Form or Control)
SetParent(ffplay.MainWindowHandle, this.Handle);
// window, x, y, width, height, repaint
// move the ffplayer window to the top-left corner and set the size to 320x280
MoveWindow(ffplay.MainWindowHandle, 800, 600, 320, 280, true);
SetParent(ffplay.MainWindowHandle, this.panel1.Handle);
MoveWindow(ffplay.MainWindowHandle, -5, -30, 320, 280, true);
}
//runs the FFplay Command
private void button1_Click(object sender, EventArgs e)
{
FFplay();
}
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
try { ffplay.Kill(); }
catch { }
}
}I would like the button to allow me to add any number of gifs (like 5 or 10) all to the same area and have them being animated with their transparent showing what is under that gif.
So for example I could have a circle image, then a spinning/loading transparent gif on top, and then a gif that counts up/down on top of that one to give me the effect of a count-down.
Thanks for all the help !