Recherche avancée

Médias (1)

Mot : - Tags -/biographie

Autres articles (96)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, 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 (...)

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

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

Sur d’autres sites (6967)

  • Python PyQT : How to call a GUI function from a worker thread ?

    18 juillet 2014, par rainer

    I have a pyqt gui and calling a long process (ffmpeg) which I put on a separate thread to not block the gui. I then want to update a progress bar when one command of a longer list of commands finishes. The problem is, that I can’t call a function in the gui thread out of the worker thread. So I let run a ticker in the worker thread, but when I update the progress bar with a while loop and reading the ticker value, the gui gets blocked again. How can I solve this. I used currently python threading and not Qthread.
    Thx for any help !

    import threading, pexpect

    self.cmd_list = ['ffmpeg -i file outfile','and so on']

    self.stop_proc = False
    self.executeCMD()

    def spawn_ffmpeg_cmd(self):
       for cmd in self.cmd_list:
           if self.stop_proc == False:
               thread = pexpect.spawn(cmd)
               print "\nstarted: %s" % cmd
               cpl = thread.compile_pattern_list([pexpect.EOF,"frame= *\d+ fps=*\d+",'(.+)'])

               while True:
                   i = thread.expect_list(cpl, timeout=None)
                   if i == 0: # EOF
                       print "the sub process exited"
                       self.pgticker += 1
                       break
                   elif i == 1:
                       frame_number_fps = thread.match.group(0)
                       print frame_number_fps
                       thread.close
                   elif i == 2:
                       pass
       self.startButton.setEnabled(True)


    def executeCMD(self):
       self.startButton.setEnabled(False)
       self.pgticker = 0
       threading.Thread(target=self.spawn_ffmpeg_cmd, name="_proc").start()


    def stopprocess(self):
       self.stop_proc = True
       self.cmd_list = []
       os.system('pkill ffmpeg')
       self.pgticker = len(self.cmd_list)
       self.startButton.setEnabled(True)


    def updateProgress(self):  
       pgfactor = 100 / len(self.cmd_list)
       progress = 0.0
       progress = pgfactor*int(self.pgticker)
       self.progressBar.setProperty("value", progress)
  • FFmpeg somehow set the udp speed ?

    19 juin 2018, par potu1304

    I wanted to nearly live stream my Unit game with FFmpeg to a simple client. I have one Unity game in which each frame is saved as an jpg image. These images are wrapped in ffmpeg and send over udp to a simple c# client where I use ffplay to play the stream. The problem is, that FFmpeg is wrapping the images way faster than the unity app can write them. So ffmpeg quits but Unity is still writing frames. Is there a way to set ffmpeg in a loop to wait for the next image or can I somehow make a for loop without call every time ffmpeg ?

    Here is my function from my capturing script in Unity :

    Process process;
       //BinaryWriter _stdin;
       public void encodeFrame()
       {


           ProcessStartInfo startInfo = new ProcessStartInfo();

           var basePath = Application.streamingAssetsPath + "/FFmpegOut/Windows/ffmpeg.exe";


           info.Arguments = "-re -i screen_%d.jpg -vcodec libx264 -r 24 -f mpegts udp://127.0.0.1:1100";
           info.RedirectStandardOutput = true;
           info.RedirectStandardInput = true;
           info.RedirectStandardError = true;
           info.CreateNoWindow = true;
           info.UseShellExecute = false;
           info.RedirectStandardError = true;
           UnityEngine.Debug.Log(string.Format(
               "Executing \"{0}\" with arguments \"{1}\".\r\n",
               info.FileName,
               info.Arguments));
           process = Process.Start(info);
           //_stdin = new BinaryWriter(process.StandardInput.BaseStream);
           process.WaitForExit();
           var outputReader = process.StandardError;
           string Error = outputReader.ReadToEnd();
           UnityEngine.Debug.Log(Error);

    }

    And here the function from my cs file from my simple windowsform application :

    private void xxxFFplay()
    {
       text = "start";
       byte[] send_buffer = Encoding.ASCII.GetBytes(text);
       sock.SendTo(send_buffer, endPoint);
       ffplay.StartInfo.FileName = "ffplay.exe";
       ffplay.StartInfo.Arguments = "udp://127.0.0.1:1100";
       ffplay.StartInfo.CreateNoWindow = true;
       ffplay.StartInfo.RedirectStandardOutput = true;
       ffplay.StartInfo.UseShellExecute = false;

       ffplay.EnableRaisingEvents = true;
       ffplay.OutputDataReceived += (o, e) => Debug.WriteLine(e.Data ?? "NULL", "ffplay");
       ffplay.ErrorDataReceived += (o, e) => Debug.WriteLine(e.Data ?? "NULL", "ffplay");
       ffplay.Exited += (o, e) => Debug.WriteLine("Exited", "ffplay");
       ffplay.Start();

       Thread.Sleep(500); // you need to wait/check the process started, then...

       // child, new parent
       // make 'this' the parent of ffmpeg (presuming you are in scope of a Form or Control)
       //SetParent(ffplay.MainWindowHandle, this.panel1.Handle);

       // window, x, y, width, height, repaint
       // move the ffplayer window to the top-left corner and set the size to 320x280
       //MoveWindow(ffplay.MainWindowHandle, -5, -300, 320, 280, true);

    }

    Does have somebody some ideas ? I am really stuck at this to create a somehow "live" stream.

    Best regards

  • log file of ffmpeg's subprocess STDOUT always empty

    20 juillet 2023, par Mohamed Darwesh

    why is the log file always empty ?
I'm just trying to capture the "time=" from ffmpeg, but I need to make sure it captures the output first, which it doesn't.

    


    import ffmpeg
import subprocess

input_video = ffmpeg.input("test.mp4") 
audio_stream = input_video.audio
video_stream = input_video.video

output_stream = ffmpeg.output(video_stream, audio_stream, 'test_COMPRESSED.mp4', crf=28, vcodec='libx264', vsync=2)

cmd = ' '.join(ffmpeg.compile(output_stream, overwrite_output=True))
process = subprocess.Popen(
    cmd,
    shell=True,
    stdin=subprocess.PIPE,
    stdout=subprocess.PIPE,
    text=True
)

while process.poll() is None:
    with open('log.txt', 'a') as log_file:
        for line in process.stdout:
            output_line = line.strip()
            log_file.write(output_line + '\n')


    


    enter image description here