
Recherche avancée
Médias (1)
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
Autres articles (63)
-
List of compatible distributions
26 avril 2011, parThe 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, parUnlike 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 2011Unfortunately 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 FearhunterI 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 Almerfftools/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>
-
POST http://localhost:3000/api/video/thumbnail 500 (Internal Server Error) MongoDB and FFmpeg
5 juillet 2022, par VoicedCreatorI am trying to insert a thumbnail on my page using POST and im getting this error
I want to screenshot a video using FFmpeg


const express = require('express');
const router = express.Router();
const multer = require('multer');
var ffmpeg = require('fluent-ffmpeg');
const { User } = require("../models/User");

const { auth } = require("../middleware/auth");
const storage = multer.diskStorage({
 destination: function (req, file, cb) {
 cb(null, 'uploads/')
 },
 filename: function (req, file, cb) {
 cb(null, `${Date.now()}_${file.originalname}`)
 },
 fileFilter: (req, file, cb) => {
 const ext = path.extname(file.originalname);
 if(ext !== '.mp4' || ext !== '.mov' || ext !== '.wmv'){
 return cb(res.status(400).end('Solo archivos mp4-mov-wmv son aceptados'), false);
 }
 cb(null, true)
 }
 })
 
 const upload = multer({ storage: storage }).single("file")


//=================================
// User
//=================================

router.post("/uploadfiles", (req, res) => {

 upload(req, res, err => {
 if(err) {
 return res.json({ success: false, err })
 }
 return res.json({ success: true, filePath: res.req.file.path, fileName: res.req.file.filename })
 })

});

router.post("/thumbnail", (req, res) => {


 let filePath = ""
 let fileDuration = ""


 ffmpeg.ffprobe(req.body.url, function (err, metadata) {
 console.dir(metadata); // all metadata
 console.log(metadata.format.duration);
 console.log(metadata) 
 fileDuration = metadata.format.duration
 });


 ffmpeg(req.body.url)
 .on('filenames', function (filenames) {
 console.log('Will generate ' + filenames.join(', '))
 console.log(filenames)


 filePath = "uploads/thumbnails/" + filenames[0]
 })
 .on('end', function () {
 console.log('Screenshots taken');
 return res.json({ success: true, url: filePath, fileName: filenames, fileDuration: fileDuration });
 })
 .on('error', function (err) {
 console.error(err);
 return res.json({ success: false, err });
 })
 .screenshots({
 // Will take screenshots at 20%, 40%, 60% and 80% of the video
 count: 3,
 folder: 'uploads/thumbnails',
 size: '320x240',
 //'%b': input basename (filename w/o extension)
 filename: 'thumbnail-%b.png'
 })
});




router.post("/thumbnail", (req, res) => {


 let filePath = ""
 let fileDuration = ""


 ffmpeg(req.body.url)
 .on('filenames', function (filenames) {
 console.log('Will generate ' + filenames.join(', '))
 console.log(filenames)


 filePath = "uploads/thumbnails/" + filenames[0]
 })
 .on('end', function () {
 console.log('Screenshots taken');
 return res.json({ success: true, url: filePath, fileName: filenames, fileDuration: fileDuration });
 })
 .on('error', function (err) {
 console.error(err);
 return res.json({ success: false, err });
 })
 .screenshots({
 // Will take screenshots at 20%, 40%, 60% and 80% of the video
 count: 3,
 folder: 'uploads/thumbnails',
 size: '320x240',
 //'%b': input basename (filename w/o extension)
 filename: 'thumbnail-%b.png'
 })
});



module.exports = router;



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


I think is because ffmpeg is not connecting to mongodb