Recherche avancée

Médias (33)

Mot : - Tags -/creative commons

Autres articles (11)

  • MediaSPIP Init et Diogène : types de publications de MediaSPIP

    11 novembre 2010, par

    À l’installation d’un site MediaSPIP, le plugin MediaSPIP Init réalise certaines opérations dont la principale consiste à créer quatre rubriques principales dans le site et de créer cinq templates de formulaire pour Diogène.
    Ces quatre rubriques principales (aussi appelées secteurs) sont : Medias ; Sites ; Editos ; Actualités ;
    Pour chacune de ces rubriques est créé un template de formulaire spécifique éponyme. Pour la rubrique "Medias" un second template "catégorie" est créé permettant d’ajouter (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP 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 (...)

Sur d’autres sites (515)

  • How to convert ffmpeg command to ffmpeg-python

    1er décembre 2020, par Retro Pie

    Hello and thanks for reading.

    


    I have the following command : ffmpeg -i tmp.mp4 -loop 1 -i mask.png -filter_complex "[0:v]split [a][b];[a]transpose=1,crop=720:888:0:196,scale=876:1080,setdar=876/1080 [crop];[b]transpose=1,crop=720:888:0:196,scale=1920:1080,setdar=16/9,avgblur=76 [back];[1:v]alphaextract [mask];[crop][mask]alphamerge [masked];[back][masked]overlay=522:0" "out.mp4

    


    And I would like to convert it to ffmpeg-python syntax. So far I was able to come up with the bellow, but it far from ready :

    


    overlay_file = ffmpeg.input(mask)
(
ffmpeg
.input(tmp).split()
.overlay(overlay_file.hflip())
.alphaextract(),
.alphamerge(),
.output('out.mp4')
.run()
)


    


    Any help will be appreciated.

    


  • How do I compress video in Sveltekit using @ffmpeg/ffmpeg ?

    16 décembre 2022, par Mc-adams

    I am trying to compress video in Sveltekit using @ffmpeg/ffmpeg after npm install @ffmpeg/ffmpeg @ffmpeg/core. Here is my code below in the folder /src/lib/compress.Dolo.js

    


    // @ts-ignore
import fs from 'fs';
// @ts-ignore
import { createFFmpeg, fetchFile } from '@ffmpeg/ffmpeg';
const ffmpeg = createFFmpeg({ log: true });
// @ts-ignore
export async function dolo(inputfile) {
    try {
        await ffmpeg.load();
        ffmpeg.FS('writeFile', 'test.avi', await fetchFile(inputfile));
        await ffmpeg.run('ffmpeg -i', 'test.avi', 'test.mp4');
        await fs.promises.writeFile('./test.mp4', ffmpeg.FS('readFile', 'test.mp4'));
    }
    catch (e) {
        console.log(e);
    }
}


    


    After uploading a video file to my +page.server.ts as shown below

    


    import {dolo} from '$lib/compress/Dolo'
import fs from 'fs';
import ffmpeg  from '@ffmpeg/ffmpeg';

handleSubmit: async ( event: { request: { formData: () => any; }; }) => {
    const data = await event.request.formData();
    const fileu = data.get('file-input') as File;
    const abuffer = await fileu.arrayBuffer();
    const buffer = Buffer.from(new Uint8Array(abuffer));
    dolo(buffer);
}


    


    when i run the code, it gives and error in my console as shown below :

    


    [info] load ffmpeg-core
[info] loading ffmpeg-core
TypeError: fetch failed
    at fetch (C:\Users\Boteng\Botengsveltekit\node_modules\undici\index.js:105:13) {
  cause: Error: unknown scheme
      at makeNetworkError (C:\Users\Boteng\Botengsveltekit\node_modules\undici\lib\fetch\response.js:351:9)
      at schemeFetch (C:\Users\Boteng\Botengsveltekit\node_modules\undici\lib\fetch\index.js:893:14)
      at C:\Users\Boteng\Botengsveltekit\node_modules\undici\lib\fetch\index.js:602:22
      at mainFetch (C:\Users\Boteng\Botengsveltekit\node_modules\undici\lib\fetch\index.js:652:7)
      at fetching (C:\Users\Boteng\Botengsveltekit\node_modules\undici\lib\fetch\index.js:517:3)
      at fetch (C:\Users\Boteng\Botengsveltekit\node_modules\undici\lib\fetch\index.js:245:16)
      at fetch (C:\Users\Boteng\Botengsveltekit\node_modules\undici\index.js:103:20)
      at C:\Users\Boteng\Botengsveltekit\node_modules\@ffmpeg\core\dist\ffmpeg-core.js:215:32
      at C:\Users\Boteng\Botengsveltekit\node_modules\@ffmpeg\core\dist\ffmpeg-core.js:215:254
      at C:\Users\Boteng\Botengsveltekit\node_modules\@ffmpeg\core\dist\ffmpeg-core.js:215:277 {
    [cause]: undefined
  }
}


    


    Please Can anyone tell me what i am doing wrong ?

    


  • PHP-FFMPEG Error FFMpeg\Exception\RuntimeException

    27 avril 2016, par JJ The Second

    I have installed FFMPEG on a Ubuntu 14.04 server which works fine. I have also installed all dependencies/libraries successfully and don’t have any problem transcoding using linux command lines. My user/group can now process SUDO command so there isn’t any issue there. So I started experimenting with a PHP library called PHP-FFMPEG (Please click here to view this library on github) and have installed is using composer in my vendor folder. Please note, I’m using CodeIgniter 3 as PHP library and my composer has installed all dependencies in vendor folder.

    In my welcome controller that comes with CodeIgniter, this is how I’m calling FFMPEG

    public function __construct()
    {
       parent::__construct();
       // include_once('/var/www/vhosts/domain.com/streaming.domain.com/application/libraries/FFMpeg/FFMpeg.php');
       include('/var/www/vhosts/domain.com/streaming.domain.com/vendor/autoload.php');

    }

    and this is my controller

    public function preset_one()

       {


       $ffmpeg = FFMpeg\FFMpeg::create([
               'ffmpeg.binaries'  => '/bin/ffmpeg', // the path to the FFMpeg binary
               'ffprobe.binaries' => '/bin/ffprobe', // the path to the FFProbe binary
               'timeout'          => 0,
           ]);        


       $video = $ffmpeg->open('./media/video.mp4');
       $format = new FFMpeg\Format\Video\X264();
       $format->on('progress', function ($video, $format, $percentage) {
           echo "$percentage % transcoded";
       });

       $format
           -> setKiloBitrate(1000)
           -> setAudioChannels(2)
           -> setAudioKiloBitrate(256);

       $video
       ->save($format, './media/video.avi');

       }

    My media folder has 0777 permission for files and subdirectories but when I run this controller this is what I get

    An uncaught Exception was encountered

    Type: FFMpeg\Exception\RuntimeException

    Message: Encoding failed

    Filename: /var/www/vhosts/domain.com/streaming.domain.com/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/Video.php

    Line Number: 168

    Backtrace:

    File: /var/www/vhosts/domain.com/streaming.domain.com/application/controllers/Welcome.php
    Line: 124
    Function: save

    File: /var/www/vhosts/domain.com/streaming.domain.com/index.php
    Line: 315
    Function: require_once

    I’ve done everything to make it work, tried different file formats, small files and even 2GB files. I’ve also set timeout to 0 but still getting this error. What else I did was I looked at Line 168 in /var/www/vhosts/domain.com/streaming.domain.com/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/Video.php and it seems FFMPEG creates temp folders during transcoding process and there are some threads that I don’t understand.

    Has anyone experienced same issue ? Would you please educate me understanding what’s happening and why this is not functioning as it should ? Thank you all