Recherche avancée

Médias (0)

Mot : - Tags -/auteurs

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

Autres articles (52)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

Sur d’autres sites (6193)

  • FFMpeg C++ encoder fails with hardware acceleration quick sync intel

    28 août 2022, par teals

    I am trying to debug an issue I have with a simple C++ encoder using FFMmpeg. The following code below works correctly on these other hardware acceleration systems/platforms :

    


      

    • Mac/VideoToolbox,
    • 


    • Cuda/NVEnc
    • 


    • Raspberry pi/h264_v4l2m2m.
    • 


    


    It fails on intel quick sync at avcodec_open2. I'm using Ubuntu 22.04. I built FFMpeg from source with the Intel Media SDK installed and configured. I verified that the QuickSync install works. I also have a corresponding decoder implementation that works correctly using intel quick sync. So I know everything properly installed. I am also running this on an 11th Gen Intel CPU.

    


    [hevc_qsv @ 0x564b0d34f0c0] Low power mode is unsupported (This sometimes shows up)
[hevc_qsv @ 0x563691234000] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height


    


    This is the only error that I get and I haven't found any helpful resources. I tried playing around with different parameters but nothing seems to work. Any help or insight would be extremely helpful.

    


    bool VideoEncoder::create() {&#xA;    char const* outfile = filePath.c_str();&#xA;&#xA;     // open output format context&#xA;    int ret = avformat_alloc_output_context2(&amp;ofctx, nullptr, nullptr, outfile);&#xA;    if (ret &lt; 0) {&#xA;        std::cerr &lt;&lt; "fail to avformat_alloc_output_context2(" &lt;&lt; outfile &lt;&lt; "): ret=" &lt;&lt; ret;&#xA;        return false;&#xA;    }&#xA;&#xA;    // create new video stream&#xA;    const AVCodec* codec = avcodec_find_encoder_by_name(encoderName.c_str());&#xA;    vstrm = avformat_new_stream(ofctx, codec);&#xA;    if (!vstrm) {&#xA;        std::cerr &lt;&lt; "fail to avformat_new_stream";&#xA;        return false;&#xA;    }&#xA;&#xA;    // open video encoder&#xA;    cctx = avcodec_alloc_context3(codec);&#xA;    if (!vstrm) {&#xA;        std::cerr &lt;&lt; "fail to avcodec_alloc_context3";&#xA;        return false;&#xA;    }&#xA;    const AVRational dst_fps = {fps, 1};&#xA;    cctx->width = width;&#xA;    cctx->height = height;&#xA;    if(pixel_format != AV_PIX_FMT_NONE) {&#xA;        cctx->pix_fmt = pixel_format;&#xA;    }&#xA;    else {&#xA;        cctx->pix_fmt = codec->pix_fmts[0];&#xA;    }&#xA;    cctx->time_base = av_inv_q(dst_fps);&#xA;    cctx->framerate = dst_fps;&#xA;    cctx->bit_rate = bitrate * 1000000;&#xA;&#xA;&#xA;    AVDictionary* options = nullptr;&#xA;    if(gpu_id >= 0) {&#xA;        av_dict_set_int(&amp;options, "gpu", gpu_id, 0);&#xA;    }&#xA;&#xA;    &#xA;    if (ofctx->oformat->flags &amp; AVFMT_GLOBALHEADER)&#xA;        cctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;&#xA;    ret = avcodec_open2(cctx, codec, &amp;options);&#xA;    if (ret &lt; 0) {&#xA;        std::cerr &lt;&lt; "fail to avcodec_open2: ret=" &lt;&lt; ret;&#xA;        return false;&#xA;    }&#xA;    avcodec_parameters_from_context(vstrm->codecpar, cctx);&#xA;&#xA;    //For mac/quicktime we need to add hvc1 tag.&#xA;    if (encoderName.find("hevc") != std::string::npos) {&#xA;        vstrm->codecpar->codec_tag = MKTAG(&#x27;h&#x27;, &#x27;v&#x27;, &#x27;c&#x27;, &#x27;1&#x27;);&#xA;    }&#xA;&#xA;    /*&#xA;    std::cout&#xA;        &lt;&lt; "outfile: " &lt;&lt; outfile &lt;&lt; "\n"&#xA;        &lt;&lt; "format:  " &lt;&lt; ofctx->oformat->name &lt;&lt; "\n"&#xA;        &lt;&lt; "vcodec:  " &lt;&lt; codec->name &lt;&lt; "\n"&#xA;        &lt;&lt; "size:    " &lt;&lt; width &lt;&lt; &#x27;x&#x27; &lt;&lt; height &lt;&lt; "\n"&#xA;        &lt;&lt; "fps:     " &lt;&lt; av_q2d(cctx->framerate) &lt;&lt; "\n"&#xA;        &lt;&lt; "pixfmt:  " &lt;&lt; av_get_pix_fmt_name(cctx->pix_fmt) &lt;&lt; "\n"&#xA;        &lt;&lt; std::flush;*/&#xA;&#xA;    // initialize sample scaler&#xA;    swsCtx = sws_getContext(&#xA;        width, height, AV_PIX_FMT_BGR24,&#xA;        width, height, cctx->pix_fmt,&#xA;        SWS_BILINEAR, nullptr, nullptr, nullptr);&#xA;    if (!swsCtx) {&#xA;        std::cerr &lt;&lt; "fail to sws_getContext";&#xA;        return false;&#xA;    }&#xA;&#xA;    // allocate frame buffer for encoding&#xA;    frame = av_frame_alloc();&#xA;    frame->width = width;&#xA;    frame->height = height;&#xA;    frame->format = static_cast<int>(cctx->pix_fmt);&#xA;    ret = av_frame_get_buffer(frame, 32);&#xA;    if (ret &lt; 0) {&#xA;        std::cerr &lt;&lt; "fail to av_frame_get_buffer: ret=" &lt;&lt; ret;&#xA;        return false;&#xA;    }&#xA;&#xA;    // allocate packet to retrive encoded frame&#xA;    pkt = av_packet_alloc();&#xA;    // open output IO context&#xA;    ret = avio_open2(&amp;ofctx->pb, outfile, AVIO_FLAG_WRITE, nullptr, nullptr);&#xA;    if (ret &lt; 0) {&#xA;        std::cerr &lt;&lt; "fail to avio_open2: ret=" &lt;&lt; ret;&#xA;        return false;&#xA;    }&#xA;&#xA;    // write media container header (if any)&#xA;    ret = avformat_write_header(ofctx, nullptr);&#xA;    if (ret &lt; 0) {&#xA;        std::cerr &lt;&lt; "fail to avformat_write_header: ret=" &lt;&lt; ret;&#xA;        return false;&#xA;    }&#xA;&#xA;    return true;&#xA;}&#xA;</int>

    &#xA;

  • Trolls in trouble

    6 juin 2013, par Mans — Law and liberty

    Life as a patent troll is hopefully set to get more difficult. In a memo describing patent trolls as a “drain on the American economy,” the White House this week outlined a number of steps it is taking to stem this evil tide. Chiming in, the Chief Judge of the Court of Appeals for the Federal Circuit (where patent cases are heard) in a New York Times op-ed laments the toll patent trolling is taking on the industry, and urges judges to use powers already at their disposal to make the practice less attractive. However, while certainly a step in the right direction, these measures all fail to address the more fundamental properties of the patent system allowing trolls to exist in the first place.

    System and method for patent trolling

    Most patent trolling operations comprise the same basic elements :

    1. One or more patents with broad claims.
    2. The patents of (1) acquired by an otherwise non-practising entity (troll).
    3. The entity of (2) filing numerous lawsuits alleging infringement of the patents of (1).
    4. The lawsuits of (3) targeting end users or retailers.
    5. The lawsuits of (3) listing as plaintiffs difficult to trace shell companies.

    The recent legislative actions all take aim at the latter entries in this list. In so doing, they will no doubt cripple the trolls, but the trolls will remain alive, ready to resume their wicked ways once a new loophole is found in the system.

    To kill a patent troll

    As Judge Rader and his co-authors point out in the New York Times, “the problem stems largely from the fact that, [...] trolls have an important strategic advantage over their adversaries : they don’t make anything.” This is the heart of the troll, and this is where the blow should be struck. Our weapon shall be the mightiest judicial sword of all, the Constitution.

    The United States Constitution contains (in Article I, Section 8) the foundation for the patent system (emphasis mine) :

    The Congress shall have Power [...] To promote the Progress of Science and useful Arts, by securing for limited Times to Authors and Inventors the exclusive Right to their respective Writings and Discoveries.

    Patent trolls are typically not inventors. They are merely hoarders of other people’s discarded inventions, and that allowing others to reap the benefits of an inventor’s work would somehow promote progress should be a tough argument. Indeed, it is the dissociation between investment and reward which has allowed the patent trolls to rise and prosper.

    In light of the above, the solution to the troll menace is actually strikingly simple : make patents non-transferable.

    Having the inventor retain the rights to his or her inventions (works for hire still being recognised), would render the establishment of non-practising entities, which most trolls are, virtually impossible. The original purpose of patents, to protect the investment of inventors, would remain unaffected, if not strengthened, by such a change.

    Links

  • FFmpegPCMaudio doesn't work on my server but it works on my computer

    4 mai 2023, par Alex

    I am developing a Discord bot with python that can play music. When I do the tests on my computer all work find but when I take all the files to put there in my server it stop working. So I tried to run it on an other computer and no, it still does not work.

    &#xA;

    First I was thinking it was a power problems but the other computer is almost the same. I tried to install all the packages that I have on my computer to the second but the music part still not work. It's not a Discord API problem because my others commands work find.

    &#xA;

    import discord&#xA;from discord.ext import commands&#xA;from youtube_dl import YoutubeDL&#xA;&#xA;&#xA;class music_cog(commands.Cog):&#xA;    def __init__(self, bot):&#xA;        self.bot = bot&#xA;&#xA;        # all the music related stuff&#xA;        self.is_playing = False&#xA;&#xA;        # 2d array containing [song, channel]&#xA;        self.music_queue = []&#xA;        self.YDL_OPTIONS = {&#x27;format&#x27;: &#x27;bestaudio&#x27;, &#x27;noplaylist&#x27;: &#x27;True&#x27;}&#xA;        self.FFMPEG_OPTIONS = {&#x27;before_options&#x27;: &#x27;-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5&#x27;,&#xA;                               &#x27;options&#x27;: &#x27;-vn&#x27;}&#xA;&#xA;        self.vc = ""&#xA;&#xA;    # searching the item on youtube&#xA;    def search_yt(self, item):&#xA;        with YoutubeDL(self.YDL_OPTIONS) as ydl:&#xA;            try:&#xA;                info = ydl.extract_info("ytsearch:%s" % item, download=False)[&#x27;entries&#x27;][0]&#xA;            except Exception:&#xA;                return False&#xA;&#xA;        return {&#x27;source&#x27;: info[&#x27;formats&#x27;][0][&#x27;url&#x27;], &#x27;title&#x27;: info[&#x27;title&#x27;]}&#xA;&#xA;    def play_next(self):&#xA;        if len(self.music_queue) > 0:&#xA;            self.is_playing = True&#xA;&#xA;            # get the first url&#xA;            m_url = self.music_queue[0][0][&#x27;source&#x27;]&#xA;&#xA;            # remove the first element as you are currently playing it&#xA;            self.music_queue.pop(0)&#xA;&#xA;            self.vc.play(discord.FFmpegPCMAudio(m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())&#xA;        else:&#xA;            self.is_playing = False&#xA;&#xA;    # infinite loop checking&#xA;    async def play_music(self):&#xA;        if len(self.music_queue) > 0:&#xA;            self.is_playing = True&#xA;&#xA;            m_url = self.music_queue[0][0][&#x27;source&#x27;]&#xA;&#xA;            # try to connect to voice channel if you are not already connected&#xA;&#xA;            if self.vc == "" or not self.vc.is_connected() or self.vc == None:&#xA;                self.vc = await self.music_queue[0][1].connect()&#xA;            else:&#xA;                await self.vc.move_to(self.music_queue[0][1])&#xA;&#xA;            print(self.music_queue)&#xA;            # remove the first element as you are currently playing it&#xA;            self.music_queue.pop(0)&#xA;&#xA;            self.vc.play(discord.FFmpegPCMAudio(m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())&#xA;        else:&#xA;            self.is_playing = False&#xA;&#xA;    @commands.command(name="play", help="Plays a selected song from youtube")&#xA;    async def p(self, ctx, *args):&#xA;        query = " ".join(args)&#xA;&#xA;        voice_channel = discord.utils.get(ctx.guild.voice_channels, name=&#x27;General&#x27;)&#xA;        if voice_channel is None:&#xA;            # you need to be connected so that the bot knows where to go&#xA;            await ctx.send("Connect to a voice channel!")&#xA;        else:&#xA;            song = self.search_yt(query)&#xA;            if type(song) == type(True):&#xA;                await ctx.send(&#xA;                    "Could not download the song. Incorrect format try another keyword. This could be due to playlist or a livestream format.")&#xA;            else:&#xA;                await ctx.send("Song added to the queue")&#xA;                self.music_queue.append([song, voice_channel])&#xA;&#xA;                if self.is_playing == False:&#xA;                    await self.play_music()&#xA;&#xA;    @commands.command(name="queue", help="Displays the current songs in queue")&#xA;    async def q(self, ctx):&#xA;        retval = ""&#xA;        for i in range(0, len(self.music_queue)):&#xA;            retval &#x2B;= self.music_queue[i][0][&#x27;title&#x27;] &#x2B; "\n"&#xA;&#xA;        print(retval)&#xA;        if retval != "":&#xA;            await ctx.send(retval)&#xA;        else:&#xA;            await ctx.send("No music in queue")&#xA;&#xA;    @commands.command(name="skip", help="Skips the current song being played")&#xA;    async def skip(self, ctx):&#xA;        if self.vc != "" and self.vc:&#xA;            self.vc.stop()&#xA;            # try to play next in the queue if it exists&#xA;            await self.play_music()&#xA;&#xA;    @commands.command(name="disconnect", help="Disconnecting bot from VC")&#xA;    async def dc(self, ctx):&#xA;        await self.vc.disconnect()&#xA;&#xA;    @commands.command(name="pause")&#xA;    async def pause(self, ctx):&#xA;        voice = discord.utils.get(self.bot.voice_clients, guild=ctx.guild)&#xA;        if voice.is_playing():&#xA;            voice.pause()&#xA;        else:&#xA;            await ctx.send("Currently no audio is playing.")&#xA;&#xA;    @commands.command(name="resume")&#xA;    async def resume(self, ctx):&#xA;        voice = discord.utils.get(self.bot.voice_clients, guild=ctx.guild)&#xA;        if voice.is_paused():&#xA;            voice.resume()&#xA;        else:&#xA;            await ctx.send("The audio is not paused.")&#xA;

    &#xA;

    There are not any error messages, the bot just joins the voice chat and does nothing.

    &#xA;

    If someone can tell me we it work just on my computer I will be very grateful.

    &#xA;

    My files :&#xA;my files

    &#xA;