Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (49)

  • 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

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (6988)

  • How do i fix the error "ffmpeg was not found." in my discord bot ?

    4 janvier 2023, par Anton Abboud

    I am currently trying to make my discord bot play a youtube audio from a URL. However, I can't pass the error "ffmpeg was not found". I have tried to use different solutions but nothing has worked. My code currently looks like this :

    


    import discord
import asyncio
from discord import FFmpegPCMAudio
from discord.utils import get
from discord.ext import commands
from youtube_dl import YoutubeDL

@bot.command(brief="Plays a single video, from a youtube URL")
async def play(ctx, url):
    if not ctx.message.author.voice:
        await ctx.send("{} is not connected to a voice channel".format(ctx.message.author.name))
        return
    else:
        global channel_player
        channel_player = ctx.message.author.voice.channel
    await channel_player.connect()
    YDL_OPTIONS = {'format': 'bestaudio', 'noplaylist':'True'}
    FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
    voice = get(bot.voice_clients, guild=ctx.guild)

    if not voice.is_playing():
        with YoutubeDL(YDL_OPTIONS) as ydl:
            info = ydl.extract_info(url, download=False)
        URL = info['url']
        voice.play(FFmpegPCMAudio(URL, **FFMPEG_OPTIONS))
        voice.is_playing()
    else:
        await ctx.send("Already playing song")
        return


    


    I am relatively new to coding so if you have any other suggestions on top of (hopefully) the solution to the problem, feel free !

    


    I am relatively new to coding so if you have any other suggestions on top of (hopefully) the solution to the problem, feel free !

    


    I have as I said tried a few different other approaches but nothing has worked. The one that seemed to almost work was to download ffmpeg through libx264 and create files that python could be directed to.

    


    I also tried downloadeing the most recent version of ffmpeg and 7zip to extract it.

    


  • How to add an album cover to an mp3 stream using FFmpeg ?

    29 décembre 2022, par Daniel LAPIDES

    I'm having a bit of an issue and I'd really appreciate it if I could get some insights.

    



    What I am trying to do is to add an album cover to the mp3 file that will be downloaded from the front-end.

    



    Context

    



    I'm downloading a video stream from YouTube and converting it to mp3 using fluent-ffmpeg.
    
To get the video I use the ytdl npm module.

    



    I then pipe this stream to the front-end.

    



    What I've found

    



    fluent-ffmpeg offers either pipe() or saveToFile().

    



    What I figured is that when I use the saveToFile() function and actually save my stream into an mp3 file, it works, I do get the album cover.

    



    But when I pipe the stream to front-end or even into a file, the song is saved properly into a file but without the album cover.

    



    Here is my code

    



    Back-end (NodeJS)

    



    let video = ytdl(`http://youtube.com/watch?v=${videoId}`, {
  filter: (format) => format.container === 'mp4' && format.audioEncoding,
  quality: 'lowest'
});

let stream = new FFmpeg()
  .input(video)
  .addInput(`https://i.ytimg.com/vi/${videoId}/default.jpg`)
  .outputOptions([
      '-map 0:1',
      '-map 1:0',
      '-c copy',
      '-c:a libmp3lame',
      '-id3v2_version 3',
      '-metadata:s:v title="Album cover"',
      '-metadata:s:v comment="Cover (front)"'
  ])
  .format('mp3');


    



    And then piping it to my front-end.

    



    stream.pipe(res);
stream
  .on('end', () => {
    console.log('******* Stream end *******');
    res.end.bind(res);
  })
  .on('error', (err) => {
    console.log('ERR', err);
    res.status(500).end.bind(res);
  });


    



    Front-end (React)

    



    axios.get(url)
  .then(res => {
    axios(`${url}/download`, {
      method: 'GET',
      responseType: 'blob'
    })
      .then(stream => {
        const file = new Blob(
          [stream.data],
          { type: 'audio/mpeg' });
        //Build a URL from the file
        const fileURL = URL.createObjectURL(file);
      })
      .catch(err => {
        console.log('ERROR', err);
      });
    })
    .catch(err => {
      console.log('ERROR', err);
    });


    


  • How to speed up ffmpeg video conversion

    22 avril 2018, par user2993497
    ffmpeg -i video.mp4 -c:v libvpx-vp9 -keyint_min 150 -g 150 -tile-columns 4 -frame-parallel 1  -f webm -dash 1 -an -vf scale=160:190 -b:v 250k -dash 1 video_160x90_250k.webm -an -vf scale=320:180 -b:v 500k -dash 1 video_320x180_500k.webm -an -vf scale=640:360 -b:v 750k -dash 1 video_640x360_750k.webm -an -vf scale=640:360 -b:v 1000k -dash 1 video_640x360_1000k.webm -an -vf scale=1280:720 -b:v 1500k -dash 1 video_1280x720_1500k.webm

    I’m converting a single video into multiple videos at different resolutions. But it’s painfully slow. how can I speed this up ?