Recherche avancée

Médias (1)

Mot : - Tags -/livre électronique

Autres articles (102)

  • Sélection de projets utilisant MediaSPIP

    29 avril 2011, par

    Les exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
    Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
    Ferme MediaSPIP @ Infini
    L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

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

Sur d’autres sites (7842)

  • Encode PNG images to MP4

    12 avril 2020, par xybrek

    I'm using FFMPEG.js to convert PNG images into MP4 in the Browser with this code :

    



        const { createWorker } = FFmpeg;
    const worker = createWorker({
        corePath: 'ffmpeg-core.min.js',
        progress: (p) => console.log(p),
        logger: ({ message }) => console.log(message),
    });
    const image2video = async (frames) => {
        console.log('Loading ffmpeg-core.min.js');
        await worker.load();
        console.log('Loading data');

        const d = new Date();
        const timestamp = d.getTime();

        for(let i = 0; i < frames.length; i += 1) {
            const num = `00${i}`.slice(-3);
            const fileName = `tmp.${timestamp}.${num}.png`;
            console.log(fileName);
            await worker.write(fileName, frames[i]); // base64 'image/png'
            const { file } = await worker.read(fileName);
            // throws -> Uncaught (in promise) TypeError: Cannot read property 'buffer' of undefined
            const testFile = URL.createObjectURL(new Blob([file.buffer], { type: 'image/png' }));
            console.log(testFile);
        }
        await worker.run('-framerate 30 -pattern_type glob -i /data/*.png -c:a copy -shortest -c:v libx264 -pix_fmt yuv420p out.mp4', { output: 'out.mp4' });
        const { data } = await worker.read('out.mp4');
        const outputURL = URL.createObjectURL(new Blob([data.buffer], { type: 'video/mp4' }));
        console.log(outputURL);
    }


    



    However it throws :

    



    [png @ 0x1175980] Warning: not compiled with thread support, using thread emulation
[image2 @ 0x1177180] Could not open file : /data/*.png
[image2 @ 0x1177180] Could not find codec parameters for stream 0 (Video: png, none(pc)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, image2, from '/data/*.png':
Duration: 00:00:00.03, start: 0.000000, bitrate: N/A
Stream #0:0: Video: png, none(pc), 30 tbr, 30 tbn, 30 tbc
Output #0, mp4, to 'out.mp4':
Output file #0 does not contain any stream


    



    What could be missing here ?

    


  • Ffmpeg-fluent throwing "At least one output file must be specified" error

    26 octobre 2020, par kazar12567

    Code :

    


    inputs : The directory is my directory. Username is a string, for example "james".
fileExtentionsion is the video extension, for example .mp4.
dateStr is a date string.
Compression is just the factor, ie 40.

    


    ffmpeg()
      .input(`${directory}${username}/video${fileExtension}`)
      .save(`${directory}${username}/${dateStr}${fileExtension}`)
      .addOptions(`-c:v libx265 -crf ${compression} -preset veryfast -c:a aac -b:a 128k`)
      .on("start", (commandLine) => {
        console.log("start : " + commandLine);
      })
      .on("progress", (progress) => {
        console.log("In Progress !!" + Date());
      })
      .on("end", () => resolve())
      .on("error", (err) => {
        console.log("reject");
        return reject(err);
      });
  });


    


    Does anyone know why this does not run, even though it runs in the command line ?

    


  • FFMPEG fnExtractFrameToJPG to DB sequelize

    4 juillet 2020, par jjplack

    after process the video i would like to pass the first frame screenshot to to db !

    


    I've tried by get the originalname or filename and did not get the exact thumb file

    


    So, i've tried also use fs but, the issue is that after the thumb creation the FFMPEG add the thumb number to identify the frame, and seems impossible to get the same thumb.

    


    Someone can help ?

    


    here is the code

    


    fastify.route({
    method: "POST",
    preHandler: upload.single("video"),

    handler: async function(request, reply) {
      const { Post } = fastify.sequelize;
 

      const fileName = Date.now() + "-" + request.file.originalname;
      const filename = request.file.originalname;

      const thumbName = Date.now() + "-" + "thumb" + ".jpg";
      const videoPath = "./public/uploads/";
      const thumbPath = "./public/thumb/";
      // const thumbFile = thumbPath + request.file.
      // const video_file = fs.createReadStream(request.file.path);

      try {
        const process = new ffmpeg(request.file.path);
        process.then(
          function(video) {
            video.fnExtractFrameToJPG(thumbPath, {
              frame_rate: 1,
              number: 1,
              file_name: filename[0] + "_%s"
            });
            video.setVideoStartTime("00:00:00");
            video.setVideoDuration("00:01:00");
            console.log(video.metadata);
            // FFmpeg configuration
            //console.log(video.info_configuration);
            video.save(videoPath + fileName, function(error, file) {
              if (!error) console.log("Video file: " + file);
       
            });
          },
          function(err) {
            console.log("Error: " + err);
          }
        );
      } catch (e) {
        console.log(e.code);
        console.log(e.msg);
      }

      const post = await Post.create({
        video: fileName,
        title: request.body.title,
      
        thumb: thumbName
      });
      reply.code(201).send(post);
    }
  });