Recherche avancée

Médias (1)

Mot : - Tags -/école

Autres articles (34)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains 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, par

    Pré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 (6504)

  • How should I write my privacy notice for Matomo Analytics under GDPR ?

    24 avril 2018, par InnoCraft

    Important note : this blog post has been written by digital analysts, not lawyers. The purpose of this article is to show you an example of a privacy notice for Matomo under GDPR. This work comes from our interpretation of the UK privacy commission : ICO. It cannot be considered as professional legal advice. So as GDPR, this information is subject to change. We strongly advise you to have a look at the different privacy authorities in order to have up to date information.

    A basic rule of thumb is that if you are not processing personal data, then you do not need to show any privacy notice. But if you are doing so, such as processing full IP addresses, then a privacy notice is required at the time of the data collection. Please note that personal data may also be hidden, for example, in page titles or page URLs.

    In this blog post, we will define what a privacy notice is according to GDPR and how to write it if you are using Matomo and you are processing personal data.

    What is a privacy notice under GDPR ?

    One of the most important rights that a data subject has under GDPR, is the right to be informed about the collection and use of their personal data.

    Here is what ICO is saying about the privacy notice :

    “You must provide individuals with information including : your purposes for processing their personal data, your retention periods for that personal data, and who it will be shared with. We call this ‘privacy information’.”

    “When you collect personal data from the individual it relates to, you must provide them with privacy information at the time you obtain their data.”

    Note that a privacy notice is different from a privacy policy.

    The privacy notice has to include :

    • the reasons why you are processing the personal data
    • for how long
    • who the different parties you are going to share them with are

    So whatever lawful basis you are using (explicit consent or legitimate interest), you need to have a privacy notice if you collect personal data.

    What does this privacy notice look like ?

    ICO is providing best practices in order to display the information :

    • a layered approach
    • dashboards
    • just-in-time notices
    • icons
    • mobile and smart device functionalities

    Once more, it really depends on the data you are processing with Matomo. If you wish to track personal data on the entire website, you will probably have an upper or footer privacy notice such as :

    If you wish to process specific data, you could also insert just-in-time notices such as :

    What is the information you need to disclose to the final user ?

    To us, there are two things to distinguish between the privacy notice and the privacy policy.

    According to ICO, the privacy notice needs to include the 3 following elements :

    • the reasons why you are processing the personal data
    • for how long
    • who are the different parties you are going to share them with

    But you also need to inform them about :

    • The name and contact details of your organisation.
    • The name and contact details of your representative (if applicable).
    • The contact details of your data protection officer (if applicable).
    • The purposes of the processing.
    • The lawful basis for the processing.
    • The legitimate interests for the processing (if applicable).
    • The categories of personal data obtained (if the personal data is not obtained from the individual it relates to).
    • The recipients or categories of recipients of the personal data.
    • The details of transfers of the personal data to any third countries or international organisations (if applicable).
    • The retention periods for the personal data.
    • The rights available to individuals in respect of the processing.
    • The right to withdraw consent (if applicable).
    • The right to lodge a complaint with a supervisory authority.
    • The source of the personal data (if the personal data is not obtained from the individual it relates to).
    • The details of whether individuals are under a statutory or contractual obligation to provide the personal data (if applicable, and if the personal data is collected from the individual it relates to).
    • The details of the existence of automated decision-making, including profiling (if applicable).

    Pretty long, don’t you think ? In order to reduce it, you can either adopt a layered approach where your “pop-up” window will act as a drop down menu. Or from what we understood, page 5 of this document provided by ICO, a privacy notice can link to a more detailed document, such as a privacy policy page.

    Examples

    Let’s take the example of a website which tracks the non-anonymised full IP address, and using User ID functionality to keep track of logged-in users. Under GDPR, the owner of the website will have to choose either to process personal data based on “Legitimate interests” or on “Consent”. Here is how it will look like :

    Example of a privacy notice under GDPR Legitimate interests

    This site uses Matomo to analyze traffic and help us to improve your user experience.

    We process your email address and IP address and cookies are stored on your browser for 13 months. This data is only processed by us and our web hosting platform. Please read our Privacy Policy to learn more.

    Example of a privacy notice under GDPR Consent

    This site uses Matomo to analyze traffic and help us to improve your user experience.

    We process your email address and IP address and cookies are stored on your browser for 13 months. This data is only processed by us and our web hosting platform.

    [Accept] or [Opt-out]

    Please read our Privacy Policy to learn more.

    Once that information is provided to the user, you can then link it to your privacy policy where you will provide more details about it. Soon we will issue a blog post dealing with how to write a privacy policy page for Matomo.

    The post How should I write my privacy notice for Matomo Analytics under GDPR ? appeared first on Analytics Platform - Matomo.

  • How to record a webcam to a file outside of X11 ?

    13 décembre 2017, par Dav Clark

    I’m working with teachers to automatically record their classes, so we can review them and improve the quality of teaching. We have computers running Ubuntu 17.10 with multiple webcams in a couple of classrooms - but I could run other software if it makes this task easier.

    I can successfully record a stream from the webcam to an h264 encoded file using gstreamer. The following should work for most people with gstreamer installed, but I’ve got fancier pipelines using vaapi that can simultaneously encode multiple 4k streams on a NUC with room to spare ! My point is that Gstreamer works great when I’m typing at a terminal in the GUI. The example :

    .\gst-launch-1.0.exe -e autovideosrc ! videoconvert ! \
     openh264enc max-bitrate=256000 ! h264parse ! \
     mp4mux ! filesink location=somefile.mp4

    I imagine I could also do this with ffmpeg, or OpenCV, or maybe even VLC (I can record a webcam via the GUI, so I guess I could use that to generate a command line ?).

    But when I tried any of the above, for example, via SSH, I get errors from GStreamer and OpenCV, and blank videos from ffmpeg (I haven’t tried VLC because I don’t currently have access to these machines). I need to automate - but I could potentially leave a user logged in. I just need to have some way to capture webcam to disk with some amount of reasonable compression.

    I naively thought I could throw something like the above into a cron job and I’d be good to go (intending to send a SIGINT to end recording). But anything that can be automatically scheduled somehow would be great.

    EDIT : Below is an approach I’m trying using ffmpeg. You can see from the output that I can’t figure out how to specify pixel_format in a way that ffmpeg pays attention to ! First, the command (using mkv because that seems to be a "low-stress" format, but have also tried mov and mp4) :

    ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 \
     -f v4l2 -framerate 30 -video_size hd720 -pixel_format yuv420p -i /dev/video1 output.mkv

    Like I said, I’m trying to get hardware acceleration, and you can see below that VAAPI is working (but I think just for decoding). You can easily remove the options from the first line, and I get similar results either way. I didn’t include the header with compile options and library versions, as it’s standard Ubuntu 17.10.

    libva info: VA-API version 0.40.0
    libva info: va_getDriverName() returns 0
    libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
    libva info: Found init function __vaDriverInit_0_40
    libva info: va_openDriver() returns 0
    Input #0, video4linux2,v4l2, from '/dev/video1':
     Duration: N/A, start: 42437.238243, bitrate: 442368 kb/s
       Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1280x720, 442368 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
    File 'output.mkv' already exists. Overwrite ? [y/N] y
    Stream mapping:
     Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
    Press [q] to stop, [?] for help
    No pixel format specified, yuv422p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x55d1a26a71a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x55d1a26a71a0] profile High 4:2:2, level 3.1, 4:2:2 8-bit
    [libx264 @ 0x55d1a26a71a0] 264 - core 148 r2795 aaa9aa8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, matroska, to 'output.mkv':
     Metadata:
       encoder         : Lavf57.71.100
       Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv422p, 1280x720, q=-1--1, 30 fps, 1k tbn, 30 tbc
       Metadata:
         encoder         : Lavc57.89.100 libx264
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Past duration 0.717049 too large
    Past duration 0.879128 too large
    frame=  567 fps= 16 q=27.0 size=    2156kB time=00:00:34.16 bitrate= 516.9kbits/s speed=0.938x

    I exit with ctrl-C. Which results in what appears to be an orderly exit :

    [libx264 @ 0x55d1a26a71a0] frame I:11    Avg QP:15.75  size: 18573
    [libx264 @ 0x55d1a26a71a0] frame P:2176  Avg QP:19.91  size:  4435
    [libx264 @ 0x55d1a26a71a0] frame B:173   Avg QP:20.00  size:  3232
    [libx264 @ 0x55d1a26a71a0] consecutive B-frames: 90.1%  0.1%  0.6%  9.2%
    [libx264 @ 0x55d1a26a71a0] mb I  I16..4: 34.0% 56.1%  9.8%
    [libx264 @ 0x55d1a26a71a0] mb P  I16..4:  0.1%  1.2%  0.0%  P16..4: 32.7%  3.1%  6.1%  0.0%  0.0%    skip:56.8%
    [libx264 @ 0x55d1a26a71a0] mb B  I16..4:  0.0%  0.3%  0.0%  B16..8: 31.9%  0.7%  0.1%  direct: 1.4%  skip:65.6%  L0:41.8% L1:57.9% BI: 0.3%
    [libx264 @ 0x55d1a26a71a0] 8x8 transform intra:81.2% inter:92.4%
    [libx264 @ 0x55d1a26a71a0] coded y,uvDC,uvAC intra: 25.4% 20.1% 2.1% inter: 10.2% 7.4% 0.0%
    [libx264 @ 0x55d1a26a71a0] i16 v,h,dc,p: 78% 10%  7%  5%
    [libx264 @ 0x55d1a26a71a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  7%  6% 72%  2%  3%  3%  2%  2%  3%
    [libx264 @ 0x55d1a26a71a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 21% 25%  4%  5%  3%  4%  1%  3%
    [libx264 @ 0x55d1a26a71a0] i8c dc,h,v,p: 69% 14% 15%  2%
    [libx264 @ 0x55d1a26a71a0] Weighted P-Frames: Y:1.7% UV:0.1%
    [libx264 @ 0x55d1a26a71a0] ref P L0: 49.3%  2.7% 29.6% 18.1%  0.3%
    [libx264 @ 0x55d1a26a71a0] ref B L0: 69.3% 24.1%  6.6%
    [libx264 @ 0x55d1a26a71a0] ref B L1: 86.6% 13.4%
    [libx264 @ 0x55d1a26a71a0] kb/s:529.95
    Exiting normally, received signal 2.
  • Discord.py : Access files on the computer of the person who sent a message. Play a song from the local drive of any user on the server

    7 avril 2021, par daDib

    I have a bot that can play music from my computer. Is there a way to play a song from the computer of the person who sent the message ? My thought would be using message.author to somehow access the person's session and get into their drive. Here is my bot. It can join a voice channel, create playlists from local file paths, start a playlist or individual file with stop/pause/play/next/previous controls :

    


    import discord
import os.path
import logging
import asyncio
from os import path

global ready 
global vc
global source
global songQueue
global songIndex
global commandList
global stopPlaylist

ready = False
stopPlaylist = False
songQueue = []
songIndex = 0

logger = logging.getLogger('discord')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(filename='D:\DnD\DiscordBot\discord.log', encoding='utf-8', mode='w')
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
logger.addHandler(handler)

client = discord.Client()
commands = [
    '!connect\nConnect to a voice channel by channel id. Use !channels to find the desired id.\nExample Command: !connect 827202170973323305\n\n',
    '!channels\nLists all voice channels and their connection id.\n\n',
    '!add\nAdd a file path to the playlist.\nExample Command: !add D:\\DnD\\DiscordBot\\mySong.mp3\n\n',
    '!delete\nDeletes the last song added to the playlist.\n\n',
    '!view\nDisplays the current playlist, in order.\n\n',
    '!playlist\nStarts the playlist from the beginning, or optionally add a number as the start position.\nExample Command: !playlist 3\n\n',
    '!playSong\nPlays a specified file.\nExample Command: !playSong D:\\DnD\\DiscordBot\\mySong.mp3\n\n',
    '!next\nPlays next song in playlist.\n\n',
    '!prev\nPlays previous song in playlist.\n\n',
    '!stop\nStops all music song. Playlist will restart from the beginning.\n\n',
    '!pause\nPauses the current song. Restart with !resumeSong.\n\n',
    '!resume\nResumes the current song.\n\n'
    '!status\nLets you know if the bot thinks it is playing music.'
    ]
commandList=''
for command in commands:
    commandList+=command

@client.event
async def on_ready():
    print('We have logged in as {0.user}'.format(client))

@client.event
async def on_message(message):
    global ready 
    global vc
    global source
    global songQueue
    global songIndex
    global commandList
    global stopPlaylist

    if message.author == client.user:
        return
#!help
    if message.content.startswith('!help'):
        await message.channel.send('{0}'.format(commandList))
        return
#!connect
    if message.content.startswith('!connect'):  
        if ready:
            await message.channel.send('Bot [{0}] is already connected to a voice channel.'.format(client.user))
            return
        channel = int(message.content[9:])
        vc = await client.get_channel(channel).connect()
        ready = True
        await message.channel.send('Bot [{0}] is connecting to voice.'.format(client.user))
        return
#!channels
    if message.content.startswith('!channels'):
        channelList = ''
        for channel in client.get_all_channels():
            if channel.type == discord.ChannelType.voice:
                channelList += 'name: ' + channel.name + '\n'
                channelList += 'id: ' + str(channel.id) + '\n\n'
        await message.channel.send('{0}'.format(channelList))
        return
#!add
    if message.content.startswith('!add'):
        song = message.content[5:]
        if not path.exists(song):
            await message.channel.send('Song not found or invalid path specified.\nSpecified Path: {0}\nExample command: !addSong C:\\Users\\Public\\Music\\mySong.mp3'.format(song))
            return
        songQueue.append(song)
        await message.channel.send('Song added: {0}\nCurrent playist length: {1} song(s)'.format(song,len(songQueue)))
        return
#!delete
    if message.content.startswith('!delete'):
        if len(songQueue) == 0:
            await message.channel.send('Playlist is empty. Use !addSong, !viewList, and !playList to manage playlists.')
            return
        await message.channel.send('Removed song: {0}'.format(songQueue.pop()))
        return
#!view
    if message.content.startswith('!view'):
        if len(songQueue) == 0:
            await message.channel.send('Playlist is empty. Use !addSong, !deleteSong, and !playList to manage playlists.')
            return
        await message.channel.send('Current Playlist:\n{0}'.format('\n'.join(songQueue)))
        return
#play commands
    if message.content.startswith('!play'):
        if not ready:
            await message.channel.send('Bot [{0}] is not connected to a voice channel.'.format(client.user))
            return
#!playlist  
        if message.content.startswith('!playlist'):
            try:
                songIndex = int(message.content[10:]) - 1
                if songIndex >= len(songQueue):
                    songIndex = len(songQueue) - 1
            except:
                pass    
            playSong()
            return
#!playSong
        if message.content.startswith('!playSong'):
            song = message.content[10:]
            if not path.exists(song):
                await message.channel.send('Song not found or invalid path specified.\nSpecified Path: {0}\nExample command: !play C:\\Users\\Public\\Music\\mySong.mp3'.format(song))
                return
            source = discord.FFmpegPCMAudio(song)
            vc.play(source, after=None)
            await message.channel.send('Playing song: {0}'.format(song))
            return
#!next
    if message.content.startswith('!next'):
        vc.stop()
#!prev
    if message.content.startswith('!prev'):
        songIndex -= 2
        if songIndex < -1:
            songIndex = -1
        vc.stop()
#!stop
    if message.content.startswith('!stop'):
        if not ready:
            await message.channel.send('Bot [{0}] is not connected to a voice channel.'.format(client.user))
            return
        vc.stop()
        songIndex = 0
        stopPlaylist = True
        await message.channel.send('Stopping music.')
        return
#!pause
    if message.content.startswith('!pause'):
        if not ready:
            await message.channel.send('Bot [{0}] is not connected to a voice channel.'.format(client.user))
            return
        vc.pause()
        await message.channel.send('Pausing music.')
        return
#!resume
    if message.content.startswith('!resume'):
        if not ready:
            await message.channel.send('Bot [{0}] is not connected to a voice channel.'.format(client.user))
            return
        vc.resume()
        await message.channel.send('Resuming music.')
        return
#!status
    if message.content.startswith('!status'):
        if not ready:
            await message.channel.send('Bot [{0}] is not connected to a voice channel.'.format(client.user))
            return
        if vc.is_playing():
            await message.channel.send('Something is playing.')
            return
        await message.channel.send('Nothing is playing.')
        return

def playSong():
    global songQueue
    global songIndex
    global vc
    try:
        song = songQueue[songIndex]
        source = discord.FFmpegPCMAudio(song)
        vc.play(source, after=nextSong)
    except Exception as e:
        print('playSong error {0}'.format(e))

def nextSong(error):
    global songQueue
    global songIndex
    global stopPlaylist
    try:
        songIndex += 1
        if songIndex >= len(songQueue):
            stopPlaylist = True
        if stopPlaylist:
            songIndex = 0
            stopPlaylist = False
            return
        futureFunction = asyncio.run_coroutine_threadsafe(playSong(), client.loop)
        futureFunction.result()
    except Exception as e:
        print('nextSong error {0}'.format(e))

#@client.event
#async def on_logout(user)
#   global ready
#   if user == client.user:
#       ready = False

client.run('TOKEN')