
Recherche avancée
Autres articles (93)
-
Configuration spécifique d’Apache
4 février 2011, parModules spécifiques
Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
Création d’un (...) -
Création définitive du canal
12 mars 2010, parLorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
A la validation, vous recevez un email vous invitant donc à créer votre canal.
Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...) -
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 (1804)
-
9 Form Optimisation Tips to Convert More Visitors
15 février 2024, par Erin -
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() -
How you can use the Piwik AOM plugin to improve your data and make better online marketing decisions
13 septembre 2017, par André Kolell — Plugins, AdWords, Bing, Case Study, Criteo, eccommerce tracking, Facebook Ads, how to install piwik analytics, how-to piwik, integration, piwik, TaboolaHi, this is André, one of the authors of the Piwik Advanced Online Marketing plugin, which has just hit 5,000 downloads on the Piwik marketplace. In this blog post I’ll show you how Piwik AOM improves your data and enables you to make better online marketing decisions.
Piwik itself is excellent in tracking all kinds of visitor data, like where a visitor is coming from and what he’s doing on your page or app (pageviews, events, conversions). But what Piwik did not yet take a closer a look at, is how much you’ve invested into your marketing activities and how profitable they are.
With the Piwik AOM plugin you can integrate data like advertising costs, advertising campaign names, ad impressions etc. from advertising platforms (such as Google AdWords, Microsoft Bing, Criteo, Facebook Ads and Taboola) and individual campaigns (such as such as cost per view/click/acquisition and fixed price per months deals) into Piwik and combine that data with individual Piwik visits.
Piwik AOM adds a new marketing performance report to Piwik giving you a great overview of all your marketing activities with drill-down functionality :
When taking a look at a specific visitor, Piwik AOM shows you the exact cost of acquiring a specific visit :
Leveraging Piwik AOM’s full potential
But although you can access Piwik AOM’s valuable data directly in the Piwik UI for ad-hoc analyses, Piwik AOM’s true strength comes into play when working with the raw data in an external business intelligence application of your choice, where you can further integrate Piwik AOM’s data with your most accurate backend data (like conversion’s contribution margins after returns, new vs. existing customer, etc.).
Piwik AOM offers some API endpoints that allow you to fetch the data you need but you can also retrieve it directly from Piwik AOM’s
aom_visits
table, which includes all visits, all allocated advertising costs and advertising campaign details. As there is never data being deleted fromaom_visits
, the table can easily be connected to your ETL tool with its last update timestamp column. A third way to get data out of Piwik AOM is by developing your own Piwik plugin and listening to theAOM.aomVisitAddedOrUpdated
event, which is posted whenever anaom_visits
record is added or updated.Integrating Piwik AOM’s data with your backend data in the business intelligence application of your choice allows you to evaluate the real performance of your online marketing campaigns when applying different conversion attribution models, conduct customer journey analyses, create sophisticated forecasts and whatever you can think of.
AOM Use case
A company that followed this approach, is FINANZCHECK.de, one of Germany’s leading loan comparison websites. At the eMetrics summit 2016 in Berlin, Germany, I gave a talk about FINANZCHECK’s architectural online marketing setup. Until recently, FINANZCHECK used Pentaho data integration to integrate data from Piwik, Piwik AOM and additional internal tools like its proprietary CRM software into Jaspersoft, its data warehouse an BI solution. The enriched data in Jaspersoft was not only used for reporting to various stakeholders but also for optimising all kinds of marketing activities (e.g. bids for individual keywords in Google AdWords) and proactive alerting. Not long ago, FINANZCHECK started an initiative to improve its setup even further – I’ll hopefully be able to cover this in a more detailed case study soon.
Roadmap
In the past, we had the chance to make great progress in developing this plugin by solving specific requirements of different companies who use Piwik AOM. During the next months, we plan to integrate more advertising platforms, reimplement Facebook Ads, improve the support of individual campaigns and work on the general plugin stability and performance.
Before you install Piwik AOM
Before installing Piwik AOM, you should know that its initial setup and even its maintenance can be quite complex. Piwik AOM will heavily modify your Piwik installation and you will only benefit from Piwik AOM if you are willing to invest quite some time into it.
If you are not familiar with Piwik’s internals, PHP, MySQL, database backups, cronjobs, creating API accounts at the advertising platforms or adding parameters to your advertising campaign’s URLs, you should probably not install it on your own (at least not in your production environment).
Piwik AOM has successfully been tested with up to 25k visitors a day for a period of more than two years, running on an AWS server with 4 GB RAM, once CPU and a separate AWS RDS MySQL database.
Ideas and Support
If you have ideas for new features or need support with your Piwik AOM installation or leveraging your marketing data’s potential in general, feel free to get in touch with the plugin’s co-author Daniel or me. You can find our contact details on the plugin’s website http://www.advanced-online-marketing.com.
How to get the Piwik AOM plugin ?
The Piwik AOM plugin is freely available through the Piwik marketplace at https://plugins.piwik.org/AOM
Did you like this article ? If yes do not hesitate to share it or give your feedback about the topic you would like us to write about.