Recherche avancée

Médias (1)

Mot : - Tags -/bug

Autres articles (44)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (7722)

  • Recording application output to video using FFmpeg (or similar)

    15 décembre 2011, par John

    We have a requirement to lets users record a video of our 3D application. I can already grab the individual rendered frames so this question is specifically about how to write frames into a video file.

    I don't think writing each frame as a separate file and post-processing is a workable option.

    I can look at options to record to a simple video file for later optimising/encoding, or writing directly to a sensibly encoded format.

    FFmpeg was suggested in another post but it looks a bit daunting to me. Is it the best option, if not what can be suggested ? We can work with LGPL but not full GPL.

    We're working on Windows (Win32 not MFC) in C++. Sample/pseudo code with your recommended library is very much appreciated... basically after how to do 3 functions :

    • startRecording() does whatever initialization is needed
    • recordFrame() takes pointer to frame data and encodes it, ideally with timing data
    • endRecording() finalizes the video file, shuts down video system, etc
  • Getting log line for each extracted frame from FFMPEG

    3 février 2016, par wpfwannabe

    I am using FFMPEG.exe to extract frames from various videos. As this is a programmatic solution and getting the total frame count and/or duration can prove tricky (with ffprobe), I am thinking I could use the console output to detect individual frames’ timestamps but I am getting a single output line every N frames like this :

    frame=   20 fps=0.0 q=0.0 size=       0kB time=00:00:01.72 bitrate=   0.0kbits/s
    frame=   40 fps= 38 q=0.0 size=       0kB time=00:00:04.02 bitrate=   0.0kbits/s
    frame=   60 fps= 39 q=0.0 size=       0kB time=00:00:06.14 bitrate=   0.0kbits/s
    frame=   70 fps= 38 q=0.0 Lsize=       0kB time=00:00:07.86 bitrate=   0.0kbits/s

    Is there a command line option to force output for each and every frame ? If so, I could extract the time= portion. This is the command line currently used :

    ffmpeg.exe -i video.avi -y -threads 0 -vsync 2 %10d.jpeg

    Ideally, replacing %10d.jpeg with some other format that writes frame’s timestamp but I don’t think this exists.

  • C# get dominant color in an image

    22 janvier 2017, par CK13

    I’m building a program that makes screenshots from a video.
    It extracts frames from the video (with ffmpeg) and then combines them into one file.

    All works fine, except sometimes I get (almost) black images, mostly in the beginning and ending of the video.

    A possible solution I can think of is to detect if the extracted frame is dark. If it is dark, extract another frame from a slightly different time.

    How can I detect if the extracted frame is dark/black ? Or is there another way I can solve this ?

    private void getScreenshots_Click(object sender, EventArgs e)
    {
       int index = 0;
       foreach (string value in this.filesList.Items)
       {
           string file = selectedFiles[index] + "\\" + value;

           // ------------------------------------------------
           //   MediaInfo
           // ------------------------------------------------
           // https://github.com/Nicholi/MediaInfoDotNet
           //
           // get file width, height, and frame count
           //
           // get aspect ratio of the video
           // and calculate height of thumbnail
           // using width and aspect ratio
           //
           MediaInfo MI = new MediaInfo();
           MI.Open(file);
           var width = MI.Get(StreamKind.Video, 0, "Width");
           var height = MI.Get(StreamKind.Video, 0, "Height");
           decimal d = Decimal.Parse(MI.Get(StreamKind.Video, 0, "Duration"));
           decimal frameCount = Decimal.Parse(MI.Get(StreamKind.Video, 0, "FrameCount"));
           MI.Close();
           decimal ratio = Decimal.Divide(Decimal.Parse(width), Decimal.Parse(height));
           int newHeight = Decimal.ToInt32(Decimal.Divide(newWidth, ratio));
           decimal startTime = Decimal.Divide(d, totalImages);
           //totalImages - number of thumbnails the final image will have
           for (int x = 0; x < totalImages; x++)
           {
               // increase the time where the thumbnail is taken on each iteration
               decimal newTime = Decimal.Multiply(startTime, x);
               string time = TimeSpan.FromMilliseconds(double.Parse(newTime.ToString())).ToString(@"hh\:mm\:ss");

               string outputFile = this.tmpPath + "img-" + index + x + ".jpg";

               // create individual thumbnails with ffmpeg
               proc = new Process();
               proc.StartInfo.FileName = "ffmpeg.exe";
               proc.StartInfo.Arguments = "-y -seek_timestamp 1 -ss " + time + " -i \"" + file + "\" -frames:v 1 -qscale:v 3 \"" + outputFile + "\"";
               proc.Start();
               proc.WaitForExit();
           }

           // set width and height of final image
           int w = (this.cols * newWidth) + (this.spacing * this.cols + this.spacing);
           int h = (this.rows * newHeight) + (this.spacing * this.rows + this.spacing);

           int left, top, i = 0;
           // combine individual thumbnails into one image
           using (Bitmap bmp = new Bitmap(w, h))
           {
               using (Graphics g = Graphics.FromImage(bmp))
               {
                   g.Clear(this.backgroundColor);
                   // this.rows - number of rows
                   for (int y = 0; y < this.rows; y++)
                   {
                       // put images on a column
                       // this.cols - number of columns
                       // when x = number of columns go to next row
                       for (int x = 0; x < this.cols; x++)
                       {
                           Image imgFromFile = Image.FromFile(this.tmpPath + "img-" + index + i + ".jpg");
                           MemoryStream imgFromStream = new MemoryStream();
                           imgFromFile.Save(imgFromStream, imgFromFile.RawFormat);
                           imgFromFile.Dispose();

                           left = (x * newWidth) + ((x + 1) * this.spacing);
                           top = (this.spacing * (y + 1)) + (newHeight * y);
                           g.DrawImage(Image.FromStream(imgFromStream), left, top, newWidth, newHeight);
                           i++;
                       }
                   }
               }

               // save the final image
               bmp.Save(selectedFiles[index] + "\\" + value + ".jpg");
           }
           index++;
       }
    }