Recherche avancée

Médias (3)

Mot : - Tags -/image

Autres articles (111)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Les notifications de la ferme

    1er décembre 2010, par

    Afin d’assurer une gestion correcte de la ferme, il est nécessaire de notifier plusieurs choses lors d’actions spécifiques à la fois à l’utilisateur mais également à l’ensemble des administrateurs de la ferme.
    Les notifications de changement de statut
    Lors d’un changement de statut d’une instance, l’ensemble des administrateurs de la ferme doivent être notifiés de cette modification ainsi que l’utilisateur administrateur de l’instance.
    À la demande d’un canal
    Passage au statut "publie"
    Passage au (...)

  • Initialisation de MediaSPIP (préconfiguration)

    20 février 2010, par

    Lors de l’installation de MediaSPIP, celui-ci est préconfiguré pour les usages les plus fréquents.
    Cette préconfiguration est réalisée par un plugin activé par défaut et non désactivable appelé MediaSPIP Init.
    Ce plugin sert à préconfigurer de manière correcte chaque instance de MediaSPIP. Il doit donc être placé dans le dossier plugins-dist/ du site ou de la ferme pour être installé par défaut avant de pouvoir utiliser le site.
    Dans un premier temps il active ou désactive des options de SPIP qui ne le (...)

Sur d’autres sites (7370)

  • Upload screenshots to google cloud storage bucket with Fluent-ffmpeg

    2 janvier 2021, par aarpods

    I 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 Japan

    I 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 Yaseen

    Webcam 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