Recherche avancée

Médias (2)

Mot : - Tags -/kml

Autres articles (72)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Problèmes fréquents

    10 mars 2010, par

    PHP et safe_mode activé
    Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
    La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site

Sur d’autres sites (7355)

  • voice_client.play doesn't continue loop (Discord)

    19 mars 2023, par Razurio
    songs = asyncio.Queue(maxsize=0)
currently_playing = False


@client.command()
async def play(ctx, url):
    global songs
    global currently_playing
    if currently_playing:
        with yt_dlp.YoutubeDL({"format": "bestaudio", "outtmpl": "Queue_Download/%(title)s.%(ext)s"}) as ydl:
            info = ydl.extract_info(url, download=True)
            filename = ydl.prepare_filename(info)
            await songs.put({"file": filename, "info": video_info(url)})
            # print("test 1")
    else:
        with yt_dlp.YoutubeDL({"format": "bestaudio", "outtmpl": "Queue_Download/%(title)s.%(ext)s"}) as ydl:
            info = ydl.extract_info(url, download=True)
            filename = ydl.prepare_filename(info)
            await songs.put({"file": filename, "info": video_info(url)})
            # print("test 2")
        asyncio.create_task(queue(ctx))



async def queue(ctx):
    global songs
    global currently_playing
    currently_playing = True
    while True:
        if songs.empty():
            currently_playing = False
            await ctx.reply("Queue is now empty")
            await ctx.voice_client.disconnect()  # disconnect from voice channel when queue is empty
            break
        else:    
            song = await songs.get()
            filename = song["file"]
            voice_channel = ctx.author.voice.channel
            if not ctx.voice_client:  # check if bot is not already connected to a voice channel
                await voice_channel.connect()

            await ctx.reply('playing')
            await ctx.voice_client.play(discord.FFmpegPCMAudio(filename))

@client.command()
async def stop(ctx):
    global songs
    await ctx.voice_client.disconnect()
    await empty_queue(songs)
    await ctx.reply('Stopped')

async def empty_queue(songs):
    while not songs.empty():
        songs.get_nowait()


    


    I have problems with the "await ctx.voice_client.play(discord.FFmpegPCMAudio(filename))" which doesn't continue after finishing.

    


    I know you can use a after= parameter in voice_client.play() but I didn't manage to get it to work to recursivly call queue()

    


  • ffmpeg low speed and wrong bitrate

    31 août 2018, par ngc3o34

    My goal is to compress video making it’s bitrate lower.
    For experiment I used following command

    ffmpeg -ss 00:00:00 -i V.mkv -to 00:10:00 -c:a copy -b:v 7500k -maxrate 7500k -minrate 5500k -bufsize 1M V7500.mkv

    1. What are possible reasons speed of conversion was close to 1.0x utilizing all 8 cores ?
    2. Bitrate of output video stream is about 4700 (5500 was set as minrate). Is there proper way to specify bitrate ?

    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
     Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    [libx264 @ 0x55e54ad189a0] using SAR=1/1
    [libx264 @ 0x55e54ad189a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
    [libx264 @ 0x55e54ad189a0] profile High, level 4.0
    [libx264 @ 0x55e54ad189a0] 264 - core 152 r2854 e9a5903 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=cbr mbtree=1 bitrate=7500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=7500 vbv_bufsize=1000 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
    Output #0, matroska, to 'V7500.mkv':
     Metadata:
       title           : Valerian.and.the.City.of.a.Thousand.Planets.2017.1080p.BluRay.x264.DTS-HD.MA.7.1-FGT
       encoder         : Lavf57.83.100
       Chapter #0:0: start 0.000000, end 600.000000
       Metadata:
         title           : Chapter 01
       Stream #0:0(eng): Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 1920x804 [SAR 1:1 DAR 160:67], q=-1--1, 7500 kb/s, 23.98 fps, 1k tbn, 23.98 tbc (default)
       Metadata:
         title           : Valerian.and.the.City.of.a.Thousand.Planets.2017.1080p.BluRay.x264.DTS-HD.MA.7.1-FGT
         DURATION        : 02:17:03.277000000
         encoder         : Lavc57.107.100 libx264
       Side data:
         cpb: bitrate max/min/avg: 7500000/0/7500000 buffer size: 1000000 vbv_delay: -1
       Stream #0:1(eng): Audio: aac (LC) ([255][0][0][0] / 0x00FF), 48000 Hz, stereo, fltp (default)
       Metadata:
         title           : Valerian.and.the.City.of.a.Thousand.Planets.2017.1080p.BluRay.x264.DTS-HD.MA.7.1-FGT
         ENCODER         : Lavc57.107.100 aac
         DURATION        : 02:17:03.317000000
    Past duration 0.994987 too large
    frame=14385 fps= 31 q=-1.0 Lsize=  363641kB time=00:09:59.99 bitrate=4964.9kbits/s speed=1.28x    
  • FFmpeg on Azure Function call running slowly and producing an empty output file

    7 novembre 2017, par The Lemon

    I’m trying to make a function which uses ffmpeg, so far I haven’t been able to get anything other than the -version command to work properly. When I try to run a simple ffmpeg -i {input file path} {output file path} command, the function seems to get stuck for 3-4 minutes (in the process creating an empty output file), then try again and produce the error ’file already exists’. I’ve tried switching between the 64 bit ffmpeg.exe and the 32 bit ffmpeg.exe with the function running as both a 32 and 64 bit function. My code and the associated logs from trying to run the code are included below, if anyone can tell me what I’m doing wrong or how to get the process to work it would be greatly appreciated. Thanks in advance, Cuan

    edit : The process works on kudu with the same files, the output is shown at the bottom. On kudu the process ran in under half a minute, clearly something is causing the function process to hang, if anyone has advice it would be greatly appreciated. Thanks again, Cuan.

    second edit : I tried adding the -y to the end of my command, this works in that it no longer complains about overwriting, but alas it now just hangs twice due to timeout. (output at the bottom)

    edit the third : azure has a way to let you run functions locally, my function ran into the same issues on the local version but : as it turns out the actual processing is done within a few seconds, it just takes forever to decide to write to a file - if you terminate the process manually after the process had been running for 10 seconds the file immediately gets written. Again, any help is appreciated. Cuan.

    Run.csx :

    using System.Net;
    using System;
    using System.Diagnostics;
    using System.ComponentModel;
    public static async Task<httpresponsemessage> Run(HttpRequestMessage req, TraceWriter log)
    {
       log.Info("C# HTTP trigger function processed a request.");
       Process process = new Process();
       process.StartInfo.FileName = @"D:\home\site\wwwroot\HttpTestFunction\ffmpeg64.exe";
       string tmp = String.Format("-i \"" + "Airdocs Background Video.mp4" + "\" \"" + "tmpOut2.mp4" + "\"");
       log.Info("ffmpeg argument is: "+tmp);
       process.StartInfo.Arguments = tmp;
       process.StartInfo.UseShellExecute = false;
       process.StartInfo.RedirectStandardOutput = true;
       process.StartInfo.RedirectStandardError = true;
       process.StartInfo.WorkingDirectory = @"D:\home\site\wwwroot\HttpTestFunction";
       process.Start();
       log.Info("process started");
       string output = process.StandardOutput.ReadToEnd();
       string err = process.StandardError.ReadToEnd();
       log.Info("output:" + output);
       log.Info("error:"+err);
       process.WaitForExit();
    }
    </httpresponsemessage>

    Logs :

    2017-10-14T02:17:10.514 Function started (Id=e4ec7d1e-2bcb-4b74-8af2-15124f1576fb)
    2017-10-14T02:17:10.639 C# HTTP trigger function processed a request.
    2017-10-14T02:17:10.639 ffmpeg argument is: -i "Airdocs Background Video.mp4" "tmpOut2.mp4"
    2017-10-14T02:17:10.779 process started
    2017-10-14T02:18:15  No new trace in the past 1 min(s).
    2017-10-14T02:19:15  No new trace in the past 2 min(s).
    2017-10-14T02:20:15  No new trace in the past 3 min(s).
    2017-10-14T02:21:02.188 Function started (Id=b2ae9b59-8933-42e3-986c-fd26a6886285)
    2017-10-14T02:21:02.188 C# HTTP trigger function processed a request.
    2017-10-14T02:21:02.188 ffmpeg argument is: -i "Airdocs Background Video.mp4" "tmpOut2.mp4"
    2017-10-14T02:21:02.252 process started
    2017-10-14T02:21:02.377 output:
    2017-10-14T02:21:02.377 error:ffmpeg version N-87353-g183fd30 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 7.2.0 (GCC)
     configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib
     libavutil      55. 76.100 / 55. 76.100
     libavcodec     57.106.101 / 57.106.101
     libavformat    57. 82.101 / 57. 82.101
     libavdevice    57.  8.101 / 57.  8.101
     libavfilter     6.105.100 /  6.105.100
     libswscale      4.  7.103 /  4.  7.103
     libswresample   2.  8.100 /  2.  8.100
     libpostproc    54.  6.100 / 54.  6.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Airdocs Background Video.mp4':
     Metadata:
       major_brand     : mp42
       minor_version   : 0
       compatible_brands: mp41isom
       creation_time   : 2017-09-08T11:55:11.000000Z
     Duration: 00:00:24.02, start: 0.000000, bitrate: 105 kb/s
       Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 104 kb/s, 30.30 fps, 30.30 tbr, 30k tbn, 60 tbc (default)
       Metadata:
         creation_time   : 2017-09-08T11:55:11.000000Z
         handler_name    : VideoHandler
         encoder         : AVC Coding
    File 'tmpOut2.mp4' already exists. Overwrite ? [y/N] Not overwriting - exiting
    2017-10-14T02:21:02.392 Function completed (Success, Id=b2ae9b59-8933-42e3-986c-fd26a6886285, Duration=205ms)
    2017-10-14T02:22:10.563 Function completed (Failure, Id=e4ec7d1e-2bcb-4b74-8af2-15124f1576fb, Duration=300047ms)
    2017-10-14T02:22:10.610 Microsoft.Azure.WebJobs.Host: Timeout value of 00:05:00 was exceeded by function: Functions.HttpTestFunction.

    Kudu code (just running the ffmpeg command directly, not the run.csx file) :

    D:\home\site\wwwroot\HttpTestFunction>ffmpeg -i "Airdocs Background Video.mp4" tmpout3.mp4


    ffmpeg version N-87196-g6cadbb1 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 7.1.0 (GCC)
     configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
     libavutil      55. 74.100 / 55. 74.100
     libavcodec     57.105.100 / 57.105.100
     libavformat    57. 81.100 / 57. 81.100
     libavdevice    57.  8.100 / 57.  8.100
     libavfilter     6.101.100 /  6.101.100
     libswscale      4.  7.103 /  4.  7.103
     libswresample   2.  8.100 /  2.  8.100
     libpostproc    54.  6.100 / 54.  6.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Airdocs Background Video.mp4':
     Metadata:
       major_brand     : mp42
       minor_version   : 0
       compatible_brands: mp41isom
       creation_time   : 2017-09-08T11:55:11.000000Z
     Duration: 00:00:24.02, start: 0.000000, bitrate: 105 kb/s
       Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 104 kb/s, 30.30 fps, 30.30 tbr, 30k tbn, 60 tbc (default)
       Metadata:
         creation_time   : 2017-09-08T11:55:11.000000Z
         handler_name    : VideoHandler
         encoder         : AVC Coding
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
    Press [q] to stop, [?] for help
    [libx264 @ 00000000005fc5a0] using SAR=1/1
    [libx264 @ 00000000005fc5a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 00000000005fc5a0] profile High, level 3.2
    [libx264 @ 00000000005fc5a0] 264 - core 152 r2851 ba24899 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to 'tmpout3.mp4':
     Metadata:
       major_brand     : mp42
       minor_version   : 0
       compatible_brands: mp41isom
       encoder         : Lavf57.81.100
       Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 30.30 fps, 16k tbn, 30.30 tbc (default)
       Metadata:
         creation_time   : 2017-09-08T11:55:11.000000Z
         handler_name    : VideoHandler
         encoder         : Lavc57.105.100 libx264
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    frame=  728 fps= 39 q=29.0 Lsize=      62kB time=00:00:23.92 bitrate=  21.1kbits/s speed=1.28x    
    video:52kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 17.915474%
    [libx264 @ 00000000005fc5a0] frame I:4     Avg QP:12.46  size:  6102
    [libx264 @ 00000000005fc5a0] frame P:184   Avg QP:16.94  size:    45
    [libx264 @ 00000000005fc5a0] frame B:540   Avg QP:20.50  size:    37
    [libx264 @ 00000000005fc5a0] consecutive B-frames:  1.1%  0.0%  0.0% 98.9%
    [libx264 @ 00000000005fc5a0] mb I  I16..4: 66.3% 30.4%  3.3%
    [libx264 @ 00000000005fc5a0] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip:100.0%
    [libx264 @ 00000000005fc5a0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.0%  0.0%  0.0%  direct: 0.0%  skip:100.0%  L0:12.3% L1:87.7% BI: 0.0%
    [libx264 @ 00000000005fc5a0] 8x8 transform intra:30.5% inter:14.3%
    [libx264 @ 00000000005fc5a0] coded y,uvDC,uvAC intra: 2.3% 2.2% 2.1% inter: 0.0% 0.0% 0.0%
    [libx264 @ 00000000005fc5a0] i16 v,h,dc,p: 93%  6%  2%  0%
    [libx264 @ 00000000005fc5a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 41% 31%  0%  0%  0%  0%  0%  0%
    [libx264 @ 00000000005fc5a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 39% 17% 16%  5%  4%  5%  6%  3%  5%
    [libx264 @ 00000000005fc5a0] i8c dc,h,v,p: 93%  6%  1%  0%
    [libx264 @ 00000000005fc5a0] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 00000000005fc5a0] ref B L1: 98.2%  1.8%
    [libx264 @ 00000000005fc5a0] kb/s:17.57



    D:\home\site\wwwroot\HttpTestFunction>

    Output on azure with the -y command

    2017-10-25T04:34:45.519 Compilation succeeded.
    2017-10-25T04:34:46.160 Function started (Id=18880991-c93a-42a3-96b6-7df283e3bdb4)
    2017-10-25T04:34:46.300 C# HTTP trigger function processed a request.
    2017-10-25T04:34:46.300 ffmpeg argument is: -i "Airdocs Background Video.mp4" "tmpOut2.mp4" -y
    2017-10-25T04:34:46.394 process started
    2017-10-25T04:36:46  No new trace in the past 1 min(s).
    2017-10-25T04:37:46  No new trace in the past 2 min(s).
    2017-10-25T04:38:37.947 Function started (Id=c7f7f768-c53b-4074-a0c2-8391848bbd80)
    2017-10-25T04:38:37.963 C# HTTP trigger function processed a request.
    2017-10-25T04:38:37.963 ffmpeg argument is: -i "Airdocs Background Video.mp4" "tmpOut2.mp4" -y
    2017-10-25T04:38:38.025 process started
    2017-10-25T04:39:46  No new trace in the past 1 min(s).
    2017-10-25T04:39:46.258 Function completed (Failure, Id=18880991-c93a-42a3-96b6-7df283e3bdb4, Duration=300079ms)
    2017-10-25T04:39:46.321 Microsoft.Azure.WebJobs.Host: Timeout value of 00:05:00 was exceeded by function: Functions.HttpTestFunction.