
Recherche avancée
Médias (91)
-
Chuck D with Fine Arts Militia - No Meaning No
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Paul Westerberg - Looking Up in Heaven
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Le Tigre - Fake French
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Thievery Corporation - DC 3000
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Dan the Automator - Relaxation Spa Treatment
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Gilberto Gil - Oslodum
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (89)
-
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...) -
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...)
Sur d’autres sites (4638)
-
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.
-