Recherche avancée

Médias (91)

Autres articles (106)

  • 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

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Qu’est ce qu’un masque de formulaire

    13 juin 2013, par

    Un masque de formulaire consiste en la personnalisation du formulaire de mise en ligne des médias, rubriques, actualités, éditoriaux et liens vers des sites.
    Chaque formulaire de publication d’objet peut donc être personnalisé.
    Pour accéder à la personnalisation des champs de formulaires, il est nécessaire d’aller dans l’administration de votre MediaSPIP puis de sélectionner "Configuration des masques de formulaires".
    Sélectionnez ensuite le formulaire à modifier en cliquant sur sont type d’objet. (...)

Sur d’autres sites (11869)

  • Problem trimming / excerpting MP4 with FFmpeg

    18 novembre 2022, par Spencer Graves

    The video is black in the first almost 2 seconds of an MP4 file created by "ffmpeg -i Sorrell2022-11-16.mp4 -ss 2:46 -to 41:49 -c:v copy Sorrell2022-11-17a.mp4". "input.mp4" [Sorrell2022-11-16.mp4] and "output.mp4" [Sorrell2022-11-17a.mp4] are available in :

    


    https://drive.google.com/drive/folders/1vSRODTQ04XKNr1iDF6bOYwmcuTHxnKGa?usp=sharing

    


      

    1. How can I get ffmpeg to properly perform this trim / excerpt task — without substituting black for the images in the first not quite 2 seconds ?

      


    2. 


    3. What should I do to upgrade ffmpeg to the latest ? My primary computer is running macOS Big Sur 11.7.1. "brew update && brew upgrade ffmpeg" didn't work for me. I've run "brew update" separately, getting now, "Already up-to-date." "brew upgrade ffmpeg" says, "Error : ffmpeg not installed". It's clear that ffmpeg is installed and working, but brew cannot find it. I saw advice to uninstall ffmpeg and reinstall it from scratch. However, I'm reluctant to do that, because I sometimes use "ffmpeg -i input.mp4 -c:v libvpx-vp9 -b:v 2M -pass 1 -an -f null /dev/null" followed by "ffmpeg -i input.mp4 -c:v libvpx-vp9 -b:v 2M -pass 2 -c:a libopus output.webm", and this did NOT work on my Mac until the last time I reformatted my hard drive and reinstalled everything. Maybe I should not worry about this.

      


    4. 


    


    Suggestions ? Thanks, Spencer Graves

    


  • Why i'm getting strange video file when using ffmpeg and pipes to create video file in real time ?

    30 juin 2015, par Brubaker Haim

    The goal here is to create a compressed mp4 video file in real time.
    I’m saving screenshots as bitmaps type on my hard disk.
    And i want to create mp4 file and compress the mp4 video file in real time.

    The problem is the end the video file i get looks very strange.
    This is the result : Strange Video File

    The class that i’m using the ffmpeg with arguments.

    using System;
    using System.Windows.Forms;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Drawing;
    using System.IO.Pipes;
    using System.Runtime.InteropServices;
    using System.Diagnostics;
    using System.IO;
    using DannyGeneral;

    namespace Youtube_Manager
    {
       class Ffmpeg
       {
           NamedPipeServerStream p;
           String pipename = "mytestpipe";
           System.Diagnostics.Process process;
           string ffmpegFileName = "ffmpeg.exe";
           string workingDirectory;

           public Ffmpeg()
           {
               workingDirectory = Path.GetDirectoryName(Application.ExecutablePath);
               Logger.Write("workingDirectory: " + workingDirectory);
               if (!Directory.Exists(workingDirectory))
               {
                   Directory.CreateDirectory(workingDirectory);
               }
               ffmpegFileName = Path.Combine(workingDirectory, ffmpegFileName);
               Logger.Write("FfmpegFilename: " + ffmpegFileName);
           }

           public void Start(string pathFileName, int BitmapRate)
           {
               try
               {

                   string outPath = pathFileName;
                   p = new NamedPipeServerStream(pipename, PipeDirection.Out, 1, PipeTransmissionMode.Byte);

                   ProcessStartInfo psi = new ProcessStartInfo();
                   psi.WindowStyle = ProcessWindowStyle.Hidden;
                   psi.UseShellExecute = false;
                   psi.CreateNoWindow = false;
                   psi.FileName = ffmpegFileName;
                   psi.WorkingDirectory = workingDirectory;
                   psi.Arguments = @"-f rawvideo -pix_fmt yuv420p -video_size 1920x1080 -i \\.\pipe\mytestpipe -map 0 -c:v mpeg4 -r " + BitmapRate + " " + outPath;
                   //psi.Arguments = @"-framerate 1/5 -i -c:v libx264 -r 30 -pix_fmt yuv420p \\.\pipe\mytestpipe -map 0 -c:v mpeg4 -r" + BitmapRate + " " + outPath;
                   process = Process.Start(psi);
                   process.EnableRaisingEvents = false;
                   psi.RedirectStandardError = true;
                   p.WaitForConnection();
               }
               catch (Exception err)
               {
                   Logger.Write("Exception Error: " + err.ToString());
               }
           }

           public void PushFrame(Bitmap bmp)
           {
               try
               {
                   int length;
                   // Lock the bitmap's bits.
                   //bmp = new Bitmap(1920, 1080);
                   Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
                   //Rectangle rect = new Rectangle(0, 0, 1280, 720);
                   System.Drawing.Imaging.BitmapData bmpData =
                       bmp.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadOnly,
                       bmp.PixelFormat);

                   int absStride = Math.Abs(bmpData.Stride);
                   // Get the address of the first line.
                   IntPtr ptr = bmpData.Scan0;

                   // Declare an array to hold the bytes of the bitmap.
                   //length = 3 * bmp.Width * bmp.Height;
                   length = absStride * bmpData.Height;
                   byte[] rgbValues = new byte[length];

                   //Marshal.Copy(ptr, rgbValues, 0, length);
                   int j = bmp.Height - 1;
                   for (int i = 0; i < bmp.Height; i++)
                   {
                       IntPtr pointer = new IntPtr(bmpData.Scan0.ToInt32() + (bmpData.Stride * j));
                       System.Runtime.InteropServices.Marshal.Copy(pointer, rgbValues, absStride * (bmp.Height - i - 1), absStride);
                       j--;
                   }
                   p.Write(rgbValues, 0, length);
                   bmp.UnlockBits(bmpData);
               }
               catch(Exception err)
               {
                   Logger.Write("Error: " + err.ToString());
               }

           }

           public void Close()
           {
               p.Close();
           }
       }
    }

    Then i’m using the method PushFrame here in this class :

    public Bitmap GetScreenShot(string folder, string name)
       {
           _screenShot = new Bitmap(GetScreen());
           System.GC.Collect();
           System.GC.WaitForPendingFinalizers();
           string ingName = folder + name +  images.counter.ToString("D6") + ".bmp";
           _screenShot.Save(ingName,System.Drawing.Imaging.ImageFormat.Bmp);
           fmpeg.PushFrame(_screenShot);
           _screenShot.Dispose();

           return _screenShot;
       }

    The Bitmaps on the hard disk are fine i can edit/open see them.
    When using command prompt and manually type ffmpeg command it does compress and create a mp4 video file.

    But when using the Ffmpeg class i did with the PushFrame method it’s creating this strange video file.

    This is a link for my OneDrive with 10 screenshots images files for testing :

    screenshots rar

    Sample screenshot from the video file when playing the video file :
    Looks very choppy. The Bitmaps on the hard disk each one is 1920x1080 and Bit depth 32

    But it dosen’t look like that in the video file :

    choppy image

    This is the arguments i’m using :

    psi.Arguments = @"-f rawvideo -vcodec rawvideo -pix_fmt rgb24 -video_size 1920x1080 -i \\.\pipe\mytestpipe -map 0 -c:v mpeg4 -r " + BitmapRate + " " + outPath;

    The video size is very small 1.24 MB

  • lavu/video_enc_params : Avoid relying on an undefined C construct

    15 janvier 2023, par Martin Storsjö
    lavu/video_enc_params : Avoid relying on an undefined C construct
    

    The construct of using offsetof on a (potentially anonymous) struct
    defined within the offsetof expression, while supported by all
    current compilers, has been declared explicitly undefined by the
    C standards committee [1].

    Clang recently got a change to identify this as an issue [2] ;
    initially it was treated as a hard error, but it was soon after
    softened into a warning under the -Wgnu-offsetof-extensions option
    (not enabled automatically as part of -Wall though).

    Nevertheless - in this particular case, it's trivial to fix the
    code not to rely on the construct that the standards committee has
    explicitly called out as undefined.

    [1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2350.htm
    [2] https://reviews.llvm.org/D133574

    Signed-off-by : Martin Storsjö <martin@martin.st>

    • [DH] libavutil/video_enc_params.c