
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (103)
-
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.
Sur d’autres sites (13200)
-
How to upload .ts files on Firebase Storage ?
24 juillet 2020, par RobiZzTI'm creating function in Firebase that would detect when .mp4 file is uploaded and then genarated .m3u8 and .ts files for that .mp4 file, and after that uploaded those .m3u8 and .ts files to Firebase Storage.


I managed to create everything except uploading .ts files.


I'm using fluent-ffmpeg and ffmpeg-static .


My question is : How can I detect when each .ts file is generated, get their temp location and then upload them to the Firebase Storage ?


This is my current ffmpeg function :


await bucket.file(filePath).download({destination: tempFilePath});
 //console.log('Video downloaded locally to: ', tempFilePath);

 const cleanFileSizeName = cleanFileName + '_640';
 const targetTempFileName = cleanFileSizeName + '.m3u8';
 const targetTempFilePath = path.join(os.tmpdir(), targetTempFileName);
 const targetStorageFilePath = path.join(path.dirname(cleanFolderPath), targetTempFileName);
 const targetTempHlsFilePath = path.join(os.tmpdir(), cleanFileSizeName);

 //console.log('Clean Size Name: ', cleanFileSizeName);
 //console.log('Target Name:', targetTempFileName);
 //console.log('Target Path ', targetTempFilePath);
 //console.log('Target Storage Path: ', targetStorageFilePath);
 //console.log('Target HLS Path:', targetTempHlsFilePath);

 let command = ffmpeg(tempFilePath, { timeout: 540000 }) // 9 minutes
 .size('640x?')
 .videoBitrate('2100k')
 .addOption('-hls_time', 10)
 .addOption('-hls_list_size', 0)
 .addOption('-hls_base_url', '[FIREBASE STORAGE URL]' + cleanFolder)
 .addOption('-hls_playlist_type', 'vod')
 .addOption('-hls_segment_filename', targetTempHlsFilePath + '_%d.ts')
 /*.on('progress', function(progress) {
 //console.log('Processing: ' + progress.percent + '% done');
 })*/
 .on('end', function() {
 //console.log('File has been converted succesfully.');
 })
 .on('error', function(err) {
 //console.log('An error happened: ' + err.message);
 })
 .output(targetTempFilePath);

 await promisifyCommand(command);
 //console.log('Output video created at: ', targetTempFilePath);

 await bucket.upload(targetTempFilePath, {destination: targetStorageFilePath});
 //console.log('Output video uploaded to: ', targetStorageFilePath);

 fs.unlinkSync(targetTempFilePath);
 //console.log('Temporary size file removed: ', targetTempFilePath);



-
Upload screenshots to google cloud storage bucket with Fluent-ffmpeg
2 janvier 2021, par aarpodsI am currently using multer to upload videos to my google storage bucket, and fluent-ffmpeg to capture thumbnails of the videos. Videos are being uploaded into the buckets correctly, but not the thumbnails from ffmpeg. How can I change the location of the thumbnails to my google storage bucket ?


Back-End Video upload


require ('dotenv').config()
const express = require('express');
const router = express.Router();
const multer = require("multer");
var ffmpeg = require('fluent-ffmpeg');
const multerGoogleStorage = require('multer-google-storage');
const { Video } = require("../models/Video");
const {User} = require("../models/User")
const { auth } = require("../middleware/auth");


var storage = multer({
 destination: function (req, file, cb) {
 cb(null, 'videos/')
 },
 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 !== '.m3u' || ext !== '.flv' || ext !== '.avi' || ext !== '.mkv') {
 return cb(res.status(400).end('Error only videos can be uploaded'), false);
 }
 cb(null,true)
 }
})
// Set location to google storage bucket
var upload = multer({ storage: multerGoogleStorage.storageEngine() }).single("file")

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

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



Back-end thumbnail upload


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

 let thumbsFilePath = "";
 let fileDuration = "";

 ffmpeg.ffprobe(req.body.filePath, function (err, metadata) {
 console.dir(metadata);
 console.log(metadata.format.duration);

 fileDuration = metadata.format.duration;
 })


 ffmpeg(req.body.filePath)
 .on('filenames', function (filenames) {
 console.log('Will generate ' + filenames.join(', '))
 thumbsFilePath = "thumbnails/" + filenames[0];
 })
 .on('end', function () {
 console.log('Screenshots taken');
 return res.json({ success: true, thumbsFilePath: thumbsFilePath, fileDuration: fileDuration })
 })
 //Can this be uploaded to google storage?
 .screenshots({
 // Will take 3 screenshots
 count: 3,
 folder: '/thumbnails/',
 size: '320x240',
 //Names file w/o extension
 filename:'thumbnail-%b.png'
 });
});



Front-end video upload


const onDrop = (files) => {
 let formData = new FormData();
 const config = {
 header: {'content-type': 'multipart/form-data'}
 }
 console.log(files)
 formData.append("file", files[0])

 axios.post('/api/video/uploadfiles', formData, config)
 .then(response => {
 if (response.data.success) {
 let variable = {
 filePath: response.data.filePath,
 fileName: response.data.fileName
 }
 setFilePath(response.data.filePath)

 //Thumbnail
 axios.post('/api/video/thumbnail', variable)
 .then(response => {
 if (response.data.success) {
 setDuration(response.data.fileDuration)
 setThumbnail(response.data.thumbsFilePath)
 } else {
 alert("Failed to generate a thumbnail");
 }
 })

 } else {
 alert('Failed to save video to the server')
 }
 })
 }



-
avcodec/binkaudio : Don't use static storage for context-dependent data
4 septembre 2020, par Andreas Rheinhardt