
Recherche avancée
Médias (1)
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (75)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
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 (...)
Sur d’autres sites (8873)
-
Trying to convert an mp3 file to a Numpy Array, and ffmpeg just hangs
5 juillet 2016, par RichI’m working on a music classification methodology with Scikit-learn, and the first step in that process is converting a music file to a numpy array.
After unsuccessfully trying to call ffmpeg from a python script, I decided to simply pipe the file in directly :
FFMPEG_BIN = "ffmpeg"
cwd = (os.getcwd())
dcwd = (cwd + "/temp")
if not os.path.exists(dcwd): os.makedirs(dcwd)
folder_path = sys.argv[1]
f = open("test.txt","a")
for f in glob.glob(os.path.join(folder_path, "*.mp3")):
ff = f.replace("./", "/")
print("Name: " + ff)
aa = (cwd + ff)
command = [ FFMPEG_BIN,
'-i', aa,
'-f', 's16le',
'-acodec', 'pcm_s16le',
'-ar', '22000', # ouput will have 44100 Hz
'-ac', '1', # stereo (set to '1' for mono)
'-']
pipe = sp.Popen(command, stdout=sp.PIPE, bufsize=10**8)
raw_audio = pipe.proc.stdout.read(88200*4)
audio_array = numpy.fromstring(raw_audio, dtype="int16")
print (str(audio_array))
f.write(audio_array + "\n")The problem is, when I run the file, it starts ffmpeg and then does nothing :
[mp3 @ 0x1446540] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '/home/don/Code/Projects/MC/Music/Spaz.mp3':
Metadata:
title : Spaz
album : Seeing souns
artist : N*E*R*D
genre : Hip-Hop
encoder : Audiograbber 1.83.01, LAME dll 3.96, 320 Kbit/s, Joint Stereo, Normal quality
track : 5/12
date : 2008
Duration: 00:03:50.58, start: 0.000000, bitrate: 320 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
Output #0, s16le, to 'pipe:':
Metadata:
title : Spaz
album : Seeing souns
artist : N*E*R*D
genre : Hip-Hop
date : 2008
track : 5/12
encoder : Lavf56.4.101
Stream #0:0: Audio: pcm_s16le, 22000 Hz, mono, s16, 352 kb/s
Metadata:
encoder : Lavc56.1.100 pcm_s16le
Stream mapping:
Stream #0:0 -> #0:0 (mp3 (native) -> pcm_s16le (native))
Press [q] to stop, [?] for helpIt just sits there, hanging, for far longer than the song is. What am I doing wrong here ?,
-
Trying to convert an mp3 file to a Numpy Array, and ffmpeg just hangs
29 mai 2021, par RichI'm working on a music classification methodology with Scikit-learn, and the first step in that process is converting a music file to a numpy array.



After unsuccessfully trying to call ffmpeg from a python script, I decided to simply pipe the file in directly :



FFMPEG_BIN = "ffmpeg"
cwd = (os.getcwd())
dcwd = (cwd + "/temp")
if not os.path.exists(dcwd): os.makedirs(dcwd)

folder_path = sys.argv[1]
f = open("test.txt","a")

for f in glob.glob(os.path.join(folder_path, "*.mp3")):
 ff = f.replace("./", "/")
 print("Name: " + ff)
 aa = (cwd + ff)

 command = [ FFMPEG_BIN,
 '-i', aa,
 '-f', 's16le',
 '-acodec', 'pcm_s16le',
 '-ar', '22000', # ouput will have 44100 Hz
 '-ac', '1', # stereo (set to '1' for mono)
 '-']

 pipe = sp.Popen(command, stdout=sp.PIPE, bufsize=10**8)
 raw_audio = pipe.proc.stdout.read(88200*4)
 audio_array = numpy.fromstring(raw_audio, dtype="int16")
 print (str(audio_array))
 f.write(audio_array + "\n")




The problem is, when I run the file, it starts ffmpeg and then does nothing :



[mp3 @ 0x1446540] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '/home/don/Code/Projects/MC/Music/Spaz.mp3':
 Metadata:
 title : Spaz
 album : Seeing souns
 artist : N*E*R*D
 genre : Hip-Hop
 encoder : Audiograbber 1.83.01, LAME dll 3.96, 320 Kbit/s, Joint Stereo, Normal quality
 track : 5/12
 date : 2008
 Duration: 00:03:50.58, start: 0.000000, bitrate: 320 kb/s
 Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
Output #0, s16le, to 'pipe:':
 Metadata:
 title : Spaz
 album : Seeing souns
 artist : N*E*R*D
 genre : Hip-Hop
 date : 2008
 track : 5/12
 encoder : Lavf56.4.101
 Stream #0:0: Audio: pcm_s16le, 22000 Hz, mono, s16, 352 kb/s
 Metadata:
 encoder : Lavc56.1.100 pcm_s16le
Stream mapping:
 Stream #0:0 -> #0:0 (mp3 (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help




It just sits there, hanging, for far longer than the song is. What am I doing wrong here ?,


-
discord.py 0pusError:Invalid Argument M1 Pro Macbook
16 juin 2022, par xuo

Traceback (most recent call last):
 File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/core.py", line 85, in wrapped
 ret = await coro(*args, **kwargs)
 File "/Users/xuo/Desktop/coding stuff/musicbot/music.py", line 158, in play
 await self.play_song(ctx, song) #involes player
 File "/Users/xuo/Desktop/coding stuff/musicbot/music.py", line 47, in play_song
 ctx.voice_client.play(discord.PCMVolumeTransformer(discord.FFmpegPCMAudio(url)), after=lambda error: self.bot.loop.create_task(self.check_queue(ctx)))
 File "/opt/homebrew/lib/python3.9/site-packages/discord/voice_client.py", line 564, in play
 self.encoder = opus.Encoder()
 File "/opt/homebrew/lib/python3.9/site-packages/discord/opus.py", line 290, in __init__
 self.set_bitrate(128)
 File "/opt/homebrew/lib/python3.9/site-packages/discord/opus.py", line 308, in set_bitrate
 _lib.opus_encoder_ctl(self._state, CTL_SET_BITRATE, kbps * 1024)
 File "/opt/homebrew/lib/python3.9/site-packages/discord/opus.py", line 92, in _err_lt
 raise OpusError(result)
discord.opus.OpusError: invalid argument

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
 File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 939, in invoke
 await ctx.command.invoke(ctx)
 File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/core.py", line 863, in invoke
 await injected(*ctx.args, **ctx.kwargs)
 File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/core.py", line 94, in wrapped
 raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: OpusError: invalid argument