Recherche avancée

Médias (0)

Mot : - Tags -/signalement

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (105)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (8929)

  • Revision 32858 : on vire ce .foucs() qui "force le scroll" vers l’input du formulaire au ...

    12 novembre 2009, par brunobergot@… — Log

    on vire ce .foucs() qui "force le scroll" vers l’input du formulaire au chargement de la page

  • Sequelize FFMPEG get video after upload on NodeJs

    30 juin 2020, par jjplack

    Hello After upload a video to db using sequelize, i would like to edit it using FFMPEG

    


    So to get the video is just point the model attribute to FFMPEG ?

    


    Because using the file path is not editing the video.

    


    For exemple :

    


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

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

      const videoPath = "./public/uploads/";

 

     

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


 

try {
   const process = new ffmpeg(post.video);
  process.then(function (video) {
    video.addCommand('-ss', '00:01:00')
    video.addCommand('-vframes', '1')
    video.save(videoPath, function (error, file) {
        if (!error)
          console.log('Video file: ' + file);
      });
  }, function (err) {
    console.log('Error: ' + err);
  });
} catch (e) {

  console.log(e.msg);

}
      
    }
  });


    


  • Fluent-ffmpeg and Multer Cut video lenght on Upload

    29 juin 2020, par jjplack

    After setup a simple upload file with Multer, I would like to cut the length and take a screenshot of the video after upload it.

    


    The upload works fine but the FFMPEG did cut the video length.

    


    First I follow the doc added the cut on setStartTime and setDuration.

    


      .setStartTime("00:00:00") 
  .setDuration("00:01:00")


    


    The video still uploaded with full length and then I tried the addInputOption and outputOptions

    


    .addInputOption("-ss 00:00:00 -t 00:01:00")
        .outputOptions([
          "-ss 00:00:00 -t 00:01:00",
        "-c:v libx264",
        "-r 30",
        "-pix_fmt yuv420p"
        ])


    


    The video still uploading with full lenght.

    


    So someone can help ?

    


    Here is the Code

    


      fastify.route({
    method: "POST",
    url: "/posts",
    //userCreateOpts,
    // schema: {
    // body: {
    // type: "object",

    // properties: {
    //video: { type: "string" },
    // title: { type: "string" }
    //}
    //}
    //},
    preValidation: [fastify.retrieveToken, fastify.retrieveUser],
    preHandler: upload.single("video"),

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

      const user = await User.findByPk(request.user.id);

      //const fileInfo = path.parse(request.file.filename);
      const videoPath = "./public/uploads/";

      var params = {
        input: request.file.path,
        start: 0,
        duration: 1,
        output: videoPath
      };

      const proc = new ffmpeg();

      proc
        .addInput(request.file.path)

        .setStartTime("00:00:00") 
        .setDuration("00:01:00")
        //.duration("00:01.00")
        .on("start", function(ffmpegCommand) {
          /// log something maybe
        })
        .on("progress", function(data) {
          /// do stuff with progress data if you want
        })
        .on("end", function() {
          /// encoding is complete, so callback or move on at this point
        })
        .on("error", function(error) {
          /// error handling
        })
        //.addInputOption("-ss 00:00:00 -t 00:01:00")
        //.outputOptions([
        //  "-ss 00:00:00 -t 00:01:00",
        //"-c:v libx264",
        //"-r 30",
        //"-pix_fmt yuv420p"
        //])
        .output(videoPath)
        .run();

      const post = await Post.create({
        video: request.file.path,
        title: request.body.title,
        userId: user.id
    
      });
      reply.code(201).send(post);
    }
  });

  done();
};