
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (26)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
-
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)
Sur d’autres sites (4104)
-
ffmpeg volumn not work in complex filter
6 février 2018, par rick lee"volumn" filter not work in complex filter.
the audio that converted volumn is not affected.env : Mac OS 10.12.6
ffmpeg -i /path/bg.mp3 -y -filter_complex [0:0]volume=0[output] -map
[output] -acodec libmp3lame -write_xing 0 /path/mixed.mp3full log =====================================================================
liqideMacBook-Pro:pinyin-api work$ ffmpeg -i
/Users/work/dev/codebase/pinyin/pinyin-api/test/resources/bg_audio2.mp3
-y -filter_complex [0:0]volume=0.1[output] -map [output] -acodec
libmp3lame -f mp3 -write_xing 0 /Users/work/dev/codebase/pinyin/pinyin-
api/test/resources/mixed3.mp3
ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4.1 --enable-
shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --
enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-
gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-
opencl --enable-videotoolbox --disable-lzma
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Input #0, mp3, from '/Users/work/dev/codebase/pinyin/pinyin-
api/test/resources/bg_audio2.mp3':
Metadata:
title : 喜洋洋
album : 贺岁新年音乐会
encoder : Lavf56.4.101
Duration: 00:02:43.58, start: 0.025057, bitrate: 128 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
Stream mapping:
Stream #0:0 (mp3) -> volume
volume -> Stream #0:0 (libmp3lame)
Press [q] to stop, [?] for help
Output #0, mp3, to '/Users/work/dev/codebase/pinyin/pinyin-
api/test/resources/mixed3.mp3':
Metadata:
TIT2 : 喜洋洋
TALB : 贺岁新年音乐会
TSSE : Lavf57.83.100
Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, stereo, fltp
Metadata:
encoder : Lavc57.107.100 libmp3lame
[libmp3lame @ 0x7fad80001a00] Trying to remove 1152 samples, but the
queue is empty
size= 2556kB time=00:02:43.57 bitrate= 128.0kbits/s speed=51.7x
video:0kB audio:2556kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.003782%
liqideMacBook-Pro:pinyin-api work$=====================================================================
-
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() -
2023-04-18 18:25:05 INFO discord.player ffmpeg process ##### successfully terminated with return code of 0
19 avril 2023, par I_am_thingI am making a discord music bot with discord.py and ctx, it uses Spotify


I am using FFmpeg for my music feature. This is my !play code


client_id = ''
client_secret = ''
client_credentials_manager = SpotifyClientCredentials(client_id=client_id, client_secret=client_secret)
sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager)

bot.volume = 0.5 # initial volume of the bot (can be changed)

@bot.command()
async def play(ctx, *, track_query):
 # check if the query is a valid Spotify link
 if 'open.spotify.com/track/' in track_query:
 track_id = track_query.split('/')[-1] # extract the track ID from the link
 else:
 # search for tracks with the given name
 track_results = sp.search(q=track_query, type='track', limit=1)
 if len(track_results['tracks']['items']) == 0:
 await ctx.send(f'Sorry, I could not find any track with the name "{track_query}".')
 return
 track_id = track_results['tracks']['items'][0]['id'] # get the track ID for the first search result
 track_info = sp.track(track_id) # get the track information for the given ID
 track_name = track_info['name']
 track_artist = track_info['artists'][0]['name']
 track_duration = time.strftime('%M:%S', time.gmtime(track_info['duration_ms']//1000))
 track_preview_url = track_info['preview_url'] # get the preview URL for the track
 if track_preview_url is None:
 await ctx.send(f'Sorry, the track "{track_name}" by {track_artist} cannot be played.')
 return
 voice_channel = ctx.author.voice.channel
 if voice_channel is None:
 await ctx.send('Please join a voice channel first.')
 return
 voice_client = await voice_channel.connect()
 audio_source = discord.FFmpegPCMAudio(track_preview_url, options="-b:a 128k -bufsize 512k")
 voice_client.play(audio_source, after=lambda e: print('Player error: %s' % e) if e else None)
 voice_client.source = discord.PCMVolumeTransformer(voice_client.source)
 voice_client.source.volume = bot.volume

 # format the embed message
 embed = discord.Embed(title=track_name, description=track_artist, color=0xff8c00)
 embed.add_field(name='Duration', value=track_duration, inline=True)
 embed.set_thumbnail(url=track_info['album']['images'][0]['url'])
 embed.set_footer(text='This music is from https://www.spotify.com/')
 await ctx.send(embed=embed)

 while voice_client.is_playing():
 await asyncio.sleep(1)
 await voice_client.disconnect()



I joined the unofficial ffmpeg discord server no one could find a fix I searched for ages and I couldn't fix it