Recherche avancée

Médias (1)

Mot : - Tags -/biographie

Autres articles (82)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

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

  • Les notifications de la ferme

    1er décembre 2010, par

    Afin d’assurer une gestion correcte de la ferme, il est nécessaire de notifier plusieurs choses lors d’actions spécifiques à la fois à l’utilisateur mais également à l’ensemble des administrateurs de la ferme.
    Les notifications de changement de statut
    Lors d’un changement de statut d’une instance, l’ensemble des administrateurs de la ferme doivent être notifiés de cette modification ainsi que l’utilisateur administrateur de l’instance.
    À la demande d’un canal
    Passage au statut "publie"
    Passage au (...)

Sur d’autres sites (7443)

  • How to play, pause and stop a video in the buttons of GUI created in Python ?

    24 juillet 2016, par Purvaj

    I have created a GUI in Python. In the GUI I have three buttons, Play, Pause and Stop. On the click of the respective buttons, i want the respective tasks to be done, that is, play, pause and stop a video. Any body have any idea please help me. This is what i have tried to do so far :

    from tkinter import *
    import subprocess
    import os
    import vlc

    root=Tk()
    root.title("ARP")
    root.geometry("200x100")


    def play():
    left_video = subprocess.Popen(["C:/Program Files (x86)/VideoLAN/VLC/vlc.exe","\\C:\FFmpegTool\\bin\\samplevideo.mp4"])

    right_video = subprocess.Popen(["C:/Program Files (x86)/VideoLAN/VLC/vlc.exe","\\C:\FFmpegTool\\bin\\rotate1.mp4"])


    app=Frame(root)
    app.grid()
    button1=Button(app, text="Play", command=play)
    button1.grid()

    button2=Button(app)
    button2.grid()
    button2.configure(text="Pause")

    button3=Button(app)
    button3.grid()
    button3.configure(text="Stop")

    root.mainloop()

    Please help me.

  • Convert multible files with threading ffmpeg in Python

    21 mars 2020, par Florian

    I’m trying to convert mp3 files to m4a. The files are in different folders like MainFolder(folder1, folder2,...)

    It works already but is very slow because it is converting file by file.

    import os
    import sys

    path = "/Users/flo/Desktop/test"

    for root, dir, files in os.walk(path):
       dir.sort()
       files.sort()

       for file in files:
           if file.find('.mp3') != -1:
               os.system('ffmpeg -i ' +'"' +root +'/' +file +'" ' +'-c:v copy -c:a libfdk_aac -b:a 300k '  +'"' +root +'/' +file[:-4] +'.m4b' +'"')

    Now I would like to implement multitasking.

    import os
    import sys
    import threading
    import queue

    path = "/Users/flo/Desktop/test"
    def convert(file):
       if file.find('.mp3') != -1:
           os.system('ffmpeg -i ' +'"' +root +'/' +file +'" ' +'-c:v copy -c:a libfdk_aac -b:a 300k '  +'"' +root +'/' +file[:-4] +'.m4b' +'"')

    for root, dir, files in os.walk(path):
       dir.sort()
       files.sort()

       q = queue.Queue
       threads = [threading.Thread(target=convert(file)) for file in files]
       for t in threads:
           t.start()

       for file in files:
           q.put(file)

       for file in files:
           q.put('stop')

       q.join()

       for t in threads:
           t.join()

    But I got the error message :

    File "/var/folders/r6/z5f_jcf139b8fh2n8m4lznlm0000gn/T/atom_script_tempfiles/30127c90-6b13-11ea-af8a-432a34b059ac", line 31
       threads = [threading.Thread(target=convert(file)) for file in files]
       ^
    IndentationError: unexpected indent
    [Finished in 0.028s]
  • ffmpeg processes pile up until they crash

    9 mars 2021, par Ultra Cookie

    I am coding a bot which streams music using ytdl and @discordjs/opus. It uses ffmpeg for that and when I end the dispatcher the process doesn't get killed. After a while this piles up and the process list looks like this :

    


    0     0 27864 27863  20   0 120348 14380 sock_a Sl+  pts/2      0:01 /root/bot/node_modules/ffmpeg-static/ffmpeg -i - -analyzeduration 0 -loglevel 0 -f s16le -ar 48000 -ac 2 pipe:1
0     0 27887     1  20   0 120104 13496 sock_a Sl+  pts/2      0:00 /root/bot/node_modules/ffmpeg-static/ffmpeg -i - -analyzeduration 0 -loglevel 0 -f s16le -ar 48000 -ac 2 pipe:1
0     0 27893     1  20   0 120040 13676 sock_a Sl+  pts/2      0:00 /root/bot/node_modules/ffmpeg-static/ffmpeg -i - -analyzeduration 0 -loglevel 0 -f s16le -ar 48000 -ac 2 pipe:1
0     0 27900     1  20   0 120048 13676 sock_a Sl+  pts/2      0:00 /root/bot/node_modules/ffmpeg-static/ffmpeg -i - -analyzeduration 0 -loglevel 0 -f s16le -ar 48000 -ac 2 pipe:1
0     0 27906     1  20   0 120048 13676 sock_a Sl+  pts/2      0:00 /root/bot/node_modules/ffmpeg-static/ffmpeg -i - -analyzeduration 0 -loglevel 0 -f s16le -ar 48000 -ac 2 pipe:1
0     0 27913     1  20   0 103740 13792 sock_a S+   pts/2      0:00 /root/bot/node_modules/ffmpeg-static/ffmpeg -i - -analyzeduration 0 -loglevel 0 -f s16le -ar 48000 -ac 2 pipe:1



    


    This is just a preview the actual list is much longer... I don't know how I can prevent this.

    


    Code that might be helpful :

    


    Play:
connection.play(ytdl(song.url, { quality: "highestaudio", highWaterMark: 1024 * 1024 * 30, type: "opus" })).on("finish", () => {play next song});

Skip:
connection.dispatcher.end();