
Recherche avancée
Médias (1)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (55)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...) -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)
Sur d’autres sites (7022)
-
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')
 }
 })
 }



-
A 'clean' way to cut an MP4 movie into two sections using FFMPEG ?
30 août 2020, par Peter in JapanI am attempting to use FFMPEG to make a script that can easily split a short MP4 movie with sound into two pieces at a certain point. I've searched through what feels like hundreds of posts to try to find "the" answer, but most of my attempts end up with poor results, broken video files that cause my video play to freeze, and so on. I am attempting to make a script that allows me to easily cut a short anime movie (something grabbed from Twitter or some other short source) and cut it into two sections, so it can be under the 2:20 Twitter time limit, or to cut out some scene I don't want to show my followers.


The issue is that FFMPEG is good at cutting videos into segments, but bad at know where keyframes are, so most videos have two seconds of blank video at the front before some keyframe appears, which looks terrible.


One example I found that works well is below, which cuts any mp4 into a bunch of chunks of n second size (six seconds in the example below). Source and documentation for this is https://moe.vg/3b8eNTs


ffmpeg -i seitokai.mp4 -c:v libx264 -crf 22 -map 0 -segment_time 6 -reset_timestamps 1 -g 30 -sc_threshold 0 -force_key_frames "expr:gte(t,n_forced*1)" -f segment output%03d.mp4


This code works great, at least allowing me to access the "left" side of a video that I want, in this case a six-second segment I want. Can anyone tell me how to accomplish the above, but starting at the 13-second period in said video, so I could get right "right" (not starting from 00:00:00) video cut cleanly ?


Alternately, a single, unified and elegant way to split (re-encode) an MP4 into two segments that forces keyframes from the very beginning of the cut pieces would be wonderful. I can't believe how hard this seems to be.


Thanks in advance for any help you can give ! Greetings from rural Japan !


-
Capture and Record Desktop Screen with/as Webcam Video
4 mars 2021, par Bilal Ahmed YaseenWebcam lets others view either still pictures or motion video of a user or other object in front of it. I want to configure Webcam in a way that it start capturing desktop screen instead of what is in front of it.



I want to manipulate desktop screen captured through Webcam using FFMPEG library. Such as :



ffmpeg -f dshow -i video="Integrated Webcam" -f mp4 cam_stream.mp4




I want to use this same application to capture my Desktop Screen that will be possible just in that case when Webcam will be able to capture my Desktop Screen instead. So above command will start recording what Webcam will be capturing that I want it to capture my desktop screen.



Note : I know other ways to capture, record or stream desktop screen but I want to achieve it through Webcam.



What I tried so far : I tried some Fake/Virtual Webcam software (manycam, sparkocam etc.) but I don't think they fulfil what I exactly want.



P.S. I posted the same question in another community but didn't get any response.



Please guide me if there is any way to achieve this ? Thanks