
Recherche avancée
Autres articles (8)
-
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...) -
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 (...) -
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)
Sur d’autres sites (3779)
-
Launch Symfony 4 command from controller works on dev but not in prod environment
14 août 2019, par JoakDAWhen an application loads, I make 2 AJAX request to start 2 proccess needed for showing a RTSP video streaming on the website.
It is working great in DEV environment but making some tests in PROD, it only works if the page is loaded on the server webbrowser (same host where the application is installed).
If I use an external browser installed on another machine, it doesn’t launch the video.
If I use an external browser installed on another machine, it doesn’t launch the video.
/**
* Start transcoding video.
* @param Request $request
* @return Response
* @Route("devices/show/videotranscoding", name="start_video_transcoding", methods={"POST"})
* @IsGranted("ROLE_OPERATOR")
*/
public function startTranscodingVideo(Request $request)
{
$value = '';
try {
//Setup needed variables
$this->initialize();
$this->logger->info('Start Video transcoding: Ok. Video started successfully');
//Get device id from POST data
$deviceid = $request->request->get('deviceid');
//Find device to show from system
$deviceToShow = $this->repository->find($deviceid);
if ($deviceToShow) {
$this->logger->info('Start Video transcoding: . Device has been found. Delete it... Data: ' . $deviceToShow->__toString());
$realHost = $this->getRealHost($_SERVER['HTTP_HOST']);
$tcpHost = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://{$realHost}";
//Launch transcoding command
$transcodingCommand = 'php ' . $this->getParameter('kernel.project_dir') . '/bin/console device:videotranscoding ' .
'rtsp://' . $deviceToShow->getUsername() . ':' . $deviceToShow->getPassword() . '@' . str_replace('http://', '', $deviceToShow->getHost()) . ':' . $deviceToShow->getRTSPPort() . ' ' .
str_replace(' ', '', $deviceToShow->getName()) . ' ' . $tcpHost . ' ' . $deviceToShow->getVideoHTTPPort();
$transcodingProcess = \Symfony\Component\Process\Process::fromShellCommandline($transcodingCommand);
$transcodingProcess->start();
$success = true;
$message = '';
} else {
$message = $this->translator->trans('Device with identifier %deviceid% was not found.',
['%deviceid%' => $deviceid]);
$success = false;
$this->addFlash('error', $message);
$this->logger->error('Start Video transcoding: Ko. Device with identifier ' . $deviceid . ' was not found.');
}
} catch (Throwable $exception) {
$message = $this->translator->trans('Error while executing action. Error detail: %detail%.',
['%detail%' => $exception->getMessage()]);
$this->addFlash(
'error', $message
);
$success = false;
$this->logger->critical('Start Video transcoding: Ko. Exception catched. Error detail: ' . $exception->getMessage());
}
$this->logger->info('Start Video transcoding: Ok. Video started successfully');
return new JsonResponse(array(
'success' => $success,
'message' => $message,
'value' => $value
));
}I have a nodejs script executing in background to listen o a specific port to broadcast the data on the TCP port to a websocket server.
The ffmpeg command transcodes the RTSP stream and sent to port TCP 8102 and broadcast the data to a websocket server listening on port 8105.
The transcoding command code :
/**
* @param InputInterface $input
* @param OutputInterface $output
* @return int|void|null
* @throws \Exception
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
try {
$this->logger->info('Start video transcoding: Setup video transcoding...');
$io = new SymfonyStyle($input, $output);
$now = new \DateTime();
$io->title('Start video transcoding at ' . $now->format('d-m-Y G:i:s') . '...');
//Get input parameters
$rtspUri = $input->getArgument('rtsp');
$secret = $input->getArgument('secret');
$portsString = $input->getArgument('tcp_port');
$tcpHost = $input->getArgument('tcp_host');
$this->logger->debug('Start video transcoding: RTSP: "' . $rtspUri . '". TCP Port: ' . $portsString);
//Absolute path to logs
$logPath = $this->path . DIRECTORY_SEPARATOR . 'var' . DIRECTORY_SEPARATOR . 'log';
$stdOutPath = $logPath . DIRECTORY_SEPARATOR . 'transcoding_out.log';
$stdErrrorPath = $logPath . DIRECTORY_SEPARATOR . 'transcoding_error.log';
//FFMPEG
$arguments = '-nostdin -t 00:01:00 -rtsp_transport tcp -i ' . $rtspUri . ' -f mpegts -codec:v mpeg1video -s 1920x1080 -b:v 800k -r 30 -bf 0 ' . $tcpHost . ':' . $portsString . '/' . $secret . ' > '
. $stdOutPath . ' 2> ' . $stdErrrorPath . ' &';
$ffmpegParams = '/usr/bin/ffmpeg ' . $arguments;
//$ffmpegProcess = new Process($ffmpegParams);
$ffmpegProcess = \Symfony\Component\Process\Process::fromShellCommandline($ffmpegParams);
$ffmpegProcess->setTimeout(60);
$ffmpegProcess->setIdleTimeout(60);
try {
$ffmpegProcess->start();
$this->logger->info('Start video transcoding: OK. Video streaming successfully started...');
$io->success('Start video transcoding: OK. Video streaming successfully started...');
}catch (ProcessTimedOutException $timedOutException){
$ffmpegProcess->stop(3, SIGINT);
$this->io->success('Start video transcoding: Ko. Transcoding finished with error.');
}
} catch (Throwable $exception) {
$message = 'Start video transcoding: Ko. Exception catched. Error detail: ' . $exception->getMessage();
$this->logger->critical($message);
$io->error($message);
}
}The node.js code (got from here JSMpeg – MPEG1 Video & MP2 Audio Decoder in JavaScript :
// Use the websocket-relay to serve a raw MPEG-TS over WebSockets. You can use
// ffmpeg to feed the relay. ffmpeg -> websocket-relay -> browser
// Example:
// node websocket-relay yoursecret 8081 8082
// ffmpeg -i <some input="input"> -f mpegts http://localhost:8081/yoursecret
var fs = require('fs'),
http = require('http'),
WebSocket = require('ws');
if (process.argv.length < 3) {
console.log(
'Usage: \n' +
'node websocket-relay.js <secret> [ ]'
);
console.log(process.cwd());
process.exit();
}
var STREAM_SECRET = process.argv[2],
STREAM_PORT = process.argv[3] || 8081,
WEBSOCKET_PORT = process.argv[4] || 8082,
RECORD_STREAM = false;
// Websocket Server
var socketServer = new WebSocket.Server({port: WEBSOCKET_PORT, perMessageDeflate: false});
socketServer.connectionCount = 0;
socketServer.on('connection', function(socket, upgradeReq) {
socketServer.connectionCount++;
console.log(
'New WebSocket Connection: ',
(upgradeReq || socket.upgradeReq).socket.remoteAddress,
(upgradeReq || socket.upgradeReq).headers['user-agent'],
'('+socketServer.connectionCount+' total)'
);
socket.on('close', function(code, message){
socketServer.connectionCount--;
console.log(
'Disconnected WebSocket ('+socketServer.connectionCount+' total)'
);
});
});
socketServer.broadcast = function(data) {
socketServer.clients.forEach(function each(client) {
if (client.readyState === WebSocket.OPEN) {
client.send(data);
}
});
};
// HTTP Server to accept incomming MPEG-TS Stream from ffmpeg
var streamServer = http.createServer( function(request, response) {
var params = request.url.substr(1).split('/');
if (params[0] !== STREAM_SECRET) {
console.log(
'Failed Stream Connection: '+ request.socket.remoteAddress + ':' +
request.socket.remotePort + ' - wrong secret.'
);
response.end();
}
response.connection.setTimeout(0);
console.log(
'Stream Connected: ' +
request.socket.remoteAddress + ':' +
request.socket.remotePort
);
request.on('data', function(data){
socketServer.broadcast(data);
if (request.socket.recording) {
request.socket.recording.write(data);
}
});
request.on('end',function(){
console.log('close');
if (request.socket.recording) {
request.socket.recording.close();
}
});
// Record the stream to a local file?
if (RECORD_STREAM) {
var path = 'recordings/' + Date.now() + '.ts';
request.socket.recording = fs.createWriteStream(path);
}
}).listen(STREAM_PORT);
console.log('Listening for incomming MPEG-TS Stream on http://127.0.0.1:'+STREAM_PORT+'/<secret>');
console.log('Awaiting WebSocket connections on ws://127.0.0.1:'+WEBSOCKET_PORT+'/');
</secret></secret></some>I am using PHP 7.3 and Symfony 4.3
I am able to get a successfully response from the controller but I can’t watch the video streaming on an external computer.
UPDATED : I don’t know if it may be related to the issue, but when I switch to DEV and then switch again to PROD using :
composer dump-env prod
If I try to clear the cache with :
php bin/console cache:clear
It appears :
joaquin@dev-computer:/var/www/example.com/html$ composer dump-env prod
Successfully dumped .env files in .env.local.php
joaquin@dev-computer:/var/www/example.com/html$ php bin/console cache:clear
09:15:07 ERROR [console] Error thrown while running command "cache:clear". Message: "Failed to remove file "/var/www/example.com/html/var/cache/pro~/pools/WBCr1hDG8d/-/R/iW4Vq0vqfrjVsp2Gihwg": unlink(/var/www/example.com/html/var/cache/pro~/pools/WBCr1hDG8d/-/R/iW4Vq0vqfrjVsp2Gihwg): Permission denied." ["exception" => Symfony\Component\Filesystem\Exception\IOException]8;;file:///var/www/example.com/html/vendor/symfony/filesystem/Exception/IOException.php\^]8;;\ { …},"command" => "cache:clear","message" => "Failed to remove file "/var/www/example.com/html/var/cache/pro~/pools/WBCr1hDG8d/-/R/iW4Vq0vqfrjVsp2Gihwg": unlink(/var/www/example.com/html/var/cache/pro~/pools/WBCr1hDG8d/-/R/iW4Vq0vqfrjVsp2Gihwg): Permission denied."]
In Filesystem.php line 184:
Failed to remove file "/var/www/example.com/html/var/cache/pro~/pools/WBCr1hDG8d/-/R/iW4Vq0vqfrjVsp2Gihwg": unlink(/va
r/www/example.com/html/var/cache/pro~/pools/WBCr1hDG8d/-/R/iW4Vq0vqfrjVsp2Gihwg): Permission denied.
cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>
</command>Thanks
-
ffmpeg - mp4 video created from images not rendered in browser [on hold]
6 mai 2014, par mast kalandarUsing PHP (Symfony) I have extracted set of frames from a video using
ffmpeg
. Following is the command I’ve used :ffmpeg -i f1.mp4 f%d.jpg
Total 30 frames were created, each one of 1920 x 1020 pixels
I have added some text in those frames and created one video
(without changing dimension of any frames)ffmpeg -f image2 -r 30 -i f%d.png -r 30 -b:v 5458k my.mp4
When I try to render this mp4 file in video tag (Chromium & Mozilla Firefox), it is not getting render, however other normal mp4 videos are getting render properly.
Strange thing is when I open this video directly
(http://localhost/MyProject/web/video/user_videos/my.mp4)
in Mozilla Firefox, it is getting played in screen properly, however not in Chromium.What is the problem here ??
Do I need to add one second audio as well to my.mp4 file ?
Kindly suggest if any thing is missing ??
-
Revision 81ad047ee5 : VP8 for ARMv8 by using NEON intrinsics 06 Add idct_dequant_full_2x_neon.c - idc
17 décembre 2013, par James YuChanged Paths :
Delete /vp8/common/arm/neon/idct_dequant_full_2x_neon.asm
Add /vp8/common/arm/neon/idct_dequant_full_2x_neon.c
Modify /vp8/vp8_common.mk
VP8 for ARMv8 by using NEON intrinsics 06Add idct_dequant_full_2x_neon.c
idct_dequant_full_2x_neon
==== Summary of apply VP8 decode patch series ====
Benchmark on Samsung Chromebook, Cortex-A15, 1.7GHz, Dual core
Toolchain : linaro-1.13.1-4.8-2014.01
Compile argument : CROSS=arm-linux-gnueabihf- ../libvpx/configure
—target=armv7-linux-gcc —prefix=$HOME/out
—enable-shared —cpu=cortex-a7
Test argument : vpxdec —summary —noblit ./tears_of_steel_1080p.webmNEON assembly 46.68 (fps)
Apply patch 06 46.65, -0.03
Apply patch 07 46.86, +0.21
Apply patch 08 46.58, -0.28
Apply patch 09 46.57, -0.01
Apply patch 10 46.51, -0.06
Apply patch 11 46.13, -0.38
Apply patch 12 45.42, -0.71
Apply patch 13 46.06, +0.64
Apply patch 14 45.19, -0.87
Apply patch 15 45.93, +0.74
Apply patch 16 45.48, -0.45
Apply patch 17 45.84, +0.36
Apply patch 18 45.91, +0.07 <= With all NEON intrinsics patches
Total -0.77 fps, 1.65% performance regressionChange-Id : I77bfc9eaccfb97b8d401e949ceff8795e26ca6b7
Signed-off-by : James Yu <james.yu@linaro.org>