Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (65)

  • Les images

    15 mai 2013
  • Taille des images et des logos définissables

    9 février 2011, par

    Dans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
    Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)

  • Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur

    8 février 2011, par

    La visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
    Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
    Configuration de la boite multimédia
    Dès (...)

Sur d’autres sites (6698)

  • Splitting more then once with a library

    12 mai 2017, par Fearhunter

    I am doing a research for split video’s in four files for example. I was looking at this repository on github.

    https://github.com/vdaubry/html5-video-splitter

    It’s a very nice repo how to split a video. My question is : how can I split more files then only one cut ? When I split for the second time it will overwrite the previous one. Here is the open source code of the splitting :

    var childProcess = require("child_process");
    childProcess.spawn = require('cross-spawn');

    var http = require('http');
    var path = require("path");
    var fs = require("fs");
    var exec = require('child_process').exec;

    http.createServer(function (req, res) {
     if (req.method === 'OPTIONS') {
         console.log('!OPTIONS');
         var headers = {};
         headers["Access-Control-Allow-Origin"] = "*";
         headers["Access-Control-Allow-Methods"] = "POST, GET, PUT, DELETE, OPTIONS";
         headers["Access-Control-Allow-Credentials"] = false;
         headers["Access-Control-Max-Age"] = '86400';
         headers["Access-Control-Allow-Headers"] = "X-reqed-With, X-HTTP-Method-Override, Content-Type, Accept";
         res.writeHead(200, headers);
         res.end();
     }
     else if (req.method == 'POST') {
       var body = '';
       req.on('data', function (data) {
           body += data;
       });
       req.on('end', function () {
           var data = JSON.parse(body);
           var localPath = __dirname;
           var inputFilePath = localPath+"/videos/"+data.inputFilePath;
           var outputFilePath = localPath+"/videos/output-"+data.inputFilePath
           var start = data.begin;
           var end = data.end;

           var command = "ffmpeg -y -ss "+start+" -t "+(end-start)+" -i "+inputFilePath+" -vcodec copy -acodec copy "+outputFilePath;
           exec(command, function(error, stdout, stderr) {
             var msg = ""
             if(error) {
               console.log(error);
               msg = error.toString();
               res.writeHead(500, {'Content-Type': 'text/plain'});
             }
             else {
               console.log(stdout);
               res.writeHead(200, {'Content-Type': 'text/plain'});
             }
             res.end(msg);
           });
       });
     }
     else if (req.method == 'GET') {
       var filename = "index.html";
       if(req.url != "/") {
         filename = req.url
       }

       var ext = path.extname(filename);
       var localPath = __dirname;
       var validExtensions = {
         ".html" : "text/html",      
         ".js": "application/javascript",
         ".css": "text/css",
         ".txt": "text/plain",
         ".jpg": "image/jpeg",
         ".gif": "image/gif",
         ".png": "image/png",
         ".ico": "image/x-icon"
       };
       var mimeType = validExtensions[ext];

       if (mimeType) {
         localPath += "/interface/"+filename;
         fs.exists(localPath, function(exists) {
           if(exists) {
             console.log("Serving file: " + localPath);
             getFile(localPath, res, mimeType);
           } else {
             console.log("File not found: " + localPath);
             res.writeHead(404);
             res.end();
           }
         });

       } else {
         console.log("Invalid file extension detected: " + ext)
       }
     }
    }).listen(1337, '127.0.0.1');
    console.log('Server running at http://127.0.0.1:1337/');

    function getFile(localPath, res, mimeType) {
     fs.readFile(localPath, function(err, contents) {
       if(!err) {
         res.setHeader("Content-Length", contents.length);
         res.setHeader("Content-Type", mimeType);
         res.statusCode = 200;
         res.end(contents);
       } else {
         res.writeHead(500);
         res.end();
       }
     });
    }

    I have installed FFMPEG also to do this.

    Kind regards

  • fftools/ffmpeg_filter : also remove display matrix side data from buffered frames

    28 février, par James Almer
    fftools/ffmpeg_filter : also remove display matrix side data from buffered frames
    

    Some frames may be buffered before a complex filtergraph can be configured.
    This change ensures the side data removal in the cases where autorotation is
    enabled also applies to them.

    Fixes ticket #11487

    Signed-off-by : James Almer <jamrial@gmail.com>

    • [DH] fftools/ffmpeg_filter.c
  • POST http://localhost:3000/api/video/thumbnail 500 (Internal Server Error) MongoDB and FFmpeg

    5 juillet 2022, par VoicedCreator

    I am trying to insert a thumbnail on my page using POST and im getting this error&#xA;I want to screenshot a video using FFmpeg

    &#xA;

    const express = require(&#x27;express&#x27;);&#xA;const router = express.Router();&#xA;const multer = require(&#x27;multer&#x27;);&#xA;var ffmpeg = require(&#x27;fluent-ffmpeg&#x27;);&#xA;const { User } = require("../models/User");&#xA;&#xA;const { auth } = require("../middleware/auth");&#xA;const storage = multer.diskStorage({&#xA;    destination: function (req, file, cb) {&#xA;      cb(null, &#x27;uploads/&#x27;)&#xA;    },&#xA;    filename: function (req, file, cb) {&#xA;      cb(null, `${Date.now()}_${file.originalname}`)&#xA;    },&#xA;    fileFilter: (req, file, cb) => {&#xA;        const ext = path.extname(file.originalname);&#xA;        if(ext !== &#x27;.mp4&#x27; || ext !== &#x27;.mov&#x27; || ext !== &#x27;.wmv&#x27;){&#xA;            return cb(res.status(400).end(&#x27;Solo archivos mp4-mov-wmv son aceptados&#x27;), false);&#xA;        }&#xA;        cb(null, true)&#xA;    }&#xA;  })&#xA;  &#xA;  const upload = multer({ storage: storage }).single("file")&#xA;&#xA;&#xA;//=================================&#xA;//             User&#xA;//=================================&#xA;&#xA;router.post("/uploadfiles", (req, res) => {&#xA;&#xA;    upload(req, res, err => {&#xA;        if(err) {&#xA;            return res.json({ success: false, err })&#xA;        }&#xA;        return res.json({ success: true, filePath: res.req.file.path, fileName: res.req.file.filename })&#xA;    })&#xA;&#xA;});&#xA;&#xA;router.post("/thumbnail", (req, res) => {&#xA;&#xA;&#xA;    let filePath = ""&#xA;    let fileDuration = ""&#xA;&#xA;&#xA;    ffmpeg.ffprobe(req.body.url, function (err, metadata) {&#xA;        console.dir(metadata); // all metadata&#xA;        console.log(metadata.format.duration);&#xA;        console.log(metadata) &#xA;        fileDuration = metadata.format.duration&#xA;    });&#xA;&#xA;&#xA;    ffmpeg(req.body.url)&#xA;        .on(&#x27;filenames&#x27;, function (filenames) {&#xA;            console.log(&#x27;Will generate &#x27; &#x2B; filenames.join(&#x27;, &#x27;))&#xA;            console.log(filenames)&#xA;&#xA;&#xA;            filePath = "uploads/thumbnails/" &#x2B; filenames[0]&#xA;        })&#xA;        .on(&#x27;end&#x27;, function () {&#xA;            console.log(&#x27;Screenshots taken&#x27;);&#xA;            return res.json({ success: true, url: filePath, fileName: filenames, fileDuration: fileDuration });&#xA;        })&#xA;        .on(&#x27;error&#x27;, function (err) {&#xA;            console.error(err);&#xA;            return res.json({ success: false, err });&#xA;        })&#xA;        .screenshots({&#xA;            // Will take screenshots at 20%, 40%, 60% and 80% of the video&#xA;            count: 3,&#xA;            folder: &#x27;uploads/thumbnails&#x27;,&#xA;            size: &#x27;320x240&#x27;,&#xA;            //&#x27;%b&#x27;: input basename (filename w/o extension)&#xA;            filename: &#x27;thumbnail-%b.png&#x27;&#xA;        })&#xA;});&#xA;&#xA;&#xA;&#xA;&#xA;router.post("/thumbnail", (req, res) => {&#xA;&#xA;&#xA;    let filePath = ""&#xA;    let fileDuration = ""&#xA;&#xA;&#xA;    ffmpeg(req.body.url)&#xA;        .on(&#x27;filenames&#x27;, function (filenames) {&#xA;            console.log(&#x27;Will generate &#x27; &#x2B; filenames.join(&#x27;, &#x27;))&#xA;            console.log(filenames)&#xA;&#xA;&#xA;            filePath = "uploads/thumbnails/" &#x2B; filenames[0]&#xA;        })&#xA;        .on(&#x27;end&#x27;, function () {&#xA;            console.log(&#x27;Screenshots taken&#x27;);&#xA;            return res.json({ success: true, url: filePath, fileName: filenames, fileDuration: fileDuration });&#xA;        })&#xA;        .on(&#x27;error&#x27;, function (err) {&#xA;            console.error(err);&#xA;            return res.json({ success: false, err });&#xA;        })&#xA;        .screenshots({&#xA;            // Will take screenshots at 20%, 40%, 60% and 80% of the video&#xA;            count: 3,&#xA;            folder: &#x27;uploads/thumbnails&#x27;,&#xA;            size: &#x27;320x240&#x27;,&#xA;            //&#x27;%b&#x27;: input basename (filename w/o extension)&#xA;            filename: &#x27;thumbnail-%b.png&#x27;&#xA;        })&#xA;});&#xA;&#xA;&#xA;&#xA;module.exports = router;&#xA;

    &#xA;

    Error : POST http://localhost:3000/api/video/thumbnail 500 (Internal Server Error)&#xA;TypeError : Cannot read properties of undefined (reading 'format')

    &#xA;

    I think is because ffmpeg is not connecting to mongodb

    &#xA;