
Recherche avancée
Médias (91)
-
Valkaama DVD Cover Outside
4 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
Valkaama DVD Label
4 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Valkaama DVD Cover Inside
4 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
1,000,000
27 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Demon Seed
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Four of Us are Dying
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (87)
-
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community. -
Librairies et logiciels spécifiques aux médias
10 décembre 2010, parPour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...) -
Configuration spécifique pour PHP5
4 février 2011, parPHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
Modules spécifiques
Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)
Sur d’autres sites (4821)
-
How to save animations with tight layout, transparency and in high quality
23 octobre 2023, par mapfI am trying to implement an option in my GUI to save an image sequence displayed using matplotlib. The code looks something like this :



import matplotlib.pyplot as plt
from matplotlib.backends.backend_qt5agg import \
 FigureCanvasQTAgg as FigureCanvas
from matplotlib.animation import FuncAnimation
from PIL import Image


plt.rcParams['savefig.bbox'] = 'tight' 


class Printer:
 def __init__(self, data):
 self.fig, self.ax = plt.subplots()
 self.canvas = FigureCanvas(self.fig)

 # some irrelevant color adjustment here
 #self.ax.spines['bottom'].set_color('#f9f2d7')
 #self.ax.spines['top'].set_color('#f9f2d7')
 #self.ax.spines['right'].set_color('#f9f2d7')
 #self.ax.spines['left'].set_color('#f9f2d7')
 #self.ax.tick_params(axis='both', colors='#f9f2d7')
 #self.ax.yaxis.label.set_color('#f9f2d7')
 #self.ax.xaxis.label.set_color('#f9f2d7')
 #self.fig.subplots_adjust(left=0.1, right=0.975, bottom=0.09, top=0.98)
 self.fig.patch.set_alpha(0)
 self.fig.patch.set_visible(False)
 self.canvas.setStyleSheet("background-color:transparent;")
 self.fig.set_size_inches(10, 10, True)
 self.fig.tight_layout()

 self.data = data
 self.image_artist = self.ax.imshow(data[0])

 def animate(self, i):
 self.image_artist.set_data(self.data[i])
 self.canvas.draw()


def save_animation():
 data = [
 Image.open("test000.png"),
 Image.open("test001.png"),
 ]
 file = 'test.gif'
 printer = Printer(data)

 ani = FuncAnimation(
 printer.fig, printer.animate, interval=100, frames=len(data),
 )
 # writer = animation.writers['pillow'](bitrate=1000)
 ani.save(
 file, writer='pillow', savefig_kwargs={'transparent': True, 'bbox_inches': 'tight'}
 )


save_animation()




Transparency :



As you can see I have already tried several different approaches as suggested elsewhere (1, 2), but didn't manage to find a solution. All of the settings and arguments
patch.set_alpha(0)
,patch.set_visible(False)
,canvas.setStyleSheet("background-color:transparent;")
,savefig_kwargs={'transparent': True}
seem to have no effect at all on the transparency. I found this post but I didn't get the code to work (for one I had to comment out this%matplotlib inline
, but then I ended up getting some error during the MovieWriter.cleanupout = TextIOWrapper(BytesIO(out)).read() TypeError: a bytes-like object is required, not 'str'
). Here, it was suggested that this is actually a bug, but the proposed workaroud doesn't work for me since I would have to rely on third-party software. There also exists this bug report which was supposedly solved, so maybe it is unrelated.


Tight layout



I actually couldn't really find much on this, but all the things I tried (
plt.rcParams['savefig.bbox'] = 'tight'
,fig.tight_layout()
,savefig_kwargs={'bbox_inches': 'tight'}
) don't have any effect or are even actively discarded in the case of thebbox_inches argument
. How does this work ?


High quality



Since I cannot use
ImageMagick
and can't getffmpeg
to work (more on this below), I rely on pillow to save my animation. But the only argument in terms of quality that I can pass on seems to be thebitrate
, which doesn't have any effect. The files still have the same size and the animation still looks like mush. The only way that I found to increase the resolution was to usefig.set_size_inches(10, 10, True)
, but this still doesn't improve the overall quality of the animation. It still looks bad. I saw that you can pass oncodec
andextra_args
so maybe that is something that might help, but I have no idea how to use these because I couldn't find a list with allowed arguments.


ffmpeg



I can't get ffmpeg to work. I installed the python package from here and can import it into a python session but I don't know how I can get matplotlib to use that. I also got ffmpeg from here (Windows 64-bit version) and set the
plt.rcParams['animation.ffmpeg_path']
to where I saved the files (there was no intaller to run, not sure if I did it correctly). But this didn't help either. Also this is of course also third-party software, so if somebody else were to use my code/program it wouldn't work.

-
ffmpeg - MXF with 4-channel audio : how to create proxies (high quality / small file size) and preserve the audio mapping
8 juillet 2018, par WhatsYourFunctionWe’ve got MXF sources (h.264 video at UHD (3840x2160) with 4-channels of (4 - PCM S24 mono sources)
We want Proxies — smallest file size at highest picture quality
The compression applied to the video and audio essences can be anything,
And the wrapper can be either MXF or QuickTime
but we need to preserve the audio mapping (i.e. the Proxy must be 4-channel audio)How to do that with ffmpeg ?
- EDIT Adding ffprobe :
Metadata :
uid : ***
generation_uid : ***
company_name : CANON
product_name : EOS C300 Mark II
product_version : 1.00
product_uid : ***
modification_date : 2018-06-28T08:29:24.000000Z
material_package_umid : ***
timecode : 02:50:31:17
Duration : 00:06:35.40, start : 0.000000, bitrate : 395842 kb/s
Stream #0:0 : Video : h264 (High 4:2:2 Intra), yuv422p10le(tv, progressive), 3840x2160, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 23.98 tbn, 47.95 tbc
Metadata :
file_package_umid: ***
Stream #0:1 : Audio : pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
Metadata :
file_package_umid: ***
Stream #0:2 : Audio : pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
Metadata :
file_package_umid: ***
Stream #0:3 : Audio : pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
Metadata :
file_package_umid: ***
Stream #0:4 : Audio : pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
Metadata :
file_package_umid: ***
-
How to set H264 NVENC encoding parameters to output high-quality video stream ?
8 février 2021, par fredirty2017- 

- I use NVENC (nvEncodeAPI) interface hardware encoding H264, and then RTMP to stream out, when using ffplay to pull the stream to watch, I found that the picture is obviously distorted : the green lines become sharper ? the text color becomes lighter and blurred, it is not improved even if I increase the video bitrate to 3Mbps(720P). I also know that H264 encoding is lossy, and some information will be discarded.
- Then I try to adjust the NV_ENC_CONFIG_H264_VUI_PARAMETERS parameter : when set color-space to "pc, bt709", there are some minor improvements. Maybe the color-space setting has more potential for improvement ? For NVENC encoding, is there a higher video clarity setting scheme ? I don't know how much space for technical improvement is here ?


based on the code : https://github.com/obsproject/obs-studio/blob/master/plugins/obs-ffmpeg/obs-ffmpeg-nvenc.c