Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (106)

  • 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 (...)

  • Taille des images et des logos définissables

    9 février 2011, par

    Dans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
    Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)

Sur d’autres sites (9298)

  • Re-encode mp4 files to working hls (m3u8) segment files

    6 août 2022, par gameboys

    My issue is that I need to create a hls playlist with all the segments being below 8 MB. At first, I generated all the segments and then checked if they were all under 8MB and if not rerun with a lower -hls_time but this could take a long period of time with high-quality videos. Then after some research realized that FFmpeg seems not to natively support file size limiting segments. I found this answer on splitting up mp4 video so that they are all under a certain length, but now I can't get them working in an actual m3u8 file.

    


    If I keep them as an mp4 file I get this from vlc :

    


    no moov before mdat and the stream is not seekable


    


    I attempted to fix it by running -movflags faststart But then I get this from mpv (I read that vlc might have some issues with hls playlists)

    


    [ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: Found duplicated MOOV Atom. Skipped it


    


    After this, I attempted to switch the mp4 splitter script to outputting .ts files but this just caused even more issues. It turns out that hls playlists require precise timestamps in each segment of a ts file otherwise it just start jumping around the video. Theses are the errors that mpv put in terminal

    


    ffmpeg/demuxer] mpegts: Packet corrupt (stream = 0, dts = 1194750).
[ffmpeg/demuxer] mpegts: DTS 127271 < 1194750 out of order                       
[ffmpeg/demuxer] hls: DTS 127271 < 1194750 out of order                          
AV: 00:00:11 / 00:10:29 (1%) A-V:  0.000
Invalid audio PTS: 11.911837 -> 0.000000
Reset playback due to audio timestamp reset.
(...) AV: 00:00:00 / 00:10:29 (0%) A-V:  0.000
Invalid video timestamp: 11.875000 -> 0.014122
AV: 00:00:11 / 00:10:29 (1%) A-V:  0.000

Audio/Video desynchronisation detected! Possible reasons include too slow
hardware, temporary CPU spikes, broken drivers, and broken files. Audio
position will not match to the video (see A-V status field).


    


    So I attempted to write a script to fix these issues by adding the timestamps back in :

    


    def get_length(filename):   //https://stackoverflow.com/questions/3844430/how-to-get-the-duration-of-a-video-in-python

    result = subprocess.run(["ffprobe", "-v", "error", "-show_entries",
                             "format=duration", "-of",
                             "default=noprint_wrappers=1:nokey=1", filename],
        stdout=subprocess.PIPE,
        stderr=subprocess.STDOUT)
    return float(result.stdout)
dirr = 0
for fi in sorted(os.listdir('out'), key=lambda k: int(k.split(".")[0]) if not ".m3u8" in k else 0):
    if fi.endswith(".ts"):
        fn = os.path.join("out", fi)
        ln = get_length(fn)
        print(dirr, fn)
        os.system(f"ffmpeg -i {fn} -muxdelay {dirr} tmp.ts ; mv tmp.ts {fn}")
        dirr+=ln


    


    But somehow this still didn't work and mpv would report that the timestamps were different then what I gave them.

    


    Invalid audio PTS: 11.911837 -> 23.833333
Reset playback due to audio timestamp reset.
(...) AV: 00:00:00 / 00:10:29 (0%) A-V:  0.000
Invalid video timestamp: 11.885911 -> 23.844244


    


    If anybody knows how to Re-encode the mp4 files which are limited in file size please help me out, at this point, it appears that it may well be impossible.

    


    In case it somehow matters I was using this video for testing.

    


  • FFprobeKit command not showing the specific error when it fails to execute

    8 septembre 2022, par sandulasanth-7

    I'm getting the video duration of a video in react native by using FFMpegkit library and by running bellow code

    


    const getVideoDuration = async (uri: string): Promise<void> => {&#xA;      try {&#xA;      await FFprobeKit.executeAsync(&#xA;        `-v error -select_streams v:0 -show_entries stream=duration -of default=noprint_wrappers=1:nokey=1 ${uri}`,&#xA;      ).then(async information => {&#xA;        const failStackTrace = await information.getFailStackTrace();&#xA;        console.log(failStackTrace);&#xA;        await information.getOutput().then(output => {&#xA;          const value = parseFloat(output.toString());&#xA;          const time = value * 1000;&#xA;          setInputVideoDuration(time);&#xA;        });&#xA;      });&#xA;    } catch (error) {&#xA;      console.log(error);&#xA;    }&#xA;  };&#xA;</void>

    &#xA;

    The issue is that the the code isn't executing sometimes. And it's like sporadic. I want to trigger the exact error given when failing this code. The exact error is not given by the library logs but it produce other command executing logs. Is there any way to get the exact error or the exception ?

    &#xA;

    Currently the error shows like this in the logs but it doesn't have any information. also failStackTrace isn't producing any logs either

    &#xA;

     libswscale      6.  1.102 /  6.  1.102&#xA; LOG    libswresample   4.  0.100 /  4.  0.100&#xA; LOG  ReturnCode.ERROR&#xA;

    &#xA;

  • Python musical bot

    14 juin 2022, par Лагуш Любомир

    I was working on bot for my discord server for 2 hours but still it doesnt work and not even connecting to voice chat

    &#xA;

    import discord&#xA;from discord.ext import commands&#xA;from youtube_dl import YoutubeDL&#xA;YDL_OPTIONS = {&#x27;format&#x27;: &#x27;worstaudio/best&#x27;, &#x27;noplaylist&#x27;: &#x27;False&#x27;, &#x27;simulate&#x27;: &#x27;True&#x27;,&#xA;               &#x27;preferredquality&#x27;: &#x27;192&#x27;, &#x27;preferredcodec&#x27;: &#x27;mp3&#x27;, &#x27;key&#x27;: &#x27;FFmpegExtractAudio&#x27;}&#xA;FFMPEG_OPTIONS = {&#x27;before_options&#x27;: &#x27;-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5&#x27;, &#x27;options&#x27;: &#x27;-vn&#x27;}&#xA;client = commands.Bot ( command_prefix=&#x27;>&#x27;)&#xA;@client.event&#xA;async def on_ready():&#xA;    print("Meepo connected")&#xA;@client.command(pass_context = True )&#xA;async def hello( ctx ):&#xA;    author = ctx.message.author&#xA;    await ctx.send(f"{ author.mention }///Добрий день шановне панство, Я пан Міпарний!")&#xA;@client.command()&#xA;async def play(ctx, *, arg):&#xA;    vc = await ctx.message.author.voice.channel.connect()&#xA;&#xA;    with YoutubeDL(YDL_OPTIONS) as ydl:&#xA;        if &#x27;https://&#x27; in arg:&#xA;            info = ydl.extract_info(arg, download=False)&#xA;        else:&#xA;            info = ydl.extract_info(f"ytsearch:{arg}", download=False)[&#x27;entries&#x27;][0]&#xA;&#xA;    url = info[&#x27;formats&#x27;][0][&#x27;url&#x27;]&#xA;&#xA;    vc.play(discord.FFmpegPCMAudio(executable="ffmpeg\\bin\\ffmpeg.exe", source=url, **FFMPEG_OPTIONS))&#xA;token = open("token.txt", "r").readline()&#xA;client.run(token)&#xA;

    &#xA;

    in my server console i was getting this message&#xA;M

    &#xA;

    eepo connected&#xA;Ignoring exception in command play:&#xA;Traceback (most recent call last):&#xA;  File "C:\Users\orest\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\ext\commands\core.py", line 85, in wrapped&#xA;    ret = await coro(*args, **kwargs)&#xA;  File "C:\Users\orest\Desktop\server\bot.py", line 17, in play&#xA;    vc = await ctx.message.author.voice.channel.connect()&#xA;  File "C:\Users\orest\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\abc.py", line 1277, in connect&#xA;    voice = cls(client, self)&#xA;  File "C:\Users\orest\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\voice_client.py", line 199, in __init__&#xA;    raise RuntimeError("PyNaCl library needed in order to use voice")&#xA;RuntimeError: PyNaCl library needed in order to use voice&#xA;&#xA;The above exception was the direct cause of the following exception:&#xA;&#xA;Traceback (most recent call last):&#xA;  File "C:\Users\orest\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\ext\commands\bot.py", line 939, in invoke&#xA;    await ctx.command.invoke(ctx)&#xA;  File "C:\Users\orest\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\ext\commands\core.py", line 863, in invoke&#xA;    await injected(*ctx.args, **ctx.kwargs)&#xA;  File "C:\Users\orest\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\ext\commands\core.py", line 94, in wrapped&#xA;    raise CommandInvokeError(exc) from exc&#xA;discord.ext.commands.errors.CommandInvokeError: Command raised an exception: RuntimeError: PyNaCl library needed in order to use voice&#xA;

    &#xA;

    i cant really understand whats wrong, is there something with my code or i need more Python packages ?

    &#xA;