
Recherche avancée
Autres articles (103)
-
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
Formulaire personnalisable
21 juin 2013, parCette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire. (...) -
Qu’est ce qu’un masque de formulaire
13 juin 2013, parUn masque de formulaire consiste en la personnalisation du formulaire de mise en ligne des médias, rubriques, actualités, éditoriaux et liens vers des sites.
Chaque formulaire de publication d’objet peut donc être personnalisé.
Pour accéder à la personnalisation des champs de formulaires, il est nécessaire d’aller dans l’administration de votre MediaSPIP puis de sélectionner "Configuration des masques de formulaires".
Sélectionnez ensuite le formulaire à modifier en cliquant sur sont type d’objet. (...)
Sur d’autres sites (5733)
-
Variable fps (frame per second) in cv2
17 octobre 2022, par SepideI use
cv2
for creating videos from different frames that I have. When I create the video, I cannot change the fps (frame per second). I want the video be slow at the beginning but fast towards the end, meaning small fps at the beginning but large ones towards the end. However, when I instantiatecv2.VideoWriter
I cannot change the fps anymore. What should I do ?

Replicable code


import numpy as np
import cv2, os
import matplotlib

image_size = 200
def create_image_array(image_size):
 image_array = np.random.randn(image_size, image_size)
 row = np.random.randint(0, image_size)
 image_array[row, :] = 100
 return image_array

frame_numbers = 200
for i in range(frame_numbers):
 image_array = create_image_array(image_size)
 matplotlib.image.imsave(f'./shots/frame_{i:03d}.png', image_array)

def make_a_video(shots_folder, video_path):

 shots_folder = 'shots'
 fps = 25
 images = [img for img in os.listdir(shots_folder) if img.endswith(".png")]

 images = sorted(images)[:]
 frame = cv2.imread(os.path.join(shots_folder, images[0]))
 height, width, layers = frame.shape

 video = cv2.VideoWriter(video_path, cv2.VideoWriter_fourcc(*'mp4v'), fps, (width, height))

 for image in images:
 video.write(cv2.imread(os.path.join(shots_folder, image)))

 cv2.destroyAllWindows()
 video.release()

shots_folder = 'shots'
video_path = 'video.mp4' 
make_a_video(shots_folder, video_path)



-
x86 : Remove inline MMX assembly that clobbers the FPU state
26 janvier 2024, par Martin Storsjöx86 : Remove inline MMX assembly that clobbers the FPU state
These inline implementations of AV_COPY64, AV_SWAP64 and AV_ZERO64
are known to clobber the FPU state - which has to be restored
with the 'emms' instruction afterwards.This was known and signaled with the FF_COPY_SWAP_ZERO_USES_MMX
define, which calling code seems to have been supposed to check,
in order to call emms_c() after using them. See
0b1972d4096df5879038f0af776f87f41e90ebd4,
29c4c0886d143790fcbeddbe40a23dfc6f56345c and
df215e575850e41b19aeb1fd99e53372a6b3d537 for history on earlier
fixes in the same area.However, new code can use these AV_*64() macros without knowing
about the need to call emms_c().Just get rid of these dangerous inline assembly snippets ; this
doesn't make any difference for 64 bit architectures anyway.Signed-off-by : Martin Storsjö <martin@martin.st>
-
How to create a local audio livestream server with ffmpeg and python ? [closed]
10 novembre 2024, par FenekhuSimply put, this is what I'm trying to accomplish :

I navigate to something likehttp://localhost:8080/
in my browser and the browser shows a built-in audio player playing whatever the ffmpeg process is streaming. (Not just serving a local audio file.) (Built-in here meaning the page looks the same as if you had opened an mp3 file with your browser.)

At first I thought it would be easy, as ffmpeg has the ability to stream through different protocols. I seem to have misunderstood though, because while I can stream something over rtp with it, I can't access that from my browser. Some stackoverflow questions I found seem to imply that you can do this with the output options
-f mpegts http://localhost:8080
, but when I try this, ffmpeg freezes for a second, then I get these errors :

[tcp @ 00000210f70b0700] Connection to tcp://localhost:8080 failed: Error number -138 occurred
[out#0/mpegts @ 00000210f7080ec0] Error opening output http://localhost:8080: Error number -138 occurred
Error opening output file http://localhost:8080.
Error opening output files: Error number -138 occurred



but I have no problem with
-f rtp rtp://localhost:8080
. (Like I said though, I can't access that through the browser).

So I suspect I need something else to "pick up" the rtp stream and put it on an http server, but I haven't been able to find anything on that, probably because I just don't know the right thing to search. It seems like something that should be easily doable in Python, and that would be my preferred language to do it in over javascript, if possible.


Can anyone point me in the right direction ? Or let me know if I'm misunderstanding something ? Thanks.