
Recherche avancée
Autres articles (63)
-
MediaSPIP Core : La Configuration
9 novembre 2010, parMediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...) -
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
Sur d’autres sites (10241)
-
lavfi/opencl : Avoid deprecation warnings when built with post-1.2 headers
19 mars 2018, par Mark Thompsonlavfi/opencl : Avoid deprecation warnings when built with post-1.2 headers
The intended target is OpenCL 1.2, so disable warnings for APIs deprecated
after that. This primarily applies to clCreateCommandQueue(), we can't use
the replacement clCreateCommandQueueWithProperties() because it was
introduced in OpenCL 2.0.Also remove some unnecessary includes from overlay and program filters so
that the define is available at the right moment. -
video upload is having issue post variable is not getting there
30 juillet 2015, par sonam Sharmaplease look the the code below
<?php
session_start();
include "conn.php";
$sid = $_SESSION['id'];
$ipIP=$_SERVER['REMOTE_ADDR'];
$uploaddir = "mem/$sid/video/";
//Check the file is of correct format.
function checkfile($input){
$ext = array('mpg', 'wma', 'mov', 'flv', 'mp4', 'avi', 'qt', 'wmv', 'rm', 'mkv', 'MP4');
$extfile = substr($input['name'],-4);
$extfile = explode('.',$extfile);
$good = array();
@$extfile = $extfile[1];
if(in_array($extfile, $ext)){
$good['safe'] = true;
$good['ext'] = $extfile;
}else{
$good['safe'] = false;
}
return $good;
}
if(!isset($_POST['profileimage99']) || $_FILES["profileimage99"]["size"] ==''){
echo 'No file added';die;
}
// if the form was submitted process request if there is a file for uploading
if(@$_FILES["profileimage99"]["size"] < 102400000000){
//$live_dir is for videos after converted to flv
$live_dir = "mem/$sid/video/";
//$live_img is for the first frame thumbs.
$live_img = "mem/$sid/img/";
$seed = rand(11111111111193,9999999999999929) * rand(3,9);
$getEXT=substr(@$_FILES['profileimage99']['name'],-5);
$upload = $seed.$getEXT;
$uploadfile = $uploaddir .$upload;
$safe_file = checkfile(@$_FILES['profileimage99']);
if($safe_file['safe'] == 1){
if (move_uploaded_file(@$_FILES['profileimage99']['tmp_name'], $uploadfile)) {
echo "Video uploaded.";
$base = basename($uploadfile, $safe_file['ext']);
$new_file = $base.'flv';
$new_image = $base.'jpg';
$new_image_path = $live_img.$new_image;
$new_flv = $live_dir.$new_file;
require 'vendor/autoload.php';
//ececute ffmpeg generate flv
exec('ffmpeg -i '.$uploadfile.' -f flv -s 640x360 '.$new_flv.'');
//execute ffmpeg and create thumb
exec('ffmpeg -i '.$uploadfile.' -f mjpeg -vframes 17 -s 426x240 -an '.$new_image_path.'');
echo 'Thank You For Your Video!<br />';
//create query to store video
if(isset($_POST['title'])){$titlename=$_POST['title'];}else{$titlename='';}
if(isset($_POST['desc'])){$desc=$_POST['desc'];}else{$desc='';}
if(isset($_POST['catag'])){$catag=$_POST['catag'];}else{$catag='';}
if(isset($_POST['channel'])){$channel=$_POST['channel'];}else{$channel='';}
$dbentry_o=mysqli_query($conn,"insert into vids (uid,chid,ctid,vname,vdisc,duration,time,ip,src) values ('$sid','$channel','$catag','$titlename','$desc','00','00','$ipIP','$new_file')");
echo "donr90909090";die;
} else {
echo "Possible file upload attack!\n";
print_r($_FILES);
}
}else{
echo 'Invalid File Type Please Try Again. You file must be of type
.mpg, .wma, .mov, .flv, .mp4, .avi, .qt, .wmv, .rm'.$_FILES['profileimage99']['name'];
}
}else{
echo 'Please choose a video';die;
}
?>i am submiting this form
<form style="margin:0px;display:none;" action="videoupload.php" method="post">
<input type="file" style="display:none;" />
</form>to the page above
when ever i submit the form i get the error no file added like as if the post variable is not getting there on the page and when i remove the validationif(!isset($_POST['profileimage99']) || $_FILES["profileimage99"]["size"] ==''){
echo 'No file added';die;
}i can upload some files usually less then 2 mb file but for larger files i get undefined index error for profileimage99.
i have increased the upload_max_size from php.ini file
Please not that the form is submitted by ajax call
-
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