Recherche avancée

Médias (1)

Mot : - Tags -/intégration

Autres articles (110)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

Sur d’autres sites (5921)

  • How to create a local audio livestream server with ffmpeg and python ? [closed]

    10 novembre 2024, par Fenekhu

    Simply put, this is what I'm trying to accomplish :
    
I navigate to something like http://localhost:8080/ in my browser and the browser shows a built-in audio player playing whatever the ffmpeg process is streaming. (Not just serving a local audio file.) (Built-in here meaning the page looks the same as if you had opened an mp3 file with your browser.)

    


    At first I thought it would be easy, as ffmpeg has the ability to stream through different protocols. I seem to have misunderstood though, because while I can stream something over rtp with it, I can't access that from my browser. Some stackoverflow questions I found seem to imply that you can do this with the output options -f mpegts http://localhost:8080, but when I try this, ffmpeg freezes for a second, then I get these errors :

    


    [tcp @ 00000210f70b0700] Connection to tcp://localhost:8080 failed: Error number -138 occurred
[out#0/mpegts @ 00000210f7080ec0] Error opening output http://localhost:8080: Error number -138 occurred
Error opening output file http://localhost:8080.
Error opening output files: Error number -138 occurred


    


    but I have no problem with -f rtp rtp://localhost:8080. (Like I said though, I can't access that through the browser).

    


    So I suspect I need something else to "pick up" the rtp stream and put it on an http server, but I haven't been able to find anything on that, probably because I just don't know the right thing to search. It seems like something that should be easily doable in Python, and that would be my preferred language to do it in over javascript, if possible.

    


    Can anyone point me in the right direction ? Or let me know if I'm misunderstanding something ? Thanks.

    


  • Variable fps (frame per second) in cv2

    17 octobre 2022, par Sepide

    I use cv2 for creating videos from different frames that I have. When I create the video, I cannot change the fps (frame per second). I want the video be slow at the beginning but fast towards the end, meaning small fps at the beginning but large ones towards the end. However, when I instantiate cv2.VideoWriter I cannot change the fps anymore. What should I do ?

    


    Replicable code

    


    import numpy as np
import cv2, os
import matplotlib

image_size = 200
def create_image_array(image_size):
  image_array = np.random.randn(image_size, image_size)
  row = np.random.randint(0, image_size)
  image_array[row, :] = 100
  return image_array

frame_numbers = 200
for i in range(frame_numbers):
  image_array = create_image_array(image_size)
  matplotlib.image.imsave(f'./shots/frame_{i:03d}.png', image_array)

def make_a_video(shots_folder, video_path):

    shots_folder = 'shots'
    fps = 25
    images = [img for img in os.listdir(shots_folder) if img.endswith(".png")]

    images = sorted(images)[:]
    frame = cv2.imread(os.path.join(shots_folder, images[0]))
    height, width, layers = frame.shape

    video = cv2.VideoWriter(video_path, cv2.VideoWriter_fourcc(*'mp4v'), fps, (width, height))

    for image in images:
        video.write(cv2.imread(os.path.join(shots_folder, image)))

    cv2.destroyAllWindows()
    video.release()

shots_folder = 'shots'
video_path = 'video.mp4'  
make_a_video(shots_folder, video_path)


    


  • Play audio files on a guild channel (Not working on Ubuntu Server)

    18 octobre 2018, par danielperales555

    I want to make a "soundboard" on my Discord Bot.

    The bot is currently running on Ubuntu Server 18.04 in a VPS Hosting.

    I installed ffmpeg via aptitude apt-get install ffmpeg, and the respective node modules on my project via npm : npm install ffmpeg-binaries --save and npm install node-opus --save

    I have this provisional code :

    //Command syntax: !play (sound)
    if (!args[0]) return message.channel.send('noCorrectSyntax'); //args is provided by module.run

    let sound = args[0];
    let isReady = true;

    if (isReady) {
       isReady = false;
       let voiceChannel = message.member.voiceChannel;
       if (!voiceChannel) return message.channel.send('noChannel');

       voiceChannel.join().then(connection =>{
           const dispatcher = connection.playFile(`../resources/audios/${sound}.mp3`);
           if (!dispatcher) return message.channel.send('soundNotFound');

           console.log(`Playing ${sound} on ${message.member.voiceChannel.name}`);

           dispatcher.on("end", end => {
               voiceChannel.leave();
               console.log(`Finished`);
           });
       }).catch(err => console.log(err));
       isReady = true;
    } else {
       return message.channel.send('botNotAvailable');
    }

    When my bot joins the voice room, it leaves instantly without playing the sound.

    Am I doing something wrong by installing the ffmpeg codec this way ? Is a problem with the VPS ?

    (I tried with a new bot, installing ffmpeg on windows and setting the environment variable path and it worked fine)

    EDIT :

    I listened for the "error" and "debug" events on the StreamDispatcher (as specified in https://discord.js.org/#/docs/main/stable/class/StreamDispatcher?scrollTo=e-error), but I don’t receive errors or debug info.

    When I listen for the "speaking" event, is showed on my console as false