Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (64)

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

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (8582)

  • using ffmpeg for silence detect with input pipe

    24 août 2018, par Moharrer

    I am trying to detect silence from audio file with ffmpeg in c#.
    i want to pipe input from c# memory stream and get silence duration like following command

    ffmpeg -hide_banner -i pipe:0 -af silencedetect=noise=-50dB:d=0.5 -f null - 

    but there is a problem, when input stream pump in pipe, ffmpeg waiting in p.WaitForExit() line.
    when i change p.WaitForExit() to p.WaitForExit(1000) and set force timeout the following result is displayed.

    [mp3 @ 00000163818da580] invalid concatenated file detected - using bitrate for durationInput #0, mp3, from ’pipe:0’ :  
    Metadata :    encoder : Lavf57.71.100  Duration : N/A, start : 0.023021, bitrate : 86 kb/s    
    Stream #0:0 : Audio : mp3, 48000 Hz, mono, fltp, 86 kb/sStream mapping :  Stream #0:0 -> #0:0 (mp3 (mp3float) -> pcm_s16le (native))Output #0, null, to ’pipe :’ :  
    Metadata :    encoder : Lavf58.17.101    Stream #0:0 : Audio : pcm_s16le, 48000 Hz, mono, s16, 768 kb/s   
     Metadata :      encoder : Lavc58.21.105 pcm_s16le
    

    [silencedetect @ 0000023df1786840] silence_start : 50.1098
    [silencedetect @ 0000023df1786840] silence_end : 51.5957 | silence_duration : 1.48588
    [silencedetect @ 0000023df1786840] silence_start : 51.5959
    [silencedetect @ 0000023df1786840] silence_end : 52.127 | silence_duration : 0.531062
    [silencedetect @ 0000023df1786840] silence_start : 52.8622
    [silencedetect @ 0000023df1786840] silence_end : 54.0096 | silence_duration : 1.14733
    [silencedetect @ 0000023df1786840] silence_start : 54.6804

    as you can see in result silence detection done but with error at the first.
    this mean input file pumped correctly in ffmpg but waiting.
    how can i solve problem without set time out for p.WaitForExit()

    private void Execute(string exePath, string parameters, Stream inputStream)
            
                byte[] Data = new byte[5000] ;
    

    var p = new Process() ;
    var sti = p.StartInfo ;
    sti.CreateNoWindow = true ;
    sti.UseShellExecute = false ;
    sti.FileName = exePath ;
    sti.Arguments = arg ;
    sti.LoadUserProfile = false ;
    sti.RedirectStandardInput = true ;
    sti.RedirectStandardOutput = true ;

    sti.RedirectStandardError = true ;

    p.ErrorDataReceived += P_ErrorDataReceived ;
    p.OutputDataReceived += P_OutputDataReceived ;

    p.Start() ;

    p.BeginOutputReadLine() ;
    p.BeginErrorReadLine() ;

    var spInput = new StreamPump(inputStream, p.StandardInput.BaseStream, 4064) ;
    spInput.Pump((pump, result) =>

    pump.Output.Flush() ;
    inputStream.Dispose() ;
    ) ;

    //unlimited waiting
    //p.WaitForExit() ;

    p.WaitForExit(1000) ;

  • How do I set ffmpeg pipe output ?

    5 décembre 2019, par mr_blond

    I need to read ffmpeg output as pipe.
    There is a code example :

       public static void PipeTest()
       {
           Process proc = new Process();
           proc.StartInfo.FileName = Path.Combine(WorkingFolder, "ffmpeg");
           proc.StartInfo.Arguments = String.Format("$ ffmpeg -i input.mp3 pipe:1");
           proc.StartInfo.UseShellExecute = false;
           proc.StartInfo.RedirectStandardInput = true;
           proc.StartInfo.RedirectStandardOutput = true;
           proc.Start();

           FileStream baseStream = proc.StandardOutput.BaseStream as FileStream;
           byte[] audioData;
           int lastRead = 0;

           using (MemoryStream ms = new MemoryStream())
           {
               byte[] buffer = new byte[5000];
               do
               {
                   lastRead = baseStream.Read(buffer, 0, buffer.Length);
                   ms.Write(buffer, 0, lastRead);
               } while (lastRead > 0);

               audioData = ms.ToArray();
           }

           using(FileStream s = new FileStream(Path.Combine(WorkingFolder, "pipe_output_01.mp3"), FileMode.Create))
           {
               s.Write(audioData, 0, audioData.Length);
           }
       }

    It’s log from ffmpeg, the first file is readed :

    Input #0, mp3, from ’norm.mp3’ :
    Metadata :
    encoder : Lavf58.17.103
    Duration : 00:01:36.22, start : 0.023021, bitrate : 128 kb/s
    Stream #0:0 : Audio : mp3, 48000 Hz, stereo, fltp, 128 kb/s
    Metadata :
    encoder : Lavc58.27

    Then pipe :

    [NULL @ 0x7fd58a001e00] Unable to find a suitable output format for ’$’
    $ : Invalid argument

    If I run "-i input.mp3 pipe:1", the log is :

    Unable to find a suitable output format for ’pipe:1’ pipe:1 : Invalid
    argument

    How do I set correct output ? And how should ffmpeg know what the output format is at all ?

  • FFMPEG stream .mpg to windows pipe and display video in C#

    25 septembre 2018, par Przemysław

    i’ve got problem with streaming mpg video to windows pipe. I wang decode video with command ffmpeg.exe to windows pipe and connect to that pipe with c# and display video on winform. I’ve tried many commands but none of them worked.

    FFmpeg command :

    ffmpeg -i Day Flight.mpg -f image2pipe pipe:1 > //./pipe/ffpipe

    C# code :

    using System;
    using System.Drawing;
    using System.Windows.Forms;
    using System.IO;
    using System.IO.Pipes;
    using System.Threading;
    using System.Runtime.InteropServices;
    using System.Text;

    namespace WindowsFormsApplication1
    {

    public partial class Form1 : Form
    {

       String readLine_;
       private void readThread()
       {

           while (true)
           {
               readLine_ = reader_.ReadLine();
               if (readLine_ != null)
               {

                   byte[] bytes = Encoding.Unicode.GetBytes(readLine_);
                   //Console.WriteLine(readLine_);
                   //Console.ReadLine();
                   var ms = new MemoryStream(bytes);
                   // Bitmap bm = new Bitmap(ms);
                   Image im = (Bitmap)((new ImageConverter()).ConvertFrom(bytes));
               }
               else
                   Console.WriteLine("empty string");

               //



           }
       }
       private NamedPipeServerStream server_;
       StreamReader reader_;


       public Form1()
       {
           InitializeComponent();
       }

       private void Form1_Load(object sender, EventArgs e)
       {
           AllocConsole();
           server_ = new NamedPipeServerStream("ffpipe", PipeDirection.In, 1, PipeTransmissionMode.Byte);
           server_.WaitForConnection();
           reader_ = new StreamReader(server_);
           Thread t = new Thread(readThread);
           t.Start();


       }


       [DllImport("kernel32.dll", SetLastError = true)]
       [return: MarshalAs(UnmanagedType.Bool)]
       static extern bool AllocConsole();
    }

    }

    I can’t get image in C#, my program crashes in line
    Image im = (Bitmap)((new ImageConverter()).ConvertFrom(bytes)) ;

    And I don’t know where I make a mistake - in ffmpeg piping or in C# program
    https://image.ibb.co/eGDymp/Przechwytywanie.png
    https://image.ibb.co/hWpM6p/Przechwytywanie.png

    Example video :
    http://samples.ffmpeg.org/MPEG2/mpegts-klv/Day%20Flight.mpg