Recherche avancée

Médias (1)

Mot : - Tags -/punk

Autres articles (3)

  • Les images

    15 mai 2013
  • Le plugin : Gestion de la mutualisation

    2 mars 2010, par

    Le plugin de Gestion de mutualisation permet de gérer les différents canaux de mediaspip depuis un site maître. Il a pour but de fournir une solution pure SPIP afin de remplacer cette ancienne solution.
    Installation basique
    On installe les fichiers de SPIP sur le serveur.
    On ajoute ensuite le plugin "mutualisation" à la racine du site comme décrit ici.
    On customise le fichier mes_options.php central comme on le souhaite. Voilà pour l’exemple celui de la plateforme mediaspip.net :
    < ?php (...)

  • Pas question de marché, de cloud etc...

    10 avril 2011

    Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
    sur le web 2.0 et dans les entreprises qui en vivent.
    Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
    Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
    le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
    Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...)

Sur d’autres sites (1816)

  • ffmpeg, video-clips do not always end at the specified '-to' value

    21 mars 2023, par query-01

    Within the batch file below, I randomly experience a video-clip that will not truncate/end at the value entered for -to . That said, if I have four files joined, then output to output.mp4, at least one file will not end at the specified -to value, yet the other adjoining clips will have complied with their specified -to value.

    &#xA;

    @echo off&#xA;Setlocal EnableDelayedExpansion&#xA;Rem "C:\Program Files\Bulk Rename Utility\Bulk Rename Utility.exe" %CD%&#xA;for /F "delims=" %%i in (&#x27;dir /B /O *.mp4&#x27;) do (&#xA;    set f=%%i&#xA;    "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" "!f!"&#xA;    set /p ss="Enter hh:mm:ss: "&#xA;    set /p t="Enter Duration: "&#xA;    ffmpeg -i "!f!" -ss !ss! -to !t!  -c:v copy -c:a aac _"!f!"&#xA;)&#xA;&#xA;for /F "delims=" %%i in (&#x27;dir /B /O _*.mp4&#x27;) do @echo file &#x27;%%i&#x27; >> clips.txt&#xA;set /p fn="Enter A Filename:"&#xA;ffmpeg -safe 0 -f concat -i clips.txt -c:v copy -c:a aac !fn!.mp4&#xA;

    &#xA;

    All of the video-clips are processed by the original system and remain un_touched before they are handled by this script.

    &#xA;

    What am I doing incorrectly, and/or, what should I be looking for within the affected video-clip, which would cause this behavior ?

    &#xA;

    I am using ffmpeg version 2021-11-10-git-44c65c6cc0-full_build-www.gyan.dev on Windows 10 Home, Version : 22H2

    &#xA;

    Respectfully.

    &#xA;

  • discord.py music bot slowing down for longer audio queries

    1er janvier 2023, par Bobluge

    So I'm trying to make a music bot with discord.py. Shown below is a minimum working example of the bot with the problematic functions :

    &#xA;

    import os&#xA;&#xA;import discord&#xA;from discord.ext import commands&#xA;from discord import player as p&#xA;&#xA;import yt_dlp as youtube_dl&#xA;&#xA;intents = discord.Intents.default()&#xA;intents.members = True&#xA;&#xA;bot = commands.Bot(command_prefix=&#x27;;&#x27;)&#xA;&#xA;class Music(commands.Cog):&#xA;    def __init__(self, bot):&#xA;        self.bot = bot&#xA;        self.yt-dlp_opts = {&#xA;            &#x27;format&#x27;: &#x27;bestaudio/best&#x27;,&#xA;            &#x27;outtmpl&#x27;: &#x27;%(extractor)s-%(id)s-%(title)s.%(ext)s&#x27;,&#xA;            &#x27;restrictfilenames&#x27;: True,&#xA;            &#x27;noplaylist&#x27;: True,&#xA;            &#x27;playlistend&#x27;: 1,&#xA;            &#x27;nocheckcertificate&#x27;: True,&#xA;            &#x27;ignoreerrors&#x27;: False,&#xA;            &#x27;logtostderr&#x27;: False,&#xA;            &#x27;quiet&#x27;: True,&#xA;            &#x27;no_warnings&#x27;: True,&#xA;            &#x27;default_search&#x27;: &#x27;auto&#x27;,&#xA;            &#x27;source_address&#x27;: &#x27;0.0.0.0&#x27;, # bind to ipv4 since ipv6 addresses cause issues sometimes&#xA;        }&#xA;        self.ffmpeg_opts = {&#xA;            &#x27;options&#x27;: &#x27;-vn&#x27;,&#xA;            # Source: https://stackoverflow.com/questions/66070749/&#xA;            "before_options": "-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5",&#xA;        }&#xA;        self.cur_stream = None&#xA;        self.cur_link = None&#xA;&#xA;    @commands.command(aliases=["p"])&#xA;    async def play(self, ctx, url):&#xA;        yt-dlp = youtube_dl.YoutubeDL(self.ytdl_opts)&#xA;        data = yt-dlp.extract_info(url, download=False)&#xA;        filename = data[&#x27;url&#x27;]  # So far only works with links&#xA;        print(filename)&#xA;        audio = p.FFmpegPCMAudio(filename, **self.ffmpeg_opts)&#xA;        self.cur_stream = audio&#xA;        self.cur_link = filename&#xA;&#xA;        # You must be connected to a voice channel first&#xA;        await ctx.author.voice.channel.connect()&#xA;        ctx.voice_client.play(audio)&#xA;        await ctx.send(f"now playing")&#xA;&#xA;    @commands.command(aliases=["ff"])&#xA;    async def seek(self, ctx):&#xA;        """&#xA;        Fast forwards 10 seconds&#xA;        """&#xA;        ctx.voice_client.pause()&#xA;        for _ in range(500):&#xA;            self.cur_stream.read()  # 500*20ms of audio = 10000ms = 10s&#xA;        ctx.voice_client.resume()&#xA;&#xA;        await ctx.send(f"fast forwarded 10 seconds")&#xA;&#xA;    @commands.command(aliases=["j"])&#xA;    async def jump(self, ctx, time):&#xA;        """&#xA;        Jumps to a time in the song, input in the format of HH:MM:SS&#xA;        """&#xA;        ctx.voice_client.stop()&#xA;        temp_ffempg = {&#xA;            &#x27;options&#x27;: &#x27;-vn&#x27;,&#xA;            # Keyframe skipping when passed as an input option (fast)&#xA;            "before_options": f"-ss {time} -reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5",&#xA;        }&#xA;        new_audio = p.FFmpegPCMAudio(self.cur_link, **temp_ffempg)&#xA;        self.cur_stream = new_audio&#xA;        ctx.voice_client.play(new_audio)&#xA;        await ctx.send(f"skipped to {time}")&#xA;&#xA;&#xA;bot.add_cog(Music(bot))&#xA;bot.run(os.environ["BOT_TOKEN"])&#xA;

    &#xA;

    My requirements.txt file :

    &#xA;

    discord.py[voice]==1.7.3&#xA;yt-dlp==2021.9.2&#xA;

    &#xA;

    To play a song in Discord the following format is used :

    &#xA;

    ;p &#xA;

    &#xA;

    Where is any link that yt-dlp supports. Under normal circumstances, the ;p command is used with songs that are relatively short, to which seek() and jump() work extremely quickly to do what they are supposed to do. For example if I execute these sequence of commands in Discord :

    &#xA;

    ;p https://www.youtube.com/watch?v=n8X9_MgEdCg  &lt;- 4 min song&#xA;

    &#xA;

    And when the bot starts playing, spam the following :

    &#xA;

    ;ff&#xA;;ff&#xA;;ff&#xA;;ff&#xA;;ff&#xA;

    &#xA;

    The bot is able to almost instantly seek five 10-second increments of the song. Additionally, I can jump to the three minute mark very quickly with :

    &#xA;

    ;j 00:03:00&#xA;

    &#xA;

    From some experimentation, the seek() and jump() functions seem to work quickly for songs that are under 10 minutes. If I try the exact same sequence of commands but with a 15 minute song like https://www.youtube.com/watch?v=Ks9Ck5LfGWE or longer https://www.youtube.com/watch?v=VThrx5MRJXA (10 hours classical music), there is an evident slowdown when running the ;ff command. However, when I include a few seconds of delay between firings of the ;ff command, the seeking is just as fast as previously mentioned. I'm not exactly sure what is going on with yt-dlp/FFmpeg behind the scenes when streaming, but I speculate that there is some sort of internal buffer, and songs that pass a certain length threshold are processed differently.

    &#xA;

    For longer songs, the seek() command takes longer to get to the desired position, which makes sense since this site specifies that -ss used as an input option loops through keyframes (as there must be more keyframes in longer songs). However, if the following commands are run in Discord :

    &#xA;

    ;p https://www.youtube.com/watch?v=VThrx5MRJXA  &lt;- 10 hour classical music&#xA;;j 09:00:00                                     &lt;- jump to 9 hour mark&#xA;;j 00:03:00                                     &lt;- jump to 3 minute mark&#xA;

    &#xA;

    The first seek command takes around 5 to 10 seconds to perform a successful seek, which isn't bad, but it could be better. The second seek command takes around the same time as the first command, which doesn't make sense to me, because I thought less keyframes were skipped in order to reach the 3 minute mark.

    &#xA;

    So I'm wondering what's going on, and how to potentially solve the following :

    &#xA;

      &#xA;
    • What is actually going on with the seek() command ? My implementation of seek() uses discord.py's discord.player.FFmpegPCMAudio.read() method, which apparently runs slower if the song's length is longer ? Why ?
    • &#xA;

    • Why does input seeking for long YouTube videos take almost the same time no matter where I seek to ?
    • &#xA;

    • How the yt-dlp and FFmpeg commands work behind the scenes to stream a video from YouTube (or any other website that YTDL supports). Does yt-dlp and FFmpeg behave differently for audio streams above a certain length threshold ?
    • &#xA;

    • Potential ways to speed up seek() and jump() for long songs. I recall some well-known discord music bots were able to do this very quickly.
    • &#xA;

    &#xA;

  • ffmpeg overlay png on video has color issue

    9 janvier 2023, par Richard

    Im trying a simple overlay command to put a logo on a black video, but find the color a little different in output, the original RGB value of green part of the logo is (0,220,90), but changed to (0,191,88) in output. Looks like the color gets mixed with the black background, any ideas ?

    &#xA;

    original logo rgb :

    &#xA;

    enter image description here

    &#xA;

    rgb after logo overlayed on video :

    &#xA;

    enter image description here

    &#xA;

    the command to overlay :

    &#xA;

    ffmpeg -i video.mp4 -i logo.png -filter_complex "[1:v]format=rgba[s],[0:v][s]overlay=240:1275:format=auto" output.mp4&#xA;

    &#xA;

    the logo and video :

    &#xA;

    ▶ ffmpeg -i logo.png               &#xA;ffmpeg version 4.4-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2021 the FFmpeg developers&#xA;  built with gcc 8 (Debian 8.3.0-6)&#xA;  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg&#xA;  libavutil      56. 70.100 / 56. 70.100&#xA;  libavcodec     58.134.100 / 58.134.100&#xA;  libavformat    58. 76.100 / 58. 76.100&#xA;  libavdevice    58. 13.100 / 58. 13.100&#xA;  libavfilter     7.110.100 /  7.110.100&#xA;  libswscale      5.  9.100 /  5.  9.100&#xA;  libswresample   3.  9.100 /  3.  9.100&#xA;  libpostproc    55.  9.100 / 55.  9.100                                                                                                                                            &#xA;Input #0, png_pipe, from &#x27;logo.png&#x27;:&#xA;  Duration: N/A, bitrate: N/A&#xA;  Stream #0:0: Video: png, rgba(pc), 601x81 [SAR 2834:2834 DAR 601:81], 25 fps, 25 tbr, 25 tbn, 25 tbc&#xA;&#xA;▶ ffmpeg -i video.mp4                                                                                                   &#xA;ffmpeg version 4.4-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2021 the FFmpeg developers&#xA;  built with gcc 8 (Debian 8.3.0-6)&#xA;  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg&#xA;  libavutil      56. 70.100 / 56. 70.100&#xA;  libavcodec     58.134.100 / 58.134.100&#xA;  libavformat    58. 76.100 / 58. 76.100&#xA;  libavdevice    58. 13.100 / 58. 13.100&#xA;  libavfilter     7.110.100 /  7.110.100&#xA;  libswscale      5.  9.100 /  5.  9.100&#xA;  libswresample   3.  9.100 /  3.  9.100&#xA;  libpostproc    55.  9.100 / 55.  9.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;video.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    encoder         : Lavf58.76.100&#xA;  Duration: 00:00:02.00, start: 0.000000, bitrate: 24 kb/s&#xA;  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1080x1920, 18 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)&#xA;    Metadata:&#xA;      handler_name    : VideoHandler&#xA;      vendor_id       : [0][0][0][0]&#xA;

    &#xA;