
Recherche avancée
Autres articles (64)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (5280)
-
Python pipe ffmpeg stream to numpy in realtime
29 mai 2020, par Dadidumim trying to get the frames out of a rtp stream via ffmpeg in realtime in python. At my server the frames are piped from numpy arrays into ffmpeg and should be at the client piped back to numpy for further manipulation. The server creates a sdp file which is given as input to the client. 
It looks like this :



v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 127.0.0.1
t=0 0
a=tool:libavformat 58.42.102
m=video 5004 RTP/AVP 96
b=AS:19000
a=rtpmap:96 H265/90000




With ffplay or VLC the stream can be received but with my python code not, at first needs ca. 5sec for each frame and the image is just some random coloured pixels.
The client :



dimension = '{}x{}'.format(480, 240)
sdf_file = "video.sdp"

command = ['FFMPEG',
 '-protocol_whitelist', 'udp,rtp,file,pipe,crypto,data',
 '-i', sdf_file,
 '-pix_fmt', 'bgr24',
 '-r', '24',
 '-video_size', dimension,
 '-f', 'image2pipe', '-']

size = 480 * 240 * 3
proc = sp.Popen(command, stdout=sp.PIPE)

while True:
 try:
 tic = time.perf_counter()
 frame = proc.stdout.read(size)
 print(frame)
 if frame is None:
 print('no input')
 break
 image = np.frombuffer(frame, dtype='uint8').reshape(240, 480, 3)
 toc = time.perf_counter()
 print(f"performed calc in {(toc - tic) * 1000:0.4f} miliseconds")
 cv2.imshow('received', image)
 except Exception as e:
 print(e)

cv2.destroyAllWindows()
proc.stdin.close()
proc.wait()




Any ideas, how i can get the frames in realtime ? Thanky for your help


-
Passing python's file like object to ffmpeg via subprocess
3 juillet 2012, par tejinderssI have a django FileField, which i use to store wav files on the Amazon s3 server. I have set up the celery task to read that file and convert it to mp3 and store it to another FileField. Problem i am facing is that i am unable to pass the input file to ffmpeg as the file is not the physical file on the hard disk drive. To circumvent that, i used stdin to feed the input stream of the file with the django's filefield. Here is the example :
output_file = NamedTemporaryFile(suffix='.mp3')
subprocess.call(['ffmpeg', '-y', '-i', '-', output_file.name], stdin=recording_wav)where recording_wav file is : , which is actually stored on the amazon s3 server.
The error for the above subprocess call is :AttributeError: 'cStringIO.StringO' object has no attribute 'fileno'
How can i do this ? Thanks in advance for the help.
Edit :
Full traceback :
[2012-07-03 04:09:50,336: ERROR/MainProcess] Task api.tasks.convert_audio[b7ab4192-2bff-4ea4-9421-b664c8d6ae2e] raised exception: AttributeError("'cStringIO.StringO' object has no attribute 'fileno'",)
Traceback (most recent call last):
File "/home/tejinder/envs/tmai/local/lib/python2.7/site-packages/celery/execute/trace.py", line 181, in trace_task
R = retval = fun(*args, **kwargs)
File "/home/tejinder/projects/tmai/../tmai/apps/api/tasks.py", line 56, in convert_audio
subprocess.Popen(['ffmpeg', '-y', '-i', '-', output_file.name], stdin=recording_wav)
File "/usr/lib/python2.7/subprocess.py", line 672, in __init__
errread, errwrite) = self._get_handles(stdin, stdout, stderr)
File "/usr/lib/python2.7/subprocess.py", line 1043, in _get_handles
p2cread = stdin.fileno()
File "/home/tejinder/envs/tmai/local/lib/python2.7/site-packages/django/core/files/utils.py", line 12, in <lambda>
fileno = property(lambda self: self.file.fileno)
File "/home/tejinder/envs/tmai/local/lib/python2.7/site-packages/django/core/files/utils.py", line 12, in <lambda>
fileno = property(lambda self: self.file.fileno)
AttributeError: 'cStringIO.StringO' object has no attribute 'fileno'
</lambda></lambda> -
Revision 3606b78108 : Modified test for auto key frame detection. The existing test was triggering a
16 avril 2015, par paulwilkinsChanged Paths :
Modify /vp9/encoder/vp9_firstpass.c
Modified test for auto key frame detection.The existing test was triggering a lot of false positives on some types
of animated material with very plain backgrounds. These were triggering
code designed to catch key frames in letter box format clips.This patch tightens up the criteria and imposes a minimum requirement
on the % blocks coded intra in the first pass and the ratio between the
% coded intra and the modified inter % after discounting neutral (flat)
blocks that are coded equally well either way.On a particular problem animation clip this change eliminated a large
number of false positives including some cases where the old code
selected kf several times in a row. Marginal false negatives are less
damaging typically to compression and in the problem clip there are now
a couple of cases where "visual" scene cuts are ignored because of well
correlated content across the scene cut.Replaced some magic numbers related to this with #defines and added
explanatory comments.Change-Id : Ia3d304ac60eb7e4323e3817eaf83b4752cd63ecf