Recherche avancée

Médias (1)

Mot : - Tags -/framasoft

Autres articles (75)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

Sur d’autres sites (9245)

  • Record video with Accord.net (AForge)

    17 mai 2017, par ghasem deh

    I used Accord.net (AForge) for connect to the webcam and record video
    But stored videos is slow motion ...
    this my project :

       using AForge.Video;
    using AForge.Video.DirectShow;
    using AForge.Video.FFMPEG;
    using System;
    using System.Drawing;
    using System.IO;
    using System.Threading;
    using System.Windows.Forms;

    namespace CaptureWebcam
    {
       public partial class Form1 : Form
       {
           private VideoCaptureDeviceForm captureDevice;
           private string path = Path.GetDirectoryName(Application.ExecutablePath) + @"\Videos\";
           private FilterInfoCollection videoDevice;
           private VideoCaptureDevice videoSource;
           private VideoFileWriter FileWriter = new VideoFileWriter();
           private Bitmap video;
           bool isRecord = false;

           public Form1()
           {
               InitializeComponent();
           }

           private void videoSource_NewFrame(object sender, NewFrameEventArgs eventArgs)
           {
               video = (Bitmap)eventArgs.Frame.Clone();
               pictureBox1.Image = (Bitmap)eventArgs.Frame.Clone();
           }

           private void btnStartCam_Click(object sender, EventArgs e)
           {
               videoDevice = new FilterInfoCollection(FilterCategory.VideoInputDevice);
               captureDevice = new VideoCaptureDeviceForm();
               if (captureDevice.ShowDialog(this) == DialogResult.OK)
               {
                   videoSource = captureDevice.VideoDevice;
                   videoSource = captureDevice.VideoDevice;
                   videoSource.NewFrame += new NewFrameEventHandler(videoSource_NewFrame);
                   videoSource.Start();
                   timer1.Enabled = true;
               }
               //videoSource.DisplayPropertyPage(IntPtr.Zero);
           }

           private Thread workerThread = null;
           private bool stopProcess = false;

           private void recordLiveCam()
           {
               if (!stopProcess)
               {
                   while (isRecord)
                   {
                       FileWriter.WriteVideoFrame(video);
                   }
                   FileWriter.Close();
               }
               else
               {
                   workerThread.Abort();
               }            
           }

           private void btnRecord_Click(object sender, EventArgs e)
           {
               //try
               //{
               isRecord = true;
               if (!Directory.Exists(path))
               {
                   Directory.CreateDirectory(path);
               }
               int h = captureDevice.VideoDevice.VideoResolution.FrameSize.Height;
               int w = captureDevice.VideoDevice.VideoResolution.FrameSize.Width;
               FileWriter.Open(path + "recorded at " + DateTime.Now.ToString("HH-mm-ss") + ".mp4", w, h, 25, VideoCodec.MPEG4);
               stopProcess = false;
               workerThread = new Thread(new ThreadStart(recordLiveCam));
               workerThread.Start();

               //}
               //catch (Exception ex)
               //{
               //    MessageBox.Show(ex.Message);
               //}
           }

           private void Form1_Load(object sender, EventArgs e)
           {

           }

           private void btnStopRecord_Click(object sender, EventArgs e)
           {
               stopProcess = true;
               isRecord = false;
               FileWriter.Close();
               workerThread.Abort();
               video = null;

           }

           private void btnStopCam_Click(object sender, EventArgs e)
           {
               try
               {
                   if (videoSource.IsRunning)
                   {
                       videoSource.SignalToStop();
                       videoSource.Stop();                  
                       pictureBox1.Image = null;
                       pictureBox1.Invalidate();
                       if (FileWriter.IsOpen)
                       {
                           FileWriter.Close();
                           video = null;
                       }
                   }
                   else
                       return;
               }
               catch
               {
                   videoSource.Stop();
                   FileWriter.Close();
                   video = null;
               }
           }

           float fts = 0.0f;
           private void timer1_Tick(object sender, EventArgs e)
           {
               fts = videoSource.FramesReceived;
               label1.Text = "Frame Rate : " + fts.ToString("F2") + " fps";
           }
       }
    }

    And when click the btnStopRecord following error :

    Additional information : Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

  • pictureBox image dispose exception

    22 octobre 2016, par Dulcia

    I recently wanted to try out AForge.NET as I found it to be quite simple, so I decided to make some simple video playback using Video.FFMPEG namespace from it, so I could put each frame directly on a pictureBox. That alone works well, but I wanted to dispose every image after not being important because it took about 1.5GB memory for no apparent reason. That’s where my problem started. For some reason, it sometimes will just throw this exception (usually when resizing the window). I’m not really sure what it could be caused by. Maybe it’s really a stupid mistake. My guess is that it could be caused by timer, but I could have done a completely different mistake and just cannot see it. This is the exception I keep getting :

       ************** Exception Text **************
    System.ArgumentException: Parameter is not valid.
      at System.Drawing.Image.get_Width()
      at System.Drawing.Image.get_Size()
      at System.Windows.Forms.PictureBox.ImageRectangleFromSizeMode(PictureBoxSizeMode mode)
      at System.Windows.Forms.PictureBox.OnPaint(PaintEventArgs pe)
      at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
      at System.Windows.Forms.Control.WmPaint(Message& m)
      at System.Windows.Forms.Control.WndProc(Message& m)
      at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
      at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
      at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    This is the code (I do realize that public variables are not good, I’m just testing of course) :

    public long i = 0;
    public Bitmap img;
    public VideoFileReader reader;
    public System.Timers.Timer aTimer;

    public void render(object source, ElapsedEventArgs e)
    {
       if (img != null) img.Dispose();
       if (i < reader.FrameCount)
       {
           img = reader.ReadVideoFrame();
           pictureBox1.Image = img;
       }
       i++;
    }

    private void button1_Click(object sender, EventArgs e)
    {
       reader = new VideoFileReader();
       aTimer = new System.Timers.Timer();
       reader.Open("d:\\result.avi");
       aTimer.Elapsed += new ElapsedEventHandler(render);
       aTimer.Interval = reader.FrameRate;
       aTimer.Enabled = true;
    }
  • How to define an in-memory object for opengl to render

    23 novembre 2016, par Ted Yu

    Currently I’m working on an android application, in which I want to fetch frames from Camera, render off-screen and encode into a video. I took the ideas from grafika, camera and egl context works well. However, MediaCodec does not function for some reasons, so I turn to ffmpeg. I do as follows :

    1. Open camera in camera thread
    2. Setup egl context in egl thread, create an off-screen surface
    3. Setup ffmpeg encoder/muxer in encode thread
    4. Generate texture and new a SurfaceTexture backed with that texture in egl thread, and pass the SurfaceTexture to the camera thread for previewing
    5. Everytime SurfaceTexture has frame available, draw the texture to the off-screen surface in egl thread
    6. Read pixels with glReadPixels to a buffer, and pass the buffer to the encode thread
    7. Encode video in the encode thread if there is any available frames

    Everything works fine without glReadPixels, and performance goes low with the glReadPixels invokation uncommented, even the encode thread is not running.

    grafika gets high performance by drawing on MediaCodec’s input surface (see VideoEncoderCore).

    So I wonder how to do the same thing with ffmpeg ? Is it possible to allocating a frame buffer for rendering and encoding, so that I can get rid of glReadPixels (memory copying) ?