
Recherche avancée
Médias (1)
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (16)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains 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, parPré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 2013Puis-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 xKedarI'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 — ProgrammingI 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 :
- gcc/C (only the C compiler ; other components of the GNU compiler collection are installed separately)
- Perl
- Python
- C#, as furnished by Mono
- Bash — can’t forget about the shell as a full-featured programming language (sh is also present, but not t/csh)
- JavaScript — since Firefox is installed per default, JS counts
- 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 2012Dans le log du script d’installation j’ai cette erreur :
Téléchargement, compilation et installation de x264
-
Initialized empty Git repository in /usr/local/src/x264/.git/
-
Package x264 was not found in the pkg-config search path.
-
Perhaps you should add the directory containing `x264.pc’
-
to the PKG_CONFIG_PATH environment variable
-
No package ’x264’ found
si je tape "echo $PKG_CONFIG_PATH" j’ai une ligne vide
je suppose que la suite est en rapport :
-
Makefile :3 : config.mak : Aucun fichier ou dossier de ce type
-
cat : config.h : Aucun fichier ou dossier de ce type
-
./configure
-
Found yasm 0.8.0.2194
-
Minimum version is yasm-1.0.0
-
If you really want to compile without asm, configure with —disable-asm.
-
make : *** [config.mak] Erreur 1
-
Found yasm 0.8.0.2194
-
Minimum version is yasm-1.0.0
-
If you really want to compile without asm, configure with —disable-asm.
-