Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (93)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

  • Soumettre bugs et patchs

    10 avril 2011

    Un 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 (7431)

  • OpusError while using ffmpeg library in discord.py

    18 avril 2021, par The Assignment Nerd

    While playing a local file or youtube audio, I get OpusError: invalid argument error

    


    The play command looks like :

    


    # bot.py
import os
import discord
from discord.ext import commands
from dotenv import load_dotenv
from models import *
from discord.voice_client import VoiceClient
import logging
from config import *
import youtube_dl
from youtube_dl import YoutubeDL

@bot.command()
async def play(ctx):
    user=ctx.author
    voice_channel=user.voice.channel
    channel=None
    # only play music if user is in a voice channel
    if voice_channel:
        # grab user's voice channel
        channel=voice_channel.name
        await ctx.send('User is in channel: '+ channel)
        # create StreamPlayer
        vc = await voice_channel.connect()
        url="https://www.youtube.com/watch?v=AOeY-nDp7hI"
        YDL_OPTIONS = {'format': 'bestaudio', 'noplaylist':'True'}
        FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
        voice = discord.utils.get(bot.voice_clients, guild=ctx.guild)
        print(0)
        if not voice.is_playing():
            print("1")
            with YoutubeDL(YDL_OPTIONS) as ydl:
                info = ydl.extract_info(url, download=False)
                print(2)
            URL = info['formats'][0]['url']
            print(3)
            voice.play(discord.FFmpegPCMAudio(URL, **FFMPEG_OPTIONS))
            print(4)
            voice.is_playing()
            print("Strated playing")
        else:
            await ctx.send("Already playing song")
            return
    else:
        await ctx.send('User is not in a channel.')


    


    My error :

    


    0
1
[youtube] AOeY-nDp7hI: Downloading webpage
[youtube] Downloading just video AOeY-nDp7hI because of --no-playlist
2
3
Ignoring exception in command play:
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/Users/mohit/programming/discord/area-51-helper/main.py", line 115, in play
    voice.play(discord.FFmpegPCMAudio(URL, **FFMPEG_OPTIONS))
  File "/opt/homebrew/lib/python3.9/site-packages/discord/voice_client.py", line 564, in play
    self.encoder = opus.Encoder()
  File "/opt/homebrew/lib/python3.9/site-packages/discord/opus.py", line 291, in __init__
    self.set_fec(True)
  File "/opt/homebrew/lib/python3.9/site-packages/discord/opus.py", line 326, in set_fec
    _lib.opus_encoder_ctl(self._state, CTL_SET_FEC, 1 if enabled else 0)
  File "/opt/homebrew/lib/python3.9/site-packages/discord/opus.py", line 92, in _err_lt
    raise OpusError(result)
discord.opus.OpusError: invalid argument

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: OpusError: invalid argument


    


    I'm using these version

    


    discord.py==1.0.1
ffmpeg==4.3.2
youtube_dl==2021.4.17


    


  • RuntimeError : abort(OOM). Build with -s ASSERTIONS=1 for more info

    26 avril 2021, par KhoPhi

    I'm using ffmpeg.wasm 0.9.7 (at the time of this question).
Browser is Brave (Version 1.23.71 Chromium : 90.0.4430.72 (Official Build) (64-bit))

    


    I get this error running an overlay ffmpeg command in the browser, slapping an png over an hevc mp4 4K video of size, almost 40 Megabyte.

    


    RuntimeError: abort(OOM). Build with -s ASSERTIONS=1 for more info.

    


    Here's my code in Angular. Stripped down for brevity

    


    async generatePreviews(event: any) {

    if (!ffmpeg.isLoaded()) {
      await ffmpeg.load();
    }

    for (let index = 0; index < this.files.length; index++) {

      this.video = this.files[index];
      const file_name = this.video.name.split('.')[0] + '-preview.mp4';

      ffmpeg.FS('writeFile', 'tempLogo.png', await fetchFile(this.watermark));
      ffmpeg.FS('writeFile', 'tempVideo.mp4', await fetchFile(this.video));


      // working command in normal terminal
      // ffmpeg -i tempVideo.mp4 -i tempLogo.png -filter_complex "overlay=(W-w)/2:(H-h)/2" temp.mp4

      await ffmpeg.run(
        '-i',
        'tempVideo.mp4',
        '-i',
        'tempLogo.png',
        '-filter_complex',
        'overlay=(W-w)/2:(H-h)/2',
        'temp.mp4'
      );

      const data = ffmpeg.FS('readFile', 'temp.mp4');

      var blob = new Blob([data.buffer], { type: 'video/mp4' });
      saveAs(blob, file_name); // using filesaver.js to save the blob

    }
  }
}



    


    In chrome, I read up to 2Gb of file is possible to convert. Not sure why the OOM issues. Any settings I need to set or changes I need to do ?

    


    Update (4/26/2021)

    


    This thread offered a solution, by building the ffmpeg wasm with a few tweaks. I am able to build, but using the built files even causes the OOM faster than the npm built from the ffmpeg wasm repo.

    


  • ffmpeg concat of two files results in malformed video

    18 avril 2021, par Stas Ezersky

    I processing two videos as follows :

    


    ffmpeg -i video-raw/455848793538790988_duration18.051.mp4 -b:v 993k -b:a 128k -vf "scale=720x1280:force_original_aspect_ratio=decrease,pad=720:1280:(ow-iw)/2:(oh-ih)/2,setsar=1:1" video-proc/455848793538790988_duration18.051.mp4


    


    and

    


    ffmpeg -i video-raw/14425661295137552_duration11.666.mp4  -b:v 993k -b:a 128k -vf "scale=720x1280:force_original_aspect_ratio=decrease,pad=720:1280:(ow-iw)/2:(oh-ih)/2,setsar=1:1" video-proc/14425661295137552_duration11.666.mp4


    


    then running the following command to concat :

    


    ffmpeg -f concat -safe 0 -i video-concat/dogs-2021-04-17-06-46-id-1.txt -c:v copy -c:a copy ./output.mp4

    


    the resulting video starts properly but when getting to the second video the image stuck and and sound becomes slow.

    


    The ffprobe results are as follow :

    


    Before processing :

    


    ffprobe video-raw/14425661295137552_duration11.666.mp4 

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video-raw/14425661295137552_duration11.666.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.45.100
  Duration: 00:00:11.68, start: 0.000000, bitrate: 565 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x800 [SAR 1:1 DAR 4:5], 462 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 93 kb/s (default)
    Metadata:
      handler_name    : SoundHandler


    


    for the second one :

    


    ffprobe video-raw/455848793538790988_duration18.051.mp4

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video-raw/455848793538790988_duration18.051.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.45.100
  Duration: 00:00:18.07, start: 0.000000, bitrate: 655 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt709/bt709), 576x1024 [SAR 1:1 DAR 9:16], 585 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (HE-AACv2) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 62 kb/s (default)
    Metadata:
      handler_name    : SoundHandler


    


    after processing :

    


    ffprobe video-proc/14425661295137552_duration11.666.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video-proc/14425661295137552_duration11.666.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.45.100
  Duration: 00:00:11.70, start: 0.000000, bitrate: 1133 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x1280 [SAR 1:1 DAR 9:16], 993 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 130 kb/s (default)
    Metadata:
      handler_name    : SoundHandler


    


    and the second one

    


    ffprobe video-proc/455848793538790988_duration18.051.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video-proc/455848793538790988_duration18.051.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.45.100
  Duration: 00:00:18.19, start: 0.000000, bitrate: 1044 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x1280 [SAR 1:1 DAR 9:16], 923 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 112 kb/s (default)
    Metadata:
      handler_name    : SoundHandler


    


    any ideas whats wrong ? both videos play perfect separately after processing but not after the concat