Recherche avancée

Médias (91)

Autres articles (54)

  • Submit enhancements and plugins

    13 avril 2011

    If you have developed a new extension to add one or more useful features to MediaSPIP, let us know and its integration into the core MedisSPIP functionality will be considered.
    You can use the development discussion list to request for help with creating a plugin. As MediaSPIP is based on SPIP - or you can use the SPIP discussion list SPIP-Zone.

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (6278)

  • 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

    


  • 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.
  • Anomalie #4276 (Fermé) : fonctions non définies dans porte_plume_pipelines.php

    23 janvier 2019, par François Palangié

    Environnement :

    Problème :
    Le site fonctionne, mais quand on tente d’accéder à la partie privée on a ce message d’erreur, qui persiste même après une réinstallation de SPIP :
    Fatal error : Uncaught Error : Call to undefined function barre_outils_css_icones() in /var/www/vhosts/voyart.org/httpdocs/plugins-dist/porte_plume/porte_plume_pipelines.php:152 
    Stack trace : 
    #0 /var/www/vhosts/voyart.org/httpdocs/plugins-dist/porte_plume/porte_plume_pipelines.php(129) : porte_plume_insert_head_css(’
    &lt;script type=&quot;t...', true) <br />
    #1 /var/www/vhosts/voyart.org/httpdocs/ecrire/inc/utils.php(199): porte_plume_insert_head_prive_css('&lt;script type=&quot;t...') <br />
    #2 /var/www/vhosts/voyart.org/httpdocs/tmp/cache/charger_pipelines.php(596): minipipe('porte_plume_ins...', '&lt;script type=&quot;t...') <br />
    #3 /var/www/vhosts/voyart.org/httpdocs/ecrire/inc/utils.php(265): execute_pipeline_header_prive_css('&lt;script type=&quot;t...') <br />
    #4 /var/www/vhosts/voyart.org/httpdocs/tmp/cache/skel/html_c44cf6e196e37af7575f04c7aba04247.php(72): pipeline('header_prive_cs...', '&lt;script type=&quot;t...') <br />
    #5 /var/www/vhosts/voyart.org/httpdocs/ecrire/public/parametrer.php(128): html_c44cf6e196e37af7575f04c7aba04247(Array, Array) <br />
    #6 /var/www/vhosts/voyart.org/httpdocs/ecr in /var/www/vhosts/voyart.org/httpdocs/plugins-dist/porte_plume/porte_plume_pipelines.php on line 152<br />
    &lt;/pre&gt;&lt;/h2&gt;<br />
    <br />
    <br />
            &lt;p&gt;Le problème est contourné en renommant le répertoire plugin-dist/porteplume&lt;br /&gt;Le problème ne dépend pas du navigateur firefox, edge, chrome&lt;br /&gt;Aucun problème sur le SPIP de développement installé avec EasyPHP-devserver sur mon ordinateur perso&lt;/p&gt;