Recherche avancée

Médias (91)

Autres articles (83)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

Sur d’autres sites (7753)

  • fluent-ffmpeg Output stream closed, when using aws s3

    30 décembre 2022, par Eivydas Vickus

    Can someone help, when I run this code I am getting Output stream closed Erorr from fluent-ffmpeg. How you can see I am passing stream directly to aws s3 and that what is causing a problem I think. If I just usefs.createWriteStream('output.webm') in the pipe, then it work flawlessly, but I want to directly pass stream to aws s3

    


       const passthroughs = new PassThrough();
        const data = videoOptions[3];
        ffmpeg(fs.createReadStream(pathToFile))
          .format('webm')
          .outputOptions([
            `-vf scale=${data.scale}`,
            `-b:v ${data.avgBitRate}`,
            `-minrate ${data.minBitRate}`,
            `-maxrate ${data.maxBitRate}`,
            `-tile-columns ${data.tileColumns}`,
            `-g ${data.g}`,
            `-threads ${data.threads}`,
            `-quality ${data.quality}`,
            `-crf ${data.crf}`,
            `-c:v ${data.videoCodec}`,
            `-c:a ${data.audioCodec}`,
            `-speed ${data.speed}`,
            `-y`,
          ])
          .pipe(passthroughs)
          .on('error', (err) => {
            console.log(err);
          })
          .on('data', (data) => {
            console.log({ data });
          })
          .on('progress', (progress) => {
            console.log(progress);
          })
          .on('end', async () => {
            console.log('Video conversion complete');
          });

        const upload = new Upload({
          client: this.s3BucketService.client,
          params: {
            Bucket: 'youtube-nest',
            Key: 'test.webm',
            Body: passthroughs,
          },
        });

        await upload.done();


    


  • Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_split_0

    26 mars 2023, par VenoM

    So I'm using ytdl-core & ffmpeg to convert some videos from YouTube to MP4 and then manipulate them in a way or take screenshots. But the issue I'm facing is - some videos are downloaded and are completely playable, but others are corrupt.

    


    This is the error I get when I try to take screenshot of the corrupted video :

    


    


    Error : ffmpeg exited with code 1 : Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_split_0

    


    


    And obviously, error is there because the video is corrupted, but WHY is that the case ?

    


    Here's my code (read TL ;DR below) :

    


      router.post("/screenshot", async (req, res) => {
  const urlToScreenshot = req.body.url;
  const timestamp = parseInt(req.body.t, 10);
  const YouTubeURL = `https://youtube.com/watch?v=${urlToScreenshot}`;
  const filename = uuidv4();

  const videoPath = `${filePath}/${filename}.mp4`;

  const downloadStartTime = timestamp - 3;
  const downloadEndTime = timestamp + 3;

  const videoStream = ytdl(YouTubeURL, {
    quality: "highest",
  });

  const ffmpegCommand = ffmpeg(videoStream)
    .setStartTime(downloadStartTime)
    .duration(downloadEndTime - downloadStartTime)
    .outputOptions("-c:v", "libx264")
    .outputOptions("-c:a", "copy")
    .outputOptions("-b:v", "10M")
    .outputOptions("-filter:v", "scale=1920:1080")
    .outputOptions("-q:v", "1")
    .outputOptions("-reconnect", "1") // enable reconnection attempts
    .outputOptions("-ignore_io_errors", "1") // ignore input/output errors
    .on("end", async () => {
      console.log("Video downloaded successfully: " + videoPath);

      const screenshotPath = `${filePath}/${filename}.png`;
      ffmpeg(videoPath)
        .screenshots({
          count: 1,
          timemarks: ["1"],
          folder: filePath,
          filename: `${filename}.png`,
        })
        .on("end", async () => {
          console.log(`Screenshot saved successfully: ${screenshotPath}`);
          try {
            const cloudinaryResult = await cloudinary.uploader.upload(
              screenshotPath
            );
            const screenshotUrl = cloudinaryResult.secure_url;
            console.log(`Screenshot uploaded to Cloudinary: ${screenshotUrl}`);
            // await unlink(videoPath);
            console.log(`Video file deleted: ${videoPath}`);
            // await unlink(screenshotPath);
            console.log(`Screenshot file deleted: ${screenshotPath}`);
            res.status(200).json({ screenshotUrl });
          } catch (err) {
            console.error(
              "An error occurred while uploading the screenshot to Cloudinary:",
              err
            );
            // await unlink(videoPath);
            // await unlink(screenshotPath);
            res.status(500).send("Internal Server Error");
          }
        })
        .on("error", async (err) => {
          console.error("An error occurred while taking the screenshot:", err);
          // await unlink(videoPath);
          // await unlink(screenshotPath);
          res.status(500).send("Internal Server Error");
        });
    })
    .on("error", async (err) => {
      console.error("An error occurred while downloading the video:", err);
      await unlink(videoPath); // delete the file on error
      res.status(500).send("Internal Server Error");
    })
    .save(videoPath);

  // console.log(ffmpegCommand);
});


    


    Code Summary : Basically I'm passing the videoID and timestamp (because I want to download a certain section of the video, not the whole video), it downloads the video, then takes a screenshot of the video at a certain timestamp (i.e 1st second) and sends the screenshot to Cloudinary (a cloud file storage).

    


    This works fine for 50% of the videos I've tried, but doesn't for other videos.

    


    Here's a picture of a corrupt video and a working video.

    


    enter image description here

    


    Working Video

    


    Corrupt Video

    


    Some help would be greatly appreciated !

    


  • How to convert jquery animation to movie or gif format ?

    19 avril 2019, par Barış Demirdelen

    How to convert jquery animation to movie or gif format ?
    Animation and screenshot functions call or too slow.
    Help me please

    Animation Function

    function resim1(){
       $("#resim-1").animate({ left: leftx}, startEffectTime1);
       ......
    }

    ScreenShot Function but too slow

    function shot(){
             html2canvas($("#main"), {
                 onrendered: function(canvas) {
                     theCanvas = canvas;
                     document.body.appendChild(canvas);
                     Canvas2Image.saveAsPNG(canvas);
                     $("#img-out").append(canvas);
                 }
             });
    }

    Call animation and screenshot functions

    $(document).ready(function() {
        resim1(); // Animate start
        setInterval(function(){ // Screenshot start
             shot();
        },500);

    });

    Bottom function call animation breaking :/

    $(document).ready(function() {
        resim1(); // Animate start
        setInterval(function(){ // Screenshot start
             shot();
        },500);

    });