Recherche avancée

Médias (91)

Autres articles (66)

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

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

Sur d’autres sites (11185)

  • How can i save the preview video in pictureBox1 to a avi/mp4 video file on hard disk using directshow ?

    10 avril 2016, par benny dayag

    The first problem maybe it’s not a problem but for some reason the video preview in the pictureBox1 is working but the frame rate seems not right. I can’t figure how to set/change it. The preview video seems a bit dart to the eyes not flickering but not moving smooth.

    The main problem is how to save the preview in the pictureBox1 or directly the streaming to a video file ? The MediaSubtype i’m getting is h.264

    The video is from the device legato game capture.

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using DirectShowLib;
    using DirectShowLib.BDA;
    using DirectShowLib.DES;
    using DirectShowLib.DMO;
    using DirectShowLib.Dvd;
    using DirectShowLib.MultimediaStreaming;
    using DirectShowLib.SBE;
    using System.Runtime.InteropServices;
    using System.Management;
    using System.IO;
    using System.Drawing.Imaging;


    namespace Youtube_Manager
    {

       public partial class Elgato_Video_Capture : Form
       {


           IFileSinkFilter sink;

           IFilterGraph2 graph;
           ICaptureGraphBuilder2 captureGraph;
           System.Drawing.Size videoSize;

           string error = "";
           List devices = new List();
           IMediaControl mediaControl;

           public Elgato_Video_Capture()
           {
               InitializeComponent();



               if (comboBox1.Items.Count == 0)
               {
                   for (int xx = 1; xx <= 8; xx++)
                   {
                       comboBox1.Items.Add(xx);
                   }
               }

               InitDevice();
               timer1.Start();
           }

           IBaseFilter smartTeeFilter;
           IPin outPin;
           IPin inPin;
           private void InitDevice()
           {
               try
               {
                   //Set the video size to use for capture and recording
                   videoSize = new Size(827, 505);//1280, 720);

                   //Initialize filter graph and capture graph
                   graph = (IFilterGraph2)new FilterGraph();
                   captureGraph = (ICaptureGraphBuilder2)new CaptureGraphBuilder2();
                   captureGraph.SetFiltergraph(graph);
                   //Create filter for Elgato
                   Guid elgatoGuid = new Guid("39F50F4C-99E1-464A-B6F9-D605B4FB5918");
                   Type comType = Type.GetTypeFromCLSID(elgatoGuid);
                   IBaseFilter  elgatoFilter = (IBaseFilter)Activator.CreateInstance(comType);
                   graph.AddFilter(elgatoFilter, "Elgato Video Capture Filter");

                   //Create smart tee filter, add to graph, connect Elgato's video out to smart tee in
                   smartTeeFilter = (IBaseFilter)new SmartTee();

                   graph.AddFilter(smartTeeFilter, "Smart Tee");
                   outPin = GetPin(elgatoFilter, "Video");
                   inPin = GetPin(smartTeeFilter, "Input");
                   SetAndGetAllAvailableResolution(outPin);
                   graph.Connect(outPin, inPin);


                   //Create video renderer filter, add it to graph, connect smartTee Preview pin to video renderer's input pin
                   IBaseFilter videoRendererFilter = (IBaseFilter)new VideoRenderer();

                   graph.AddFilter(videoRendererFilter, "Video Renderer");
                   outPin = GetPin(smartTeeFilter, "Preview");

                   inPin = GetPin(videoRendererFilter, "Input");
                   graph.Connect(outPin, inPin);

                  // int hr = graph.Connect(outPin, inPin); ;
                  // DsError.ThrowExceptionForHR(hr);

                   captureGraph.SetOutputFileName(MediaSubType.Avi, @"e:\screenshots\test1.mp4", out smartTeeFilter, out sink);

                   //Render stream from video renderer
                   captureGraph.RenderStream(PinCategory.VideoPort, MediaType.Video, videoRendererFilter, null, null);
                   //Set the video preview to be the videoFeed panel
                   IVideoWindow vw = (IVideoWindow)graph;
                   vw.put_Owner(pictureBox1.Handle);
                   vw.put_MessageDrain(this.Handle);
                   vw.put_WindowStyle(WindowStyle.Child | WindowStyle.ClipSiblings | WindowStyle.ClipChildren);
                   vw.SetWindowPosition(0, 0, 827, 505);

                   //Start the preview
                   mediaControl = graph as IMediaControl;
                   mediaControl.Run();
               }
               catch (Exception err)
               {
                   error = err.ToString();
               }
           }

            IPin GetPin(IBaseFilter filter, string pinname)
           {
               IEnumPins epins;
               int hr = filter.EnumPins(out epins);
               checkHR(hr, "Can't enumerate pins");
               IntPtr fetched = Marshal.AllocCoTaskMem(4);
               IPin[] pins = new IPin[1];
               while (epins.Next(1, pins, fetched) == 0)
               {
                   PinInfo pinfo;
                   pins[0].QueryPinInfo(out pinfo);
                   bool found = (pinfo.name == pinname);
                   DsUtils.FreePinInfo(pinfo);
                   if (found)
                       return pins[0];
               }
               checkHR(-1, "Pin not found");
               return null;
           }

           public  void checkHR(int hr, string msg)
           {
               if (hr < 0)
               {
                   MessageBox.Show(msg);
                   DsError.ThrowExceptionForHR(hr);
               }



           }

           public void SetAndGetAllAvailableResolution(IPin VideoOutPin)
           {
               int hr = 0;
               IAMStreamConfig streamConfig = (IAMStreamConfig)VideoOutPin;
               AMMediaType searchmedia;
               AMMediaType CorectvidFormat = new AMMediaType();
               IntPtr ptr;
               int piCount, piSize;
               hr = streamConfig.GetNumberOfCapabilities(out piCount, out piSize);
               ptr = Marshal.AllocCoTaskMem(piSize);
               for (int i = 0; i < piCount; i++)
               {
                   hr = streamConfig.GetStreamCaps(i, out searchmedia, ptr);
                   VideoInfoHeader v = new VideoInfoHeader();

                   Marshal.PtrToStructure(searchmedia.formatPtr, v);
                   if (i == 2)// 4
                   {
                       CorectvidFormat = searchmedia;
                   }
               }
               hr = streamConfig.SetFormat(CorectvidFormat);

               IntPtr pmt = IntPtr.Zero;
               AMMediaType mediaType = new AMMediaType();
               IAMStreamConfig streamConfig1 = (IAMStreamConfig)VideoOutPin;
               hr = streamConfig1.GetFormat(out mediaType);
               BitmapInfoHeader bmpih = new BitmapInfoHeader();
               Marshal.PtrToStructure(mediaType.formatPtr, bmpih);
           }
     }
    }

    I tried to use this line to save the video to a video file but the video file on hard disk is 0 KB so I guess it’s a wrong way to do it.
    I also thought somehow to save each frame(bitmap image) from the pictureBox1 to the hard disk or maybe the memory and use ffmpeg to create/build a video file in real time from each saved frame but I can’t get/save the images(frames) from the pictureBox1 for some reason.

    I tried using DrawToBitmap but all the frames(bitmaps on hard disk saved) are empty size 2.24 KB

    captureGraph.SetOutputFileName(MediaSubType.Avi, @"e:\screenshots\test1.mp4", out smartTeeFilter, out sink);

    This is how I tried to get the frames from the pictureBox1

    public static int counter = 0;
           private void timer1_Tick(object sender, EventArgs e)
           {
               counter++;
               Bitmap bmp = new Bitmap(pictureBox1.ClientSize.Width, pictureBox1.ClientSize.Height);
               pictureBox1.DrawToBitmap(bmp, pictureBox1.ClientRectangle);
               bmp.Save(@"e:\screenshots\" + "screenshot" + counter.ToString("D6") + ".bmp");
               bmp.Dispose();
           }
  • Nginx RTMP/HLS - stream to ffmpeg and output HLS

    20 novembre 2018, par kanazaca

    At this point my solution is working but only as RTMP, i can watch perfectly my stream using the URL :

    rtmp://X.X.X.X:1935/show/name

    But the problem is that my LG Smart Tv which uses WebOS don’t support RTMP and i would really like to play my stream there. The only solution that i can see right now is to use HLS. With HLS all works fine too, but i need to execute my ffmpeg command before open the HLS stream in TV, otherwise it will not create the files necessary to display the stream on my TV.

    So my goal is to serve a stream as HLS without having to trigger the RTMP endpoint or the FFMPEG manually.

    I’m really struggling with this, waste 3 days trying to make it work :(

    http
    {
    location /hls
    {
       # Disable cache
       add_header Cache-Control no-cache;

       # CORS setup
       add_header 'Access-Control-Allow-Origin' '*' always;
       add_header 'Access-Control-Expose-Headers' 'Content-Length';

       # allow CORS preflight requests
       if ($request_method = 'OPTIONS') {
           add_header 'Access-Control-Allow-Origin' '*';
           add_header 'Access-Control-Max-Age' 1728000;
           add_header 'Content-Type' 'text/plain charset=UTF-8';
           add_header 'Content-Length' 0;
           return 204;
       }

       types {
           application/vnd.apple.mpegurl m3u8;
           video/mp2t ts;
       }

       root /mnt/;
       }
    }

    }
    rtmp {
    server {
       listen 1935;

       chunk_size 4000;
       buflen 5s;

       application show {
           live on;

       exec_pull ffmpeg -re -i http://stream-coming.com/$name.ts -c:v libx264 -preset faster -pix_fmt yuv420p -c:a aac -f flv rtmp://localhost/show/$name;

           # Turn on HLS
           hls on;
           hls_path /mnt/hls/;
           hls_fragment 3;
           hls_playlist_length 60;
           # disable consuming the stream from nginx as rtmp
           deny play all;
       }
    }

    }

    Thanks for your time ;)

  • swscale/x86/yuv2rgb : add ssse3 yuv42{0,2}p -> gbrp unscaled colorspace converters

    6 août 2024, par Ramiro Polla
    swscale/x86/yuv2rgb : add ssse3 yuv420,2p -> gbrp unscaled colorspace converters
    

    Note : this implementation is limited to x86_64 due to general purpose
    register pressure.

    checkasm —bench on an Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz :
    yuv420p_gbrp_8_c : 118.5
    yuv420p_gbrp_8_ssse3 : 93.3
    yuv420p_gbrp_128_c : 1068.3
    yuv420p_gbrp_128_ssse3 : 319.3
    yuv420p_gbrp_1080_c : 8841.8
    yuv420p_gbrp_1080_ssse3 : 2211.8
    yuv420p_gbrp_1920_c : 15903.8
    yuv420p_gbrp_1920_ssse3 : 3814.3
    yuv422p_gbrp_8_c : 144.8
    yuv422p_gbrp_8_ssse3 : 93.8
    yuv422p_gbrp_128_c : 1395.8
    yuv422p_gbrp_128_ssse3 : 313.0
    yuv422p_gbrp_1080_c : 11551.5
    yuv422p_gbrp_1080_ssse3 : 2240.8
    yuv422p_gbrp_1920_c : 20585.3
    yuv422p_gbrp_1920_ssse3 : 5249.5
    yuva420p_gbrp_8_c : 117.5
    yuva420p_gbrp_8_ssse3 : 92.0
    yuva420p_gbrp_128_c : 1593.0
    yuva420p_gbrp_128_ssse3 : 319.3
    yuva420p_gbrp_1080_c : 8694.5
    yuva420p_gbrp_1080_ssse3 : 2186.0
    yuva420p_gbrp_1920_c : 15946.5
    yuva420p_gbrp_1920_ssse3 : 3805.3

    • [DH] libswscale/x86/yuv2rgb.c
    • [DH] libswscale/x86/yuv_2_rgb.asm