Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (63)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

Sur d’autres sites (5976)

  • 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;