Recherche avancée

Médias (2)

Mot : - Tags -/rotation

Autres articles (105)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

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

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (13929)

  • How to create a fixed image video with ffmpeg that avoids pixelization when it's not maximized ?

    11 août 2022, par Nelson Teixeira

    I have a waiting video in the project I develop. This video is a fixed waiting image with music. I was asked to change the image in the video due to deprecated logo.

    


    So initially I tried just to replace the image in the video using this command :

    


    ffmpeg -i old_waiting_video.mp4 -i new_image.png -filter_complex "[1][0]scale2ref[i][v];[v][i]overlay" -c:a copy new_waiting_video.mp4


    


    This lead to the image became pixelated when the video isn't maximized. When maximized the image is OK. But it looks terrible in the small player.

    


    Here is an image of the problem :

    


    enter image description here

    


    The above image is the image without zoom out. The left bottom image is a screen capture when I resize it in an image tool and the right bottom is a screen capture of how it looks like in the player.
The image has more than this text, but I thought that wouldn't be appropriate to display my company's logo here. The logo itself is even more pixelized and looks terrible.

    


    So to try to solve this problem I extracted the audio from the file and try to add the image and the audio together to see if it removed the pixelization. So I used this command :

    


    ffmpeg -i audio.m4a -i new_image.png new_waiting_video.mp4


    


    When it failed, searching a bit I came across this other command :

    


    ffmpeg -loop 1 -i new_image.png -i audio.m4a -c:v libx264 -tune stillimage -c:a copy -pix_fmt yuv420p -shortest new_waiting_video.mp4


    


    Again the pixelization ocurred. I know it's possible because this problem doesn't occur in the old logo.

    


    What would be the correct command that allowed that the zoomed out image in the player doesn't pixelate ?

    


    Edit 1

    


    I would also be interested in a command that substitutes the image on the old video as long it doesn't pixelate in the non-maximized player.

    


    Edit 2

    


      

    • Video resolution : 1920x1080
    • 


    • New image resolution : 1920x1080
    • 


    • Non-maximized video player size : 640x360
    • 


    • Video tag : <video src="my-video-url.mp4" style="width: 640px;"></video>
    • &#xA;

    &#xA;

  • Reading a stream of images from rtsp using ffmpeg

    15 février 2015, par Andrew Simpson

    I had been using a wrapper around VLC to stream images from my ip camera to my WinForm Desktop App using the RTSP protocol.

    This works well.

    However, I wanted to see if could achieve the same thing using just FFMPEG.

    I have done so but the results are poor.

    The FPS is slow.

    This is my code :

       private Process process = new Process();
       private FileStream baseStream = null;
       string file = @"C:\bin\ffmpeg.exe";
       string arguments = @" -i rtsp://admin:admin@192.168.0.8:554/video_1 -an -f image2 -s 360x240 -vframes 1 -";

       private void button1_Click(object sender, EventArgs e)
       {
           try
           {
               process.StartInfo.FileName = file;
               process.StartInfo.Arguments = arguments;
               process.StartInfo.CreateNoWindow = true;
               process.StartInfo.RedirectStandardError = true;
               process.StartInfo.RedirectStandardOutput = true;
               process.StartInfo.UseShellExecute = false;

               Task.Run(() => { Feeder(); });
           }
           catch (Exception ex)
           {
               //log error here
           }
       }

       private void Feeder()
       {
           try
           {
               process.Start();
               baseStream = process.StandardOutput.BaseStream as FileStream;
               int lastRead = 0;
               using (MemoryStream ms = new MemoryStream())
               {
                   byte[] buffer = new byte[500];
                   do
                   {
                       lastRead = baseStream.Read(buffer, 0, buffer.Length);
                       ms.Write(buffer, 0, lastRead);
                   } while (lastRead > 0);

                   pictureBox1.Invoke(new Action(() => pictureBox1.Image = Image.FromStream(ms)));
                   ms.Close();
               }
           }
           catch (Exception ex)
           {
               //log error here
           }
           Task.Run(() => { Feeder(); });
       }

    Now I had considered streaming a constant flow of images rather than just taking 1 at a time.
    I can easily identify markers for the JPEG header.

    But, I would have to use

    baseStream.ReadByte

    instead which without trying it would be slow as I would have look at every single byte ?

    Can anyone suggest what I should do ?

    Thanks

  • multipart/x-mixed-replace - MJPG video stream does not close in

    18 janvier 2024, par karlcess

    I'm using Node.js and React.&#xA;In React I have a simple component that is displayed on the screen when a button is clicked. The component is as follows :

    &#xA;

    import React from &#x27;react&#x27;&#xA;&#xA;const Image = () => {&#xA;  return <img src="http://stackoverflow.com/api/mjpgStream/stream01" style='max-width: 300px; max-height: 300px' />;&#xA;}&#xA;&#xA;

    &#xA;

    Webpack redirects my requests (api=localhost:3456/mjpgStream/stream0).&#xA;In node I created an express server that when receiving the GET continuously sends JPEG images with multipart/x-mixed-replace. Below is the code :

    &#xA;

    const cb: RequestHandler = (req, res) => {&#xA;  const url = req.url.toString().slice(1);&#xA;  res.writeHead(200, {&#xA;    "Content-Type": "multipart/x-mixed-replace;boundary=&#x27;stream&#x27;",&#xA;    Connection: "keep-alive",&#xA;    Expires: "Fri, 27 May 1977 00:00:00 GMT",&#xA;    "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate",&#xA;    Pragma: "no-cache",&#xA;  });&#xA;  let sub = PubSub.subscribe(url, function (msg: any, data: any) {&#xA;    res.write("--stream\r\n");&#xA;    res.write("Content-Type: image/jpeg\r\n");&#xA;    res.write("Content-Length: " &#x2B; data.length &#x2B; "\r\n");&#xA;    res.write("\r\n");&#xA;    res.write(data, "binary");&#xA;    res.write("\r\n");&#xA;  });&#xA;&#xA;  req.on("close", () => {&#xA;    PubSub.unsubscribe(sub);&#xA;    res.end();&#xA;  });&#xA;&#xA;  res.on("error", function (err) {&#xA;    console.error("Error in response:", err);&#xA;  });&#xA;};&#xA;&#xA;router.get(/\/[a-z,0-9]*/, cb);&#xA;

    &#xA;

    The video stream is published in the topic with PubSub and is correctly displayed in the Image component.&#xA;The problem is that when I click the button to close the Image component from the web page, the close event is not captured on the express server side and the mjpg flow continues to exist. I can't understand why.

    &#xA;