
Recherche avancée
Médias (2)
-
Valkaama DVD Label
4 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Podcasting Legal guide
16 mai 2011, par
Mis à jour : Mai 2011
Langue : English
Type : Texte
Autres articles (112)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (8452)
-
How to fix out of bounds error in to_soundarray in moviepy ?
16 décembre 2019, par Rad0nThe code works with the default youtube_dl name but not outtmpl name that I put in ydl_opts
the solution given here - https://www.reddit.com/r/moviepy/comments/dwc27w/to_sound_array_issue/
doesnt seem to workhere is the code -
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import moviepy.editor as mpy
!pip install youtube_dl
import youtube_dl
url = 'https://www.youtube.com/watch?v=5pIpVK3Gecg'
start_ts = 170
end_ts = 180
ydl_opts = {
'format': 'bestaudio/best',
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'wav',
'preferredquality': '192',
}],
'outtmpl': 'original.wav',
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download([url])
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
ffmpeg_extract_subclip('original.wav' ,170, 180, targetname='clipped.wav')
talk = mpy.AudioFileClip('clipped.wav')
plt.axis('off')
sample_rate = talk.fps
NFFT = sample_rate /25
audio_data = talk.to_soundarray()
fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(2.44, 2.44), dpi=100.)
ax.axis('off')
spectrum, freqs, time, im = ax.specgram(audio_data.mean(axis=1), NFFT=NFFT, pad_to=4096, Fs=sample_rate,
noverlap=512, mode='magnitude', )and here is the error -
[youtube] 5pIpVK3Gecg: Downloading webpage
[youtube] 5pIpVK3Gecg: Downloading video info webpage
[download] original.wav has already been downloaded
[download] 100% of 48.12MiB
[ffmpeg] Correcting container in "original.wav"
[ffmpeg] Post-process file original.wav exists, skipping
[MoviePy] Running:
>>> /root/.imageio/ffmpeg/ffmpeg-linux64-v3.3.1 -y -i original.wav -ss 170.00 -t 10.00 -vcodec copy -acodec copy clipped.wav
... command successful.
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/moviepy/audio/io/readers.py in get_frame(self, tt)
189 indices = indices - (self.buffersize // 2 - len(self.buffer) + 1)
--> 190 result[in_time] = self.buffer[indices]
191 return result
IndexError: index -59041 is out of bounds for axis 0 with size 40960
During handling of the above exception, another exception occurred:
IndexError Traceback (most recent call last)
10 frames
in <module>()
30
31 NFFT = sample_rate /25
---> 32 audio_data = talk.to_soundarray()
33
34 fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(2.44, 2.44), dpi=100.)
local/lib/python3.6/dist-packages/decorator.py:decorator-gen-194> in to_soundarray(self, tt, fps, quantize, nbytes, buffersize)
/usr/local/lib/python3.6/dist-packages/moviepy/decorators.py in requires_duration(f, clip, *a, **k)
52 raise ValueError("Attribute 'duration' not set")
53 else:
---> 54 return f(clip, *a, **k)
55
56
/usr/local/lib/python3.6/dist-packages/moviepy/audio/AudioClip.py in to_soundarray(self, tt, fps, quantize, nbytes, buffersize)
115 if self.duration > max_duration:
116 return stacker(self.iter_chunks(fps=fps, quantize=quantize,
--> 117 nbytes=2, chunksize=buffersize))
118 else:
119 tt = np.arange(0, self.duration, 1.0/fps)
<__array_function__ internals> in vstack(*args, **kwargs)
/usr/local/lib/python3.6/dist-packages/numpy/core/shape_base.py in vstack(tup)
277 # raise warning if necessary
278 _arrays_for_stack_dispatcher(tup, stacklevel=2)
--> 279 arrs = atleast_2d(*tup)
280 if not isinstance(arrs, list):
281 arrs = [arrs]
/usr/local/lib/python3.6/dist-packages/moviepy/audio/AudioClip.py in generator()
82 tt = (1.0/fps)*np.arange(pospos[i], pospos[i+1])
83 yield self.to_soundarray(tt, nbytes=nbytes, quantize=quantize,
---> 84 fps=fps, buffersize=chunksize)
85
86 if progress_bar:
local/lib/python3.6/dist-packages/decorator.py:decorator-gen-194> in to_soundarray(self, tt, fps, quantize, nbytes, buffersize)
/usr/local/lib/python3.6/dist-packages/moviepy/decorators.py in requires_duration(f, clip, *a, **k)
52 raise ValueError("Attribute 'duration' not set")
53 else:
---> 54 return f(clip, *a, **k)
55
56
/usr/local/lib/python3.6/dist-packages/moviepy/audio/AudioClip.py in to_soundarray(self, tt, fps, quantize, nbytes, buffersize)
128 #print tt.max() - tt.min(), tt.min(), tt.max()
129
--> 130 snd_array = self.get_frame(tt)
131
132 if quantize:
local/lib/python3.6/dist-packages/decorator.py:decorator-gen-132> in get_frame(self, t)
/usr/local/lib/python3.6/dist-packages/moviepy/decorators.py in wrapper(f, *a, **kw)
87 new_kw = {k: fun(v) if k in varnames else v
88 for (k,v) in kw.items()}
---> 89 return f(*new_a, **new_kw)
90 return decorator.decorator(wrapper)
91
/usr/local/lib/python3.6/dist-packages/moviepy/Clip.py in get_frame(self, t)
92 return frame
93 else:
---> 94 return self.make_frame(t)
95
96 def fl(self, fun, apply_to=None, keep_duration=True):
/usr/local/lib/python3.6/dist-packages/moviepy/audio/io/AudioFileClip.py in <lambda>(t)
76 self.buffersize = self.reader.buffersize
77
---> 78 self.make_frame = lambda t: self.reader.get_frame(t)
79 self.nchannels = self.reader.nchannels
80
/usr/local/lib/python3.6/dist-packages/moviepy/audio/io/readers.py in get_frame(self, tt)
200 # repeat the last frame instead
201 indices[indices>=len(self.buffer)] = len(self.buffer) -1
--> 202 result[in_time] = self.buffer[indices]
203 return result
204
IndexError: index -59041 is out of bounds for axis 0 with size 40960
</lambda></module>it seems to work when I don’t set outtmpl option in ydl_opts and manually enter the name that ydl auto assigns to ffmpeg_extract_subclip
import matplotlib.pyplot as plt
%matplotlib inline
import moviepy.editor as mpy
!pip install youtube_dl
import youtube_dl
ydl_opts = {
'format': 'bestaudio/best',
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'wav',
'preferredquality': '192',
}],
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download(['https://www.youtube.com/watch?v=5pIpVK3Gecg'])
#Tyler, The Creator - 'IGOR,' Odd Future and Scoring a Number 1 Album _ Apple Music-5pIpVK3Gecg.wav is the name
#that youtube_dl auto assigns. I got it from the output of ydl.download command
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
ffmpeg_extract_subclip("Tyler, The Creator - 'IGOR,' Odd Future and Scoring a Number 1 Album _ Apple Music-5pIpVK3Gecg.wav", 170, 180, targetname="talk.wav")
talk = mpy.AudioFileClip('talk.wav')
sample_rate = talk.fps
NFFT = sample_rate /25
audio_data = talk.to_soundarray() -
Merge commit ’483321fe789566dcb27b6387c00ea16dd86bc587’
26 mars 2014, par Michael NiedermayerMerge commit ’483321fe789566dcb27b6387c00ea16dd86bc587’
* commit ’483321fe789566dcb27b6387c00ea16dd86bc587’ :
truehd : add hand-scheduled ARM asm version of ff_mlp_rematrix_channel.See : 89135716fd4c2963e01e0155547c47bf709f1aa3
Merged-by : Michael Niedermayer <michaelni@gmx.at> -
ffmpeg how to reduce bass and increase treble like audacity
13 avril 2020, par Santhosh YedidiI have an mp3 file. I want to reduce bass and increase treble.
I am trying :



ffmpeg -y -i original.mp3 -af "treble=g=10" test1.mp3



but its not same as the effect of Audacity->Effect->bass and treble (increase treble and reduce bass)



below is the image from audacity :