Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (64)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Gestion de la ferme

    2 mars 2010, par

    La ferme est gérée dans son ensemble par des "super admins".
    Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
    Dans un premier temps il utilise le plugin "Gestion de mutualisation"

Sur d’autres sites (7002)

  • How to get output from ffmpeg process in c#

    13 juillet 2018, par Anirudha Gupta

    In the code I written in WPF, I run some filter in FFmpeg, If I run the command in terminal (PowerShell or cmd prompt) It will give me information line by line what’s going on.

    I am calling the process from C# code and it’s work fine. The problem I have with my code is actually I am not able to get any output from the process I run.

    I have tried some answers from StackOverflow for FFmpeg process. I see 2 opportunities in my code. I can either fix it by Timer approach or secondly hook an event to OutputDataReceived.

    I tried OutputDataReceived event, My code never got it worked. I tried Timer Approach but still, it’s not hitting my code. Please check the code below

           _process = new Process
           {
               StartInfo = new ProcessStartInfo
               {
                   FileName = ffmpeg,
                   Arguments = arguments,
                   UseShellExecute = false,
                   RedirectStandardOutput = true,
                   RedirectStandardError = true,
                   CreateNoWindow = true,
               },
               EnableRaisingEvents = true
           };

           _process.OutputDataReceived += Proc_OutputDataReceived;

           _process.Exited += (a, b) =>
           {
               System.Threading.Tasks.Task.Run(() =>
               {
                   System.Threading.Tasks.Task.Delay(5000);
                   System.IO.File.Delete(newName);
               });

               //System.IO.File.Delete()
           };

           _process.Start();
           _timer = new Timer();
           _timer.Interval = 500;
           _timer.Start();
           _timer.Tick += Timer_Tick;
       }


       private void Timer_Tick(object sender, EventArgs e)
       {
           while (_process.StandardOutput.EndOfStream)
           {
              string line = _process.StandardOutput.ReadLine();
           }
           // Check the process.

       }
  • Backgroundworker quits itself and calls Runworkercompleted function

    5 mai 2017, par yjs990427

    I am using youtube-dl in a cmd process running in a backgroundworker process in wpf application to update its status to a text box asynchronously. There are times in my application that ffmpeg has to work in through the process. However, at the time that ffmpeg process is called (right after youtube-dl’s work is finished) and starts running, backgroundworker calls Runworkercompleted method and kills itself. ffmpeg is called from youtube-dl.

    Is there any fix that make the backgroundworker still work until the ffmpeg’s work is done ? Thanks.

    My DoWork method :

    private void downloadWorker_DoWork(object sender, DoWorkEventArgs e)
           {
               BackgroundWorker worker = sender as BackgroundWorker;
               Process process = new Process();
               string[] scripts = (string[])e.Argument;

               string dir = scripts[0];
               string scriptText = scripts[1];

               process.StartInfo.FileName = "cmd.exe";
               process.StartInfo.WorkingDirectory = dir;
               process.StartInfo.Arguments = "/C set path=%path%;" + System.AppDomain.CurrentDomain.BaseDirectory + "&" + scriptText;
               process.StartInfo.CreateNoWindow = true;
               process.StartInfo.UseShellExecute = false;
               process.StartInfo.RedirectStandardOutput = true;
               process.StartInfo.RedirectStandardInput = true;
               process.StartInfo.RedirectStandardError = true;

               process.Start();

               while (!process.StandardOutput.EndOfStream)
               {
                   if (downloadWorker.CancellationPending)   // if and only if user calls Abort
                   // would this if statement be the problem?
                   {
                       foreach (var youtube in Process.GetProcessesByName("youtube-dl"))
                       {
                           youtube.Kill();
                       }
                       process.Kill();
                       e.Cancel = true;
                       return;
                   }
                   else
                   {
                       string line = process.StandardOutput.ReadLine();
                       worker.ReportProgress(1, line);                  // reports its status to UI
                   }
               }
           }

    My RunWorkerCompleted method :

    private void downloadWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
           {
               if (e.Error != null)
               {
                   MessageBox.Show(e.Error.Message);
               }
               else if (e.Cancelled == true)
               {
                   MessageBox.Show("Download Aborted!\r\nYou will need to delete the .part file in the download folder.", "Abort");
               }
               else if (musicCheckBox.IsChecked == true)
               {
                   MessageBox.Show("Music Download finished.", "Successful");
               }
               else if (videoCheckBox.IsChecked == true)
               {
                   MessageBox.Show("Video Download finished.", "Successful");
               }
               // CMDoutputTextBox.Text = "";
               downloadBtn.Content = "Download!";
               downloadBtn.IsEnabled = true;
           }

    edit : The backgroundworker produces this output and calls RunWorkerFinished method. ffmpeg does nothing after the output.

    [ffmpeg] Converting video from mp4 to mkv, Destination: TAEYEON 태연_Why_Music Video-WkdtmT8A2iY.mkv
  • org.bytedeco.javacv.CanvasFrame showImage is hanging

    24 août 2018, par user3911119

    An IOS device is uploading h264 files (3 sec videos) to a server. Each file is successfully readable by VLC.

    Using FFMpegFrameGrabber, I grab each frame and try to display them using CanvasFrame.showImage as below. However, the method call hangs.

    CanvasFrame canvas = new CanvasFrame("ios");
    canvas.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    canvas.setAlwaysOnTop(true);
    canvas.setResizable(true);
    try(FileInputStream fis = new FileInputStream(file))
    {
       try(FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(fis))
       {
           grabber.setFormat("h264");
           grabber.start();
           while(true)
           {
               Frame frame = grabber.grabImage();
               if(frame != null)
               {
                   canvas.showImage(frame);
               }
           }
       }
    }

    Am I doing anything wrong in the above code ?

    EDIT#1 : When I try to save the buffered image for the frame, a valid image is saved.

    BufferedImage image = converter.getBufferedImage(frame);
    File outputfile = new File("png_file");
    ImageIO.write(image, "png", outputfile);