Recherche avancée

Médias (0)

Mot : - Tags -/alertes

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (75)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

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

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

Sur d’autres sites (10442)

  • vlc python stream from other NAT

    7 octobre 2020, par xKedar

    I'm trying to stream, using FFmpeg, my webcam and audio from PC1 to PC2 in another LAN.

    


    PC1 : Public IP address with port forwarding so I can reach it

    


    PC2 : In a different NAT from PC1

    


    I basically run a server on PC1 in order to acquire IP and port from PC2 and reply on the same address

    


        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 the same port number both for the server(localPort) and the 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(PC2) 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()


    


    Where I basically try to reach the server both to send my IP:Port and to punch a hole in the NAT in order to be able to get the packages sent from PC1 despite being behind a NAT.

    


    I guess this is not working because I can not get the stream to work but I really can not figure out how to fix that

    


  • build : Let all MJPEG-related decoders depend on the MJPEG decoder

    28 février 2014, par Diego Biurrun
    build : Let all MJPEG-related decoders depend on the MJPEG decoder
    

    These codecs compile all of the MJPEG code anyway, so there is little
    point in not enabling the MJPEG decoder directly. This also simplifies
    the dependency declarations for the MJPEG codec family.

    • [DBH] configure
    • [DBH] libavcodec/Makefile
  • fftools/ffmpeg_filter : simplify choose_pix_fmts

    25 octobre 2023, par Niklas Haas
    fftools/ffmpeg_filter : simplify choose_pix_fmts
    

    The only meaningful difference between choose_pix_fmts and the default
    code was the inclusion of an extra branch for `keep_pix_fmt` being true.

    However, in this case, we either :
    1. Force the specific `ofp->format` that we inherited from
    ofilter_bind_ost, or if no format was set :
    2. Print an empty format list

    Both of these goals can be accomplished by simply moving the decision
    logic to ofilter_bind_ost, to avoid setting any format list when
    keep_pix_fmt is enabled. This is arguably cleaner as it moves format
    selection logic to a single function. In the case of branch 1, nothing
    else needs to be done as we already force the format provided in
    ofp->format, if any is set. Add an assertion to verify this assumption
    just in case.

    (Side note : The "choose_*" family of functions are arguably misnomers,
    as they should really be called "print_*" - their current behavior is to
    print the relevant format lists to the `vf/af_format` filter arguments)

    Signed-off-by : Anton Khirnov <anton@khirnov.net>
    Signed-off-by : Niklas Haas <git@haasn.dev>

    • [DH] fftools/ffmpeg_filter.c