
Recherche avancée
Autres articles (42)
-
MediaSPIP Core : La Configuration
9 novembre 2010, parMediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...) -
(Dés)Activation de fonctionnalités (plugins)
18 février 2011, parPour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...) -
Soumettre bugs et patchs
10 avril 2011Un logiciel n’est malheureusement jamais parfait...
Si vous pensez avoir mis la main sur un bug, reportez le dans notre système de tickets en prenant bien soin de nous remonter certaines informations pertinentes : le type de navigateur et sa version exacte avec lequel vous avez l’anomalie ; une explication la plus précise possible du problème rencontré ; si possibles les étapes pour reproduire le problème ; un lien vers le site / la page en question ;
Si vous pensez avoir résolu vous même le bug (...)
Sur d’autres sites (7537)
-
Trouble with CoCCA Registry
7 octobre 2012, par Multimedia Mike — GeneralI’ve been rather despondent all week. People who see me daily could readily identify this fact. Unfortunately, the exact reason was difficult to adequately explain. The problems that nerds deal with…
When A Domain Expires
As a few people noticed, the multimedia.cx domain and all of it’s subdomains didn’t work this last week. The problem started on Monday, October 1. Whose fault ? Well, fundamentally, I neglected to renew the domain name in time. However, I prefer to place the blame on the .cx domain registrar, CoCCA Registry. You see, they have never developed the technology to email a domain holder with a notice that their domain is about to expire or has already expired.This domain is the only one I have ever held so I don’t have a lot of experience in this matter. I wondered if I was crazy for thinking it would be normal for a registrar to send an email or 2 with status updates about your domain. I get the impression from speaking with others that this is indeed normal. I have 3 different email addresses listed under my account at the registrar– 2 at multimedia.cx and a backup gmail account. I checked spam folders after this incident. Then I remembered that I have never received any email notifications from them (although password reset emails show up, so that part thankfully works). Also, their support emails are black holes.
So, I guess the moral is : be wary of dealing with CoCCA Registry. However, they seem to be the only way to register domains under a wide variety of uncommon country codes.
By Friday, the domain appeared to have been reinstated, even through the status was officially listed as “renewal-pending” according to the web-based management console. Eventually, as cached DNS results started to time out throughout the day, I started seeing subdomains come back. I excitedly used the ‘dig’ command to count down the seconds until gamemusic.multimedia.cx was accessible on the network I was on (the number after the domain name is the time-to-live or ‘TTL’ value) :
$ dig +nocmd gamemusic.multimedia.cx +noall +answer gamemusic.multimedia.cx. 3 IN A 174.143.152.251 $ dig +nocmd gamemusic.multimedia.cx +noall +answer gamemusic.multimedia.cx. 2 IN A 174.143.152.251 $ dig +nocmd gamemusic.multimedia.cx +noall +answer gamemusic.multimedia.cx. 1 IN A 174.143.152.251 $ dig +nocmd gamemusic.multimedia.cx +noall +answer gamemusic.multimedia.cx. 12962 IN A 207.45.186.114
Finally, today (Saturday), I received a receipt confirming that the domain has been renewed.
8 Years Old
Incidentally, happy eighth birthday to multimedia.cx. It was September, 2004 when I decided to branch out from a simple ISP-based web presence.People often ask why I went with the .cx TLD. When I decided I wanted a proper domain name 8 years ago, I found that multimedia.X was already taken for just about every TLD value of X. .cx was a notable exception and was distinctive enough (speaking of .X, though, I see that multimedia.xxx is still up for grabs as of this writing ; I imagine that would come with a whole other set of problems).
It’s funny that tech nerds often rail against outsourcing too much — email, storage, computing power, web hosting — all to some type of cloud provider under the premise that it could easily be taken away. But this episode teaches me that even having your own domain name is no guarantee of a solid online presence.
Meanwhile, I have taken proactive steps to avert this same situation from arising again :
Barring a lack of automated emails from the registrar, I hope a Google Calendar reminder set up a month ahead of expiration will do the trick.
-
Start ffmpeg sound recording at system start doesn't work
3 octobre 2022, par CheatingBoyI made a python script to record sound at System boot, but it doesn't work. I've tried using crontab and systemd but it doesn't work. If I start the program manually it works out fine.


#!/bin/python3
import RPi.GPIO as GPIO
import time
import datetime
import subprocess
import os
import signal
GPIO.setmode(GPIO.BCM)
GPIO.setup(24, GPIO.IN)
GPIO.setup(23, GPIO.OUT)
print("Started Sound_Recorder_ULtimate_Control")
p = None
while True:
 time.sleep(0.5)
 if GPIO.input(24) == 1:
 if p is None:
 print("Preparing to recorde")
 today = datetime.datetime.now()
 time1 = "{}.{}.{}_{}:{}:{}".format(today.day , today.month, today.year, today.hour, today.minute, today.second)
 # Aufname starten
 command = "sh -c 'ffmpeg -f pulse -nostdin -i alsa_input.usb-FuZhou_Kingwayinfo_CO._LTD_TONOR_TC30_Audio_Device_20200707-00.mono-fallback /home/pi/sound_recorder/Recordes/'" + time1 + ".mp3"
 print(command)
 #subprocess.Popen(command)
 p = subprocess.Popen(command, stdout=subprocess.PIPE, 
 shell=True, preexec_fn=os.setsid)
 print("Recording...")
 GPIO.output(23, GPIO.HIGH)
 time.sleep(2) 

 else:
 print("Terminate")
 os.killpg(os.getpgid(p.pid), signal.SIGTERM)
 GPIO.output(23, GPIO.LOW)
 p = None
 time.sleep(2)




-
moviepy black border around png when compositing into an MP4
27 août 2022, par OneWorldcompositing a png into an MP4 video creates a black border around the edge.


This is using moviepy 1.0.0


Code below reproduces the MP4 with the attached red text png.




import numpy as np
import moviepy.editor as mped
def composite_txtpng_on_colour():
 bg_color = mped.ColorClip(size=[400, 300], color=np.array([0, 255, 0]).astype(np.uint8),
 duration=2).set_position((0, 0))
 text_png_postition = [5, 5]
 text_png = mped.ImageClip("./txtpng.png", duration=3).set_position((text_png_postition))

 canvas_size = bg_color.size
 stacked_clips = mped.CompositeVideoClip([bg_color, text_png], size=canvas_size).set_duration(2)
 stacked_clips.write_videofile('text_with_black_border_video.mp4', fps=24)

composite_txtpng_on_colour()



The result is an MP4 that can be played in VLC player. A screenshot of the black edge can be seen below :-




Any suggestions to remove the black borders would be much appreciated.


Update : It looks like moviepy does a blit instead of alpha compositing.


def blit(im1, im2, pos=None, mask=None, ismask=False):
 """ Blit an image over another. Blits ``im1`` on ``im2`` as position ``pos=(x,y)``, using the
 ``mask`` if provided. If ``im1`` and ``im2`` are mask pictures
 (2D float arrays) then ``ismask`` must be ``True``.
 """
 if pos is None:
 pos = [0, 0]

 # xp1,yp1,xp2,yp2 = blit area on im2
 # x1,y1,x2,y2 = area of im1 to blit on im2
 xp, yp = pos
 x1 = max(0, -xp)
 y1 = max(0, -yp)
 h1, w1 = im1.shape[:2]
 h2, w2 = im2.shape[:2]
 xp2 = min(w2, xp + w1)
 yp2 = min(h2, yp + h1)
 x2 = min(w1, w2 - xp)
 y2 = min(h1, h2 - yp)
 xp1 = max(0, xp)
 yp1 = max(0, yp)

 if (xp1 >= xp2) or (yp1 >= yp2):
 return im2

 blitted = im1[y1:y2, x1:x2]

 new_im2 = +im2

 if mask is None:
 new_im2[yp1:yp2, xp1:xp2] = blitted
 else:
 mask = mask[y1:y2, x1:x2]
 if len(im1.shape) == 3:
 mask = np.dstack(3 * [mask])
 blit_region = new_im2[yp1:yp2, xp1:xp2]
 new_im2[yp1:yp2, xp1:xp2] = (1.0 * mask * blitted + (1.0 - mask) * blit_region)
 
 return new_im2.astype('uint8') if (not ismask) else new_im2



and so, Rotem is right.


new_im2[yp1:yp2, xp1:xp2] = (1.0 * mask * blitted + (1.0 - mask) * blit_region)



is


(alpha * img_rgb + (1.0 - alpha) * bg)



and this is how moviepy composites. And this is why we see black at the edges.