
Recherche avancée
Autres articles (58)
-
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
Le plugin : Gestion de la mutualisation
2 mars 2010, parLe plugin de Gestion de mutualisation permet de gérer les différents canaux de mediaspip depuis un site maître. Il a pour but de fournir une solution pure SPIP afin de remplacer cette ancienne solution.
Installation basique
On installe les fichiers de SPIP sur le serveur.
On ajoute ensuite le plugin "mutualisation" à la racine du site comme décrit ici.
On customise le fichier mes_options.php central comme on le souhaite. Voilà pour l’exemple celui de la plateforme mediaspip.net :
< ?php (...)
Sur d’autres sites (7014)
-
How does MPG determine its default audio track ?
1er octobre 2022, par codedreadI have some mpg files that I transcoded from DVDs I bought a long time ago (maybe 20 years ago). ffprobe :


Input #0, mpeg, from 'da-orig.mpg':
 Duration: 00:06:59.44, start: 0.044100, bitrate: 6354 kb/s
 Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, progressive), 720x480 [SAR 8:9 DAR 4:3], Closed Captions, 31 fps, 59.94 tbr, 90k tbn
 Side data:
 cpb: bitrate max/min/avg: 7500000/0/0 buffer size: 1835008 vbv_delay: N/A
 Stream #0:1[0x85]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
 Stream #0:2[0x83]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
 Stream #0:3[0x81]: Audio: ac3, 48000 Hz, mono, fltp, 192 kb/s
 Stream #0:4[0x80]: Audio: ac3, 48000 Hz, mono, fltp, 192 kb/s



This shows there are 4 audio streams. When I play this file in VLC / QuickTime it seems that Audio Track 4 is the default. I'd like to understand how this is chosen. Is it something within the mpg container format or are players choosing the stream that has the lowest id (0x80) ?


More background, when I try to turn this into a mp4 file with the following command :


ffmpeg -i da-orig.mpg -c copy -map 0 da-copy.mp4


I get roughly the same size file, but the default audio track is stream #0:1[0x85].


What I want is an equivalent mp4 file (so the same audio track chosen).


-
Mimic Audacity amplification with Pydub
16 août 2022, par UnisionzzFor my music library I have used Audacity for recent years to amplify the music to similar levels of loudness ; technically speaking this is not completely true, but for me it is sufficient. However, as it is tedious to do this all by hand, I decided to write a Python code to automate this process for me. The code after the imported package(s) and defined functions will run in a loop in which the filename changes depending on which song is processed.


The difficult part is that I have not yet been able to find a consistent way to amplify different songs so that when the output files are put through Audacity, it will not want to change the amplitude by more than 0.1 dB(FS).


Below are two attempts which seem to have come closest to the desirable output ; other methods that I have tried were either less succesfull or resulted in clipping.


The first attempt finds the maximum dBFS of the song and then applies a gain in order for the maximum dBFS to equal 0 (I have also tried this method with
sound.dBFS
andsound.apply_gain
, but results seem more mixed than the attempt below) :

from pydub import AudioSegment

def change_amplitude(sound, target_dBFS):
 change_in_dBFS = target_dBFS - sound.max_dBFS
 return sound.apply_gain_stereo(change_in_dBFS)

# Audio is gathered from a hard coded path
s = AudioSegment.from_file(Dir+filename+".mp3", "mp3")
amp_s = change_amplitude(s, 0)
amp_s.export(Dir+filename+".mp3", format = "mp3")



The second attempt finds the amplitude and the maximum allowable amplitude (before clipping), recalculates both to dB and then adds the
dB_diff
to the sound :

import numpy as np
from pydub import AudioSegment

s = AudioSegment.from_file(Dir+filename+".mp3", "mp3")

# Get dB amplitude of song and maximum allowable value
dB_sound = 20*np.log10(s.max)
dB_max = 20*np.log10(s.max_possible_amplitude)
dB_diff = dB_max - dB_sound

amp_sound = s + dB_diff



Summarizing, I would like to import a music file, amplify it similar to Audacity amplification and then export the file again.


-
Recommendation : Video format process NodeJS
13 août 2022, par Austin HowardI am looking for the best recommendation for formatting videos ona nodejs server. In all my research i keep getting pointed back to
ffmpeg
but it doesnt look very friendly to a Nodejs app, i've seenfluent-ffmpeg
andnode-ffmpeg
and a couple others, but at this point they are a couple years old, and if im going to use a node package id like for them to be udpated a bit more. Do you guys have any recommendations for current software that will be decent for converting and compressing videos for upload ? I have a use case where i sometimes have 2-3gb files that i want to get down to somewhere around 500-1gb in size. As well as generating thumbnails from that video, or if you guys have good documentation to point me to that would allow me to use the ffmpeg executable alone i can make that work too.