
Recherche avancée
Médias (1)
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (35)
-
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...) -
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" ; -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)
Sur d’autres sites (5773)
-
Launch command from controller avoid loading page
28 juin 2019, par JoakDAWhen I launch a command from a Symfony controller, the command is executed but the GET request does not finish.
My command launchs a node.js script that receive rtsp frames transcoded from ffmpeg and broadcast it to a websocket.
This is a Debian 9 server, running Symfony 4, PHP 7.3.5 and Apache2.
This is my controller show action that calls the command :
/**
* Render view to show device details.
* @param Request $request
* @param $deviceid
* @return Response
* @Route("devices/show/{deviceid}", name="device_show", methods={"GET"})
* @IsGranted("ROLE_OPERATOR")
*/
public function showAction(Request $request, $deviceid)
{
try{
//Find device to show from system
$deviceToShow = $this->repository->find($deviceid);
if ($deviceToShow) {
$this->logger->debug('Show device: . Device has been found. Delete it... Data: ' . $deviceToShow->__toString());
//Launch video streaming commands
$command = new VideoServerCommand($this->entityManager, $this->logger, $this->getParameter('kernel.project_dir'));
$input = new ArrayInput(array(
'secret' => str_replace(' ', '', $deviceToShow->getName()),
'http_port' => 8002,
'ws_port' => 8005
));
$output = new BufferedOutput();
$resultCode = $command->run($input, $output);
$content = $output->fetch();
if ($resultCode === 0){
$this->logger->info('Call Video Server Command: Ok. Video Server started successfully. Console output: ' . $content);
}else{
$this->logger->error('Call Video Server Command: Ko. Could not start video server. Console output: ' . $content);
}
}else{
$message = $this->translator->trans('Device with identifier %deviceid% was not found.',
['%deviceid%' => $deviceid]);
$this->addFlash('error', $message);
$this->logger->error('Show device: Ko. Device with identifier ' . $deviceid . ' was not found.');
}
}catch (Exception $exception) {
$message = $this->translator->trans('Error while executing action. Error detail: %detail%.',
['%detail%' => $exception->getMessage()]);
$this->addFlash(
'error', $message
);
$this->logger->critical('Show device: Ko. Exception catched. Error detail: ' . $exception->getMessage());
}
$host = explode(':', $request->getUri());
return $this->render('device/show.html.twig', array(
'baseurl' => $host[1],
'secret' => str_replace(' ', '', $deviceToShow->getName()),
'device' => $deviceToShow,
));
}And this is my command code that runs the node.js script
protected function execute(InputInterface $input, OutputInterface $output)
{
try {
$this->logger->info('Start web socket: Setup websocket server...');
$this->io = new SymfonyStyle($input, $output);
$now = new \DateTime();
$this->io->title('Start websocket server ' . $now->format('d-m-Y G:i:s') . '...');
//Get input parameters
$secret = $input->getArgument('secret');
$tcpPort = $input->getArgument('http_port');
$wsPort = $input->getArgument('ws_port');
$output->writeln([
'Video Server',// A line
'============',// Another line
'Starting Video Reception Socket...',// Empty line
]);
//Call node websocket-relay.js
$command = 'node ' . $this->path . '/assets/js/websocket-relay.js ' . $secret . ' ' . $tcpPort . ' ' . $wsPort;
//Only want to execute for 60 seconds
$nodeVideoRelay = new Process(exec($command));
$nodeVideoRelay->setTimeout(60);
$nodeVideoRelay->setIdleTimeout(60);
try {
$nodeVideoRelay->run();
$this->logger->info('Start video streaming: OK. Video streaming successfully started...');
$this->io->success('Start video streaming: OK. Video streaming successfully started...');
$this->io->writeln($nodeVideoRelay->getOutput());
} catch (ProcessTimedOutException $timedOutException) {
$nodeVideoRelay->stop(3, SIGINT);
$this->io->success('Start video streaming: Ok. Streaming finished.');
}
//}
} catch (Exception $exception) {
$this->logger->critical('Start video streaming: Ko. Exception catched. Error detail: ' . $exception->getMessage());
$this->io->error('Start video streaming: Ko. Exception catched. Error detail: ' . $exception->getMessage());
}
}And the "websocket-relay.js" is an script got from https://github.com/phoboslab/jsmpeg/blob/master/websocket-relay.js
The result is that the page is not loading. I have another command that process the RTSP stream using ffmpeg and send the date to a websocket.
On the page that returns my controller action, it appears a canvas where the video will be rendered.
I want to render the page as soon as possible and that the node.js script runs on background without blocking the main process.
Thank you for helping me.
-
Ffmpeg stream stops after a couple of seconds
28 juin 2019, par Connor WoodfordI have an http stream of an mkv file that I am trying to transcode to mp4 via ffmpeg. Here is the command I enter to start the stream
ffmpeg -i "input.mkv" -f mpeg1video -vf "scale=640:480" -r 20 "http://localhost:port"
. The stream starts fine. Here is what the stream gives me at first :Metadata:
title : Chapter 17
Stream #0:0(eng): Video: mpeg1video, yuv420p, 640x480 [SAR 4:3 DAR 16:9], q=2-31, 200 kb/s, 24 fps, 24 tbn, 24 tbc
Metadata:
BPS-eng : 31632108
DURATION-eng : 02:03:42.289875000
NUMBER_OF_FRAMES-eng: 177957
NUMBER_OF_BYTES-eng: 29347831113
SOURCE_ID-eng : 001011
_STATISTICS_WRITING_APP-eng: MakeMKV v1.14.2 win(x64-release)
_STATISTICS_WRITING_DATE_UTC-eng: 2019-06-18 22:53:22
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
encoder : Lavc58.31.102 mpeg1video
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 111 fps=0.0 q=6.2 size= 212kB time=00:00:04.54 bitrate= 382.2kbits/s speed=8.82xbut after this shows up it hangs for a while then it gives me this :
av_interleaved_write_frame(): Unknown errorime=00:00:05.24 bitrate= 788.3kbits/s speed=10.5x
Error writing trailer of http://192.168.1.19:4012: Error number -10054 occurred
frame= 128 fps=1.1 q=12.1 Lsize= 646kB time=00:00:05.84 bitrate= 905.0kbits/s speed=0.0487x
video:343kB audio:274kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.639489%
[http @ 000001cb1fdac780] URL read error: -10054
Conversion failed!Here is my http server in node.js :
const express = require('express')
const port = port
var ffmpeg = require('ffmpeg');
var http = require('http')
var server = http.createServer(function(req, res) {
res.writeHead(200, {'Content-Type': 'video/mp4'});
})
server.listen(port, 'ipAddress')
console.log(`Example app on port ${port}!`); -
Ffmpeg http stream stops after a few seconds
27 juin 2019, par pillarman38I have an http stream of an mkv file that I am trying to transcode to mp4 via ffmpeg. Here is the command I enter to start the stream
ffmpeg -i "input.mkv" -f mpeg1video -vf "scale=640:480" -r 20 "http://localhost:port"
. The stream starts fine but it hangs for a while then it gives me this :av_interleaved_write_frame(): Unknown errorime=00:00:05.24 bitrate= 788.3kbits/s speed=10.5x
Error writing trailer of http://192.168.1.19:4012: Error number -10054 occurred
frame= 128 fps=1.1 q=12.1 Lsize= 646kB time=00:00:05.84 bitrate= 905.0kbits/s speed=0.0487x
video:343kB audio:274kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.639489%
[http @ 000001cb1fdac780] URL read error: -10054
Conversion failed!