
Recherche avancée
Médias (91)
-
Les Miserables
9 décembre 2019, par
Mis à jour : Décembre 2019
Langue : français
Type : Textuel
-
VideoHandle
8 novembre 2019, par
Mis à jour : Novembre 2019
Langue : français
Type : Video
-
Somos millones 1
21 juillet 2014, par
Mis à jour : Juin 2015
Langue : français
Type : Video
-
Un test - mauritanie
3 avril 2014, par
Mis à jour : Avril 2014
Langue : français
Type : Textuel
-
Pourquoi Obama lit il mes mails ?
4 février 2014, par
Mis à jour : Février 2014
Langue : français
-
IMG 0222
6 octobre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Image
Autres articles (100)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)
Sur d’autres sites (6688)
-
Meteor Spawn_Child_Process for FFMpeg [duplicate]
2 mars 2013, par user2009114Hi I am trying to use Meteor and javascript (Node) to spawn an ffmpeg transcoding event and then stream it live through HTML5 video tags. However, though I can get it working with node.js it seems to hang on the Meteor server and not stream anything though it does seem to be transcoding okay. It appears that the transcoding thread hangs up the server, or is not even a different thread at all ? I am pasting the relevant server side code followed by the client code calling it. One JQuery function calls the transcoding process and the PollForPlaylist is called from the video tags by the hls/. Any help would be much appreciated in solving this. I am wondering if there is a meteor function which I can call to spawn a thread for the ffmpeg function ? Or maybe there is another way to push data to the video tag through jQuery ?
var spawnNewProcess = function(file, playlistPath) {
var outputUrlPrefix = '/segment/';
var args = ['-i', file, '-async', '1', '-acodec', 'libmp3lame', '-b:a', 128 + 'k', '-vf', 'scale=min(' + targetWidth + '\\, iw):-1', '-b:v', videoBitrate + 'k', '-ar', '44100', '-ac', '2', '-vcodec', 'libx264', '-x264opts', 'level=3.0', '-profile:v', 'baseline', '-preset:v' ,'superfast', '-threads', '0', '-flags', '-global_header', '-map', '0', '-f', 'segment', '-segment_time', '10', '-segment_list', 'stream.m3u8', '-segment_format', 'mpegts', '-segment_list_flags', 'live', 'stream%05d.ts'];
var encoderChild = childProcess.spawn(transcoderPath, args, {cwd: outputPath});
console.log(transcoderPath + args);
encoderProcesses[file] = encoderChild;
currentFile = file;
console.log('Spawned transcoder instance');
if (debug) {
encoderChild.stderr.on('data', function(data) {
console.log(data.toString());
});
}
encoderChild.on('exit', function(code) {
console.log('Transcoder exited with code ' + code);
delete encoderProcesses[file];
});
// Kill any "zombie" processes
setTimeout(function() {
if (encoderProcesses[file]) {
console.log('Killing long running process');
killProcess(encoderProcesses[file]);
}
}, processCleanupTimeout);
};
var pollForPlaylist = function(file, response) {
var numTries = 0;
console.log("IN POLL FOR PLAYLIST");
var tryOpenFile = function() {
if (numTries > 20) {
console.log('Gave up trying to open m3u8 file');
response.writeHead(500);
response.end();
}
else {
console.log("IN ELSE");
fs.readFile(playlistPath, function (err, data) {
console.log("Trying to read file");
if (err || data.length === 0) {
numTries++;
setTimeout(tryOpenFile, 200);
console.log("ERROR, number of tries", numTries);
}
else {
if (!debug) {
response.setHeader('Content-Type', 'application/x-mpegURL');
}
console.log('response: ' + data);
response.write(data);
response.end();
}
});
}
};
console.log("Try open");
tryOpenFile();
};
var killProcess = function(processToKill, callback) {
processToKill.kill();
setTimeout(function() {
processToKill.kill('SIGKILL');
}, 5000);
processToKill.on('exit', function(code) {
if (callback) callback();
});
}
var handlePlaylistRequest = function(file, request, response) {
if (!file) {
request.writeHead(400);
request.end();
}
if (lock) {
console.log('Ongoing spawn process not finished, denying request');
response.writeHead(503);
response.end();
return;
}
file = path.join('/', file); // Remove ".." etc
file = path.join(rootPath, file);
console.log("PLAYLIST PATH", playlistPath);
if (currentFile != file) {
lock = true;
console.log('New file to encode chosen');
// Make sure old one gets killed
if (encoderProcesses[currentFile]) {
killProcess(encoderProcesses[currentFile], function() {
fs.unlink(playlistPath, function (err) {
spawnNewProcess(file, playlistPath, outputPath);
lock = false;
});
});
}
else {
fs.unlink(playlistPath, function (err) {
spawnNewProcess(file, playlistPath, outputPath);
lock = false;
});
}
currentFile = file;
}
};The Client side code which calls this is :
var videoNode = document.querySelector('video');
$.get('hls/?file='+file);
videoNode.src = "hls/" + file;