Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (16)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (1834)

  • FFmpeg streaming UDP

    2 octobre 2020, par xKedar

    I'm trying to stream, using FFmpeg, my webcam and audio to a PC in another LAN that connects to mine.

    


    I basically wait for incoming connection in order to acquire IP and port of the other side

    


        import socket

    localPort   = 1234
    bufferSize  = 1024

    UDPServerSocket = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM)
    UDPServerSocket.bind(("", localPort)) # Bind to address and port

    while(True):
        bytesAddressPair = UDPServerSocket.recvfrom(bufferSize)
        message = bytesAddressPair[0].decode("utf-8")
        address = bytesAddressPair[1]
        # Sending a reply to client
        UDPServerSocket.sendto(str.encode("Hello"), address)
        break

    UDPServerSocket.close()


    


    Then I try to send the stream with FFmpeg using the same port number both for server(localPort) and client(the one I acquired from address)

    


        import re
    from threading import Thread
    from subprocess import Popen, PIPE

    def detect_devices():
            list_cmd = 'ffmpeg -list_devices true -f dshow -i dummy'.split()
            p = Popen(list_cmd, stderr=PIPE)
            flagcam = flagmic = False
            for line in iter(p.stderr.readline,''):
                if flagcam:
                    cam = re.search('".*"',line.decode(encoding='UTF-8')).group(0)
                    cam = cam if cam else ''
                    flagcam = False
                if flagmic:
                    mic = re.search('".*"',line.decode(encoding='UTF-8')).group(0)
                    mic = mic if mic else ''
                    flagmic = False
                elif 'DirectShow video devices'.encode(encoding='UTF-8') in line:
                    flagcam = True
                elif 'DirectShow audio devices'.encode(encoding='UTF-8') in line:
                    flagmic = True
                elif 'Immediate exit requested'.encode(encoding='UTF-8') in line:
                    break
            return cam, mic   


    class ffmpegThread (Thread):
        def __init__(self, address):
            Thread.__init__(self)
            self.address = address

        def run(self):
            cam, mic = detect_devices()
            command = 'ffmpeg -f dshow -i video='+cam+':audio='+mic+' -profile:v high -pix_fmt yuvj420p -level:v 4.1 -preset ultrafast -tune zerolatency -vcodec libx264 -r 10 -b:v 512k -s 240x160 -acodec aac -ac 2 -ab 32k -ar 44100 -f mpegts -flush_packets 0 -t 40 udp://'+self.address+'?pkt_size=1316?localport='+str(localPort)
            p = Popen(command , stderr=PIPE)
            for line in iter(p.stderr.readline,''):
                if len(line) <5: break
            p.terminate()

    thread1 = ffmpegThread(address[0]+":"+str(address[1]))
    thread1.start()


    


    While on the other side I have :

    


        from threading import Thread
    import tkinter as tk
    import vlc

    class myframe(tk.Frame):
        def __init__(self, width=240, height=160):
            self.root = tk.Tk()
            super(myframe, self).__init__(self.root)
            self.root.geometry("%dx%d" % (width, height))
            self.root.wm_attributes("-topmost", 1)
            self.grid()
            self.frame = tk.Frame(self, width=240, height=160)
            self.frame.configure(bg="black")
            self.frame.grid(row=0, column=0, columnspan=2)
            self.play()
            self.root.mainloop()

        def play(self):
            self.player = vlc.Instance().media_player_new()
            self.player.set_mrl('udp://@0.0.0.0:5000')
            self.player.set_hwnd(self.frame.winfo_id())
            self.player.play()

    class guiThread (Thread):
        def __init__(self, nome):
            Thread.__init__(self)
            self.nome = nome

        def run(self):
            app = myframe()


    


    and :

    


        import socket

    msgFromClient       = "Hello UDP Server"
    bytesToSend         = str.encode(msgFromClient)
    serverAddressPort   = ("MYglobal_IPaddress", 1234)
    bufferSize          = 1024
    localPort   = 5000

    # Create a UDP socket at client side
    UDPClientSocket = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM) 
    UDPClientSocket.bind(("", localPort))

    UDPClientSocket.sendto(bytesToSend, serverAddressPort)

    msgFromServer = UDPClientSocket.recvfrom(bufferSize)
    msg = msgFromServer[0].decode("utf-8")
    print(msg)
    UDPClientSocket.close()
    gui = guiThread("ThreadGUI")
    gui.start()


    


    I'm not able to reach the client with the stream. I tested everything else so the problem should be in the way I try to reach the client

    


  • How Many Default Languages ?

    26 janvier 2012, par Multimedia Mike — Programming

    I was thinking back to my childhood, when my family first owned a computer. It was an MS-DOS-powered IBM PC. The default OS came with 2 programming environments, such as they were : GW-BASIC and batch files. It was a start, I suppose. I guess most any microcomputer you can name from that era came with some kind of BASIC interpreter. That defined the computer’s “out of the box” programmability.

    Then I started wondering how this compares to computers (operating systems/distributions, really) these days. So I installed a fresh version of the latest Ubuntu Linux version (11.10 as of this writing ; x86_32) and looked for programmability (without installing anything else). This is what I came up with :

    1. gcc/C (only the C compiler ; other components of the GNU compiler collection are installed separately)
    2. Perl
    3. Python
    4. C#, as furnished by Mono
    5. Bash — can’t forget about the shell as a full-featured programming language (sh is also present, but not t/csh)
    6. JavaScript — since Firefox is installed per default, JS counts
    7. GNU Assember — thanks to Reimar for the reminder that if gcc is present, gas necessarily needs to be there as well

    I checked on C++, Objective C, Java, Ada, Fortran, Go, Lua, Ruby, Tcl, PHP, R and other languages I could think of, but the above items were the only ones present by default. At the same time, I checked my Mac OS X (10.6) box and it also has Ruby and PHP installed. It has a bunch of other languages, courtesy of Xcode, so I can’t certify anything about its out of the box programmability.

    Still, I think “embarrassment of riches” pretty well sums it up. I try not to be crotchety old fogey complaining that kids these days don’t know how good they have it ; rather, I’m genuinely excited for anyone who wants to leap into computer programming in this day and age.

  • script ubuntu lucid : x264

    4 mars 2012

    Dans le log du script d’installation j’ai cette erreur :

    Téléchargement, compilation et installation de x264

    1. Initialized empty Git repository in /usr/local/src/x264/.git/
    2. Package x264 was not found in the pkg-config search path.
    3. Perhaps you should add the directory containing `x264.pc
    4. to the PKG_CONFIG_PATH environment variable
    5. No package ’x264’ found

    si je tape "echo $PKG_CONFIG_PATH" j’ai une ligne vide

    je suppose que la suite est en rapport :

    1. Makefile :3 : config.mak : Aucun fichier ou dossier de ce type
    2. cat : config.h : Aucun fichier ou dossier de ce type
    3. ./configure
    4. Found yasm 0.8.0.2194
    5. Minimum version is yasm-1.0.0
    6. If you really want to compile without asm, configure with —disable-asm.
    7. make : *** [config.mak] Erreur 1
    8. Found yasm 0.8.0.2194
    9. Minimum version is yasm-1.0.0
    10. If you really want to compile without asm, configure with —disable-asm.