Recherche avancée

Médias (3)

Mot : - Tags -/collection

Autres articles (111)

  • Other interesting software

    13 avril 2011, par

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website : http://videopress.com/
    License : GNU/GPL v2
    Source code : (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

Sur d’autres sites (10710)

  • Video encoded by ffmpeg.exe giving me a garbage video in c# .net

    10 septembre 2018, par Amit Yadav

    I want to record video through webcam and file to be saved in .mp4 format. So for recording i am using AforgeNet.dll for recording and for mp4 format i am encoding raw video into mp4 using ffmpeg.exe using NamedPipeStreamServer as i receive frame i push into the named pipe buffer. this process works fine i have checked in ProcessTheErrorData event but when i stop recording the output file play garbage video shown in the image below

    enter image description here

    Here is Code for this

      Process Process;
     NamedPipeServerStream _ffmpegIn;
       byte[]  _videoBuffer ;
       const string PipePrefix = @"\\.\pipe\";
       public void ffmpegWriter()
       {
           if(File.Exists("outputencoded.mp4"))
           {
               File.Delete("outputencoded.mp4");
           }

           _videoBuffer = new byte[widht * heigth * 4];
           var audioPipeName = GetPipeName();
           var videoPipeName = GetPipeName();
           var videoInArgs = $@" -thread_queue_size 512 -use_wallclock_as_timestamps 1 -f rawvideo -pix_fmt rgb32 -video_size 640x480 -i \\.\pipe\{videoPipeName}";
           var videoOutArgs = $"-vcodec libx264 -crf 15 -pix_fmt yuv420p -preset ultrafast -r 10";
           _ffmpegIn = new NamedPipeServerStream(videoPipeName, PipeDirection.Out, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous, 0, _videoBuffer.Length);
           Process=StartFFmpeg($"{videoInArgs} {videoOutArgs} \"{"outputencoded.mp4"}\"", "outputencoded.mp4");
       }

    bool WaitForConnection(NamedPipeServerStream ServerStream, int Timeout)
       {
           var asyncResult = ServerStream.BeginWaitForConnection(Ar => { }, null);

           if (asyncResult.AsyncWaitHandle.WaitOne(Timeout))
           {
               ServerStream.EndWaitForConnection(asyncResult);

               return ServerStream.IsConnected;
           }

           return false;
       }
     static string GetPipeName() => $"record-{Guid.NewGuid()}";

    public static Process StartFFmpeg(string Arguments, string OutputFileName)
           {
               var process = new Process
               {
                   StartInfo =
                   {
                       FileName = "ffmpeg.exe",
                       Arguments = Arguments,
                       UseShellExecute = false,
                       CreateNoWindow = true,
                       RedirectStandardError = true,
                       RedirectStandardInput = true,

                   },
                   EnableRaisingEvents = true
               };

               //  var logItem = ServiceProvider.Get<ffmpeglog>().CreateNew(Path.GetFileName(OutputFileName));

               process.ErrorDataReceived += (s, e) => ProcessTheErrorData(s,e);

               process.Start();

               process.BeginErrorReadLine();

               return process;
           }
    </ffmpeglog>

    and Writing each frame like this.

    private void video_NewFrame(object sender, NewFrameEventArgs eventArgs)
           {

               try
               {
                   if (_recording)
                   {

                       using (var bitmap = (Bitmap) eventArgs.Frame.Clone())
                       {
                          var _videoBuffers = ImageToByte(bitmap);


                               if (_firstFrameTime != null)
                               {
                               bitmap.Save("image/" + DateTime.Now.ToString("ddMMyyyyHHmmssfftt")+".bmp");

                                   _lastFrameTask?.Wait();


                                   _lastFrameTask = _ffmpegIn.WriteAsync(_videoBuffers, 0, _videoBuffers.Length);
                               }
                               else
                               {
                                   if (_firstFrame)
                                   {
                                       if (!WaitForConnection(_ffmpegIn, 5000))
                                       {
                                           throw new Exception("Cannot connect Video pipe to FFmpeg");
                                       }

                                       _firstFrame = false;
                                   }

                                   _firstFrameTime = DateTime.Now;
                                   _lastFrameTask?.Wait();

                                   _lastFrameTask = _ffmpegIn.WriteAsync(_videoBuffers, 0, _videoBuffers.Length);

                               }

                       }
                   }
                   using (var bitmap = (Bitmap) eventArgs.Frame.Clone())
                   {
                       var bi = bitmap.ToBitmapImage();
                       bi.Freeze();
                       Dispatcher.CurrentDispatcher.Invoke(() => Image = bi);
                   }
               }
               catch (Exception exc)
               {
                   MessageBox.Show("Error on _videoSource_NewFrame:\n" + exc.Message, "Error", MessageBoxButton.OK,
                       MessageBoxImage.Error);
                   StopCamera();
               }
           }

    Even i have written each frame to disk as bitmap .bmp and frames are correct but i don’t know what’s i am missing here ? please help thanks in advance.

  • Stream with ffmpeg over LAN ?

    5 septembre 2018, par Kalpit

    I’m trying to stream a mpegts file over LAN, with the command

    ffmpeg -re -i in.ts -vcodec copy -acodec copy -f mpegts "udp://localhost:5000/live/stream"

    And trying to capture 10s chunks of it over LAN(at server) at

    ffmpeg  -i udp://192.168.xx.xx:5000/live/stream -c copy -f segment -segment_time 10 -strftime 1 "in /%Y-%m-%d_%H-%M-%S.mp4"

    This isn’t working. I tested the stream in VLC, and there’s nothing to play.

    Now, I suspect this is a port issue, since FFMPEG doesnt seem to write/listen over the 5000 port specified. I used netstat to check, and there are no PID including ffmpeg on the port. However, the command

    ffmpeg  -i udp://127.0.0.1:5000/live/stream -c copy -f segment -segment_time 10 -strftime 1 "in/%Y-%m-%d_%H-%M-%S.mp4"

    generates the desired output on my machine(localhost), as does ffplay. Can anyone help ?

  • 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) ;