Recherche avancée

Médias (1)

Mot : - Tags -/publicité

Autres articles (53)

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

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

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

  • hardware conversion of image pixel format in ffmpeg ?

    18 janvier 2024, par dongrixinyu

    I am trying to decode an online rtmp video stream into RGB format frames, and then encoding RGB frames into an online stream.

    


    Task

    


    Here is what I do now :

    


    


    decoding a video stream to get images(RGB) ---> ai model process ---> encoding frames(RGB) to form a video stream in H264

    


    


    My scheme

    


    All my code in written in C with FFmpeg dependencies. The detailed steps are :

    


    


    rtmp/rtsp video stream ---> AVPacket ---(nvidia cuda)---> AVFrame(nv12 pix fmt) ---> AVFrame(RGB pix fmt) ---> AI process.

    


    


    


    AVFrame(RGB pix fmt) ---> AVFrame(nv12 pix fmt) ---(nvidia cuda)---> AVPacket ---> rtmp/rtsp video stream

    


    


    Now, the decoding and encoding part are run on NVIDIA GPU, which is quite fast.

    


    But the conversion of pixel format between AV_PIX_FMT_NV12 and AV_PIX_FMT_RGB is run on CPU, which is astonishingly CPU-consuming cause the size of video frame is 2k.

    


    My question

    


    So, is there any off-the-shelf method to fulfill the conversion of image pixel format on GPU (especially via cuda) directly ?

    


  • Generating Video from Downloaded Images Using Fluent-FFmpeg : Issue with Multiple Image Inputs

    11 août 2023, par Pratham Bhagat

    I am having trouble creating Video from multiple images using fluent-ffmpeg in node.js.

    


    Here, I am getting the images from rquest body and downloading them in **temp **directory

    


       const imageUrls = req.body.imageUrls;
   const timeInBetween = parseFloat(req.query.time_in_between) || 1.0;

const tempDir = path.join(
      context.executionContext.functionDirectory,
      "temp"
    );

const downloadedImages = await Promise.all(
      imageUrls.map(async (imageUrl, index) => {
        try {
          const response = await axios.get(imageUrl, {
            responseType: "arraybuffer",
          });
          const imageName = `image_${index + 1}.png`;
          const imagePath = path.join(tempDir, imageName);
          await fs.writeFile(imagePath, response.data);
          return imagePath;
        } catch (error) {
          context.log(`Error downloading ${imageUrl}: ${error.message}`);
          return null;
        }
      })
    );


    


    I want to combine these images that are in downloadedImages array and create a video

    


    const outputVideoPath = path.join(tempDir, "output.mp4");

    let ffmpegCommand = ffmpeg();

    for (let i = 0; i < downloadedImages.length; i++) {
      context.log(downloadedImages.length);
      ffmpegCommand
        .input(downloadedImages[i])

        .inputOptions(["-framerate", `1/${timeInBetween}`])
        .inputFormat("image2")
        .videoCodec("libx264")
        .outputOptions(["-pix_fmt", "yuv420p"]);
    }

    ffmpegCommand
      .output(outputVideoPath)
      .on("end", () => {
        context.log("Video generation successful.");
        context.res = {
          status: 200,
          body: "Video generation and cleanup successful.",
        };
      })
      .on("error", (err) => {
        context.log.error("Error generating video:", err.message);
        context.res = {
          status: 500,
          body: "Error generating video: " + err.message,
        };
      })
      .run();


    


    By running it and giving value of "time_in_between" as 2 I get video of 2 seconds with a single image.

    


      

    • Utilized Fluent-FFmpeg library to generate a video from a list of downloaded images.
    • 


    • Expected the video to include all images, each displayed for a specified duration.
    • 


    • Tried mapping through the image paths and using chained inputs for each image.
    • 


    • Expected the video to have a sequence of images displayed.
    • 


    • Observed that the generated video only contained the first image and was of 0 seconds duration.
    • 


    


  • Inserting an image inside a video every few frames using ffmpeg

    31 juillet 2023, par Erez Hochman

    Can I use FFMPEG to insert an image every 20 frames in a video ? 
I'm trying to create a subliminal message experiment and I thought it would be an easy way to make it but I can't find anything online.

    



    I tried to make something myself and created a script that :
    
1.splits a file into audio and video files
    
2.splits the video into frames
    
3.overwrites every 20th image in the sequence with the message image
    
4.re-encoding the video
    
5.concatenating it with the original audio

    



    this works but it's way more disk space consuming to be comfortable, is there a better way to do this ?
    
any advice or thought would be happily welcome.