
Recherche avancée
Médias (1)
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
Autres articles (21)
-
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...) -
Les statuts des instances de mutualisation
13 mars 2010, parPour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...) -
Problèmes fréquents
10 mars 2010, parPHP et safe_mode activé
Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site
Sur d’autres sites (4021)
-
FFMpegWriter not using the bitrate specified ? Animation is very blurry
18 mai 2022, par ceboI am using
matplotlib
'sFunAnimation
as well asFFMpegWriter
to try to write a simulation animation to a file. I'd like to save a high quality version of it, but when I increase thebitrate
value of the writer, the actual bitrate of the.mp4
it creates seems to increase in discrete steps up to a fairly low value after which it doesn't increase any more whatsoever.

My code is roughly :


dpi = 96
fig = plt.figure(figsize=(width/dpi, height/dpi), dpi=dpi)
anim = FuncAnimation(fig, myAnimation, frames=100, interval=1, blit=True)
writer = animation.FFMpegWriter(fps=10, bitrate=<some number="number">)
anim.save('MyAnimation.mp4', writer=writer)
</some>


The animation is only 200x200px so I feel like it shouldn't be a problem to have a high quality video, but I can't seem to get a high enough bitrate. For the following bitrates specified in my code, the actual bitrate shown in the files properties are :


BR In Code => Actual BR (kbps)
-1 / None => 13
100 => 58
1000 => 76
10000 => 76



The bitrate doesn't seem to track very well at all, and won't go above
76kbps
at all. The video is still badly blurry at this bitrate.

What do I need to do to increase the bitrate or else the quality of the video file ?


Alternatively, is there a better video format/writer to use for this purpose ? Specifically one that is broadly supported so I could embed it in a website or upload it to YouTube or something like that.


Edit :


To be more specific about the issue, neighboring pixels are being blended together, resulting in a blurry look. The following imgur album shows several examples with different settings :




These include the view in the figure window from
plt.show()
, default bitrate, a "high" bitrate, and something else I just tried which was to increase the dpi. While the results are much nicer it also nearly doubled the execution time so I'd like to avoid it.

It seems silly to have to upscale what is effectively "pixel art" in order for it to look good, but I guess this is an artifact of the signal processing approach mpeg uses, which is why I suspect a different file format might be the best solution for small framed animations like this. If I wanted to do a 1920*1080 animation the blurring would probably be less of an issue.


-
How could I create a fps=1 mp4 video using FFMpegWriter from matplotlib.animation ?
3 août 2024, par liubenyuanI would like to create a video to visualize a small dataset. This dataset contains only 10 or 20 frames of data, and I want to visualize it one frame a second and make a .mp4 video using FFMpegWriter.


But when I set fps=1, there is a long time black screen of the result video and only a still image. After that, this .mp4 ends. An example of code is as follows :


import numpy as np
from matplotlib.animation import FFMpegWriter

np.random.seed(0)
fig, ax = plt.subplots(figsize=(9, 4))
ln, = ax.plot([])
ax.set_xlim([0, 1000])
ax.set_ylim([-1, 1])
ax.grid(True)

writer = FFMpegWriter(fps=1)
with writer.saving(fig, "writer_test.mp4", 300):
 for i in range(20):
 x = np.arange(1000)
 t = np.random.randn(1000)
 y = np.sin(2 * np.pi * t)
 ln.set_data(x, y)
 writer.grab_frame()
plt.show()



If I change fps to 10, then the video flows well but end too soon. Can I grab and make videos one frame per second ?


-
swscale : aarch64 : Optimize the final summation in the hscale routine
20 avril 2022, par Martin Storsjöswscale : aarch64 : Optimize the final summation in the hscale routine
Before : Cortex A53 A72 A73 Graviton 2 Graviton 3
hscale_8_to_15_width8_neon : 8273.0 4602.5 4289.5 2429.7 1629.1
hscale_8_to_15_width16_neon : 12405.7 6803.0 6359.0 3549.0 2378.4
hscale_8_to_15_width32_neon : 21258.7 11491.7 11469.2 5797.2 3919.6
hscale_8_to_15_width40_neon : 25652.0 14173.7 12488.2 6893.5 4810.4After :
hscale_8_to_15_width8_neon : 7633.0 3981.5 3350.2 1980.7 1261.1
hscale_8_to_15_width16_neon : 11666.7 5951.0 5512.0 3080.7 2131.4
hscale_8_to_15_width32_neon : 20900.7 10733.2 9481.7 5275.2 3862.1
hscale_8_to_15_width40_neon : 24826.0 13536.2 11502.0 6397.2 4731.9Thus, this gives overall a 8-29% speedup for the smaller filter
sizes, around 1-8% for the larger filter sizes.Inspired by a patch by Jonathan Swinney <jswinney@amazon.com>.
Signed-off-by : Martin Storsjö <martin@martin.st>