Recherche avancée

Médias (91)

Autres articles (66)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • Dépôt de média et thèmes par FTP

    31 mai 2013, par

    L’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
    Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)

Sur d’autres sites (5701)

  • What should I do to handle audio&video in a radio automation software ?

    24 avril 2023, par TheDaChicken

    I am currently working on a program that can be deemed as a "radio automation software."
Radio automation software focuses on audio. It may split audio frames and crossfade between different audio sources.

    


    I want to continue by adding video support for music videos. This makes it not completely about audio.

    


    There is a problem with this. Having audio porition do it's thing while video can be added along side it is difficult. For example, having access to the previous track to be able to crossfade & preloading the song.

    


    This is what I currently have which is being run in a thread.

    


    int ret;&#xA;int tryCounter{0};&#xA;int64_t end_pts{AV_NOPTS_VALUE};&#xA;int64_t end_duration{AV_NOPTS_VALUE};&#xA;while(true) {&#xA;        std::shared_ptr<cmessage> message;&#xA;&#xA;        ret = queue.Get(message, MessageQueue::MessageQueueFlags::MSQ_NON_BLOCK);&#xA;        if (ret &lt; 0) {&#xA;            if(ret == MessageQueue::MessageQueueRET::MSQ_STOPPED)&#xA;                break;&#xA;            Logger::Log(LOGWARNING, "Playback thread received: {}", ret);&#xA;            break;&#xA;        }&#xA;&#xA;        if (ret == MessageQueue::MessageQueueRET::MSQ_OK &amp;&amp; message) {&#xA;            if (message->IsType(CMessage::PLAY_SONG)) {&#xA;                /* It was requested for the Player to play a new song */&#xA;                std::shared_ptr<cmessageplaysong> songMsg = std::static_pointer_cast<cmessageplaysong>(message);&#xA;                // steal session :D&#xA;                std::unique_ptr<playersession> playerSession = std::move(songMsg->GetSession());&#xA;                if (!playerSession->GetTrack()) {&#xA;                    Logger::Log(LOGWARNING, "PlaybackThread: Ignoring playback song event due to null track");&#xA;                    goto SEND_NEXT_SONG;&#xA;                }&#xA;                if(!playerSession->GetPlaylist())&#xA;                    playerSession->SetPlaylist(m_player->GetPlaylist());&#xA;                if (playerSession->IsPreloaded())&#xA;                    Logger::Log(LOGDEBUG, "PlaybackThread: Received preloaded track.");&#xA;&#xA;                // load track if not loaded already&#xA;                if (!playerSession->Open(playerSession->GetTrack(),&#xA;                                         m_info)) {&#xA;                    Logger::Log(LOGERROR, "Failed to open input");&#xA;                    goto SEND_NEXT_SONG;&#xA;                }&#xA;&#xA;                preloadRequestSent = false;&#xA;                m_nextSession = nullptr;&#xA;&#xA;                std::shared_ptr<track> track = playerSession->GetTrack();&#xA;                track->start_sample = m_player->GetMainOutput()->GetWrittenSamples();&#xA;                track->played = true;&#xA;                // Send current song position to callback thread for the callback function to be run when song starts playing&#xA;                m_player->SendSongPosition(playerSession->GetTrack(), playerSession->GetPlaylist(),&#xA;                                 playerSession->GetTrackPosition());&#xA;&#xA;                // Grab the old one&#xA;                std::unique_ptr<playersession> oldSession = std::move(m_currentSession);&#xA;                // Set current audio instance to this input&#xA;                m_currentSession.swap(playerSession);&#xA;&#xA;                // Crossfade :D&#xA;                ret = CrossFade(oldSession, m_currentSession);&#xA;                if (ret == STREAM_MAX) {&#xA;                    // when the new song goes brrrrr.&#xA;                    // this rarely happens anyway SOO&#xA;                    m_currentSession.swap(oldSession);&#xA;                    goto SEND_NEXT_SONG;&#xA;                }&#xA;&#xA;                end_pts = AV_NOPTS_VALUE;&#xA;                end_duration = m_currentSession->GetDuration();&#xA;                if(m_currentSession->GetTrack()->info.segue_time != AV_NOPTS_VALUE)&#xA;                {&#xA;                    end_duration = m_currentSession->GetTrack()->info.segue_time;&#xA;                    // this is end duration for max samples :D&#xA;                    // this variable is dependent on timebase&#xA;                    end_pts = av_rescale_q(end_duration, CPPAV_TIME_BASE_Q, m_currentSession->GetTimeBase());&#xA;                }&#xA;            }&#xA;            if (message->IsType(CMessage::NEXT_SONG)) {&#xA;                /* request for the thread to play song next */&#xA;                std::shared_ptr<cmessagenextsong> messageNextSong = std::static_pointer_cast<cmessagenextsong>(message);&#xA;                // steal session :D&#xA;                m_nextSession = std::move(messageNextSong->GetSession());&#xA;            }&#xA;        }&#xA;&#xA;        if (!m_currentSession) {&#xA;            /* wait until there is a track that can be played */&#xA;            /* during this, portaudio should not be opened */&#xA;            m_player->GetMainOutput()->OpenPlayback(false);&#xA;            std::this_thread::sleep_for(std::chrono::milliseconds(50));&#xA;            continue;&#xA;        }&#xA;        /* there is input so output should be active */&#xA;        if (!m_player->GetMainOutput()->IsActive()) {&#xA;            m_player->GetMainOutput()->OpenPlayback(true);&#xA;        }&#xA;&#xA;        ret = m_currentSession->Decode(m_frame, end_pts);&#xA;        if (ret == STREAM_WAIT) {&#xA;            continue;&#xA;        } else if (ret == STREAM_EOF || ret == STREAM_MAX) {&#xA;            SEND_NEXT_SONG:&#xA;            if(m_player->GetCurrentTrack())&#xA;                m_player->GetCurrentTrack()->end_sample = m_player->GetMainOutput()->GetWrittenSamples();&#xA;            // Wait until the next song is in the queue for playback&#xA;            QueueNextSong(false);&#xA;            continue;&#xA;        }&#xA;        else if (ret == STREAM_ERROR) { // check &amp; handle errors&#xA;            tryCounter&#x2B;&#x2B;;&#xA;            Logger::Log(LOGERROR, "Decoder replied: Error try counter: {}/{}",&#xA;                        tryCounter, MAX_ERROR_COUNTER);&#xA;            if (tryCounter >= MAX_ERROR_COUNTER) {&#xA;                goto SEND_NEXT_SONG;&#xA;            }&#xA;            continue;&#xA;        }&#xA;        tryCounter = 0;&#xA;&#xA;        int64_t timestamp = 0;&#xA;        if (m_frame->GetPTS() != AV_NOPTS_VALUE) // must convert timestamp to static time base :D makes things easier&#xA;            timestamp = av_rescale_q(m_frame->GetPTS(), m_frame->GetTimeBase(), CPPAV_TIME_BASE_Q);&#xA;&#xA;        // Check if track is about to end to preload next track&#xA;        // TODO make 3 changeable for preloading :)))&#xA;        if (!preloadRequestSent &amp;&amp; timestamp >= end_duration - (3 * AV_TIME_BASE)) {&#xA;            Logger::Log(LOGDEBUG, "Sending next track to preload thread");&#xA;            if (QueueNextSong(true))&#xA;                preloadRequestSent = true;&#xA;        }&#xA;&#xA;        // Write frame into ringbuffer&#xA;        ret = m_player->WriteFrame(m_frame);&#xA;        assert(ret != STREAM_EOF);&#xA;        // Clean out frame :)&#xA;        m_frame->Reset();&#xA;    }&#xA;</cmessagenextsong></cmessagenextsong></playersession></track></playersession></cmessageplaysong></cmessageplaysong></cmessage>

    &#xA;

    It seems awkward already. I have a huge amount of code for preparing the song. I have to keep track of the end duration and the next song. I have to keep track of the playlist. I am using PlayerSession to grab audio frames, handle all audio packet decoding, resampling to a constant sample rate. I don't think that is going to be viable to keep.

    &#xA;

  • lavu/opencl : replace va_ext.h with standard name

    23 novembre 2018, par Ruiling Song
    lavu/opencl : replace va_ext.h with standard name
    

    Khronos OpenCL header (https://github.com/KhronosGroup/OpenCL-Headers)
    uses cl_va_api_media_sharing_intel.h. And Intel's official OpenCL driver
    for Intel GPU (https://github.com/intel/compute-runtime) was compiled
    against Khronos OpenCL header. So it's better to align with Khronos.

    Signed-off-by : Ruiling Song <ruiling.song@intel.com>

    • [DH] configure
    • [DH] libavutil/hwcontext_opencl.c
  • TypeError : 'FFmpegOpusAudio' object is not subscriptable

    12 octobre 2022, par Virat Chauhan

    I am getting this error whenever I try to get the bot to play a song in vc :

    &#xA;

    await ctx.send(&#x27;Now playing &#x27; &#x2B; &#x27;**&#x27; &#x2B; str(queues[ctx.message.guild.id][&#x27;title&#x27;][0]) &#x2B; &#x27;**&#x27;)&#xA;TypeError: &#x27;FFmpegOpusAudio&#x27; object is not subscriptable&#xA;

    &#xA;

    Here is the relevant code :

    &#xA;

      async def playSong(self, ctx, url):&#xA;    queues[ctx.message.guild.id][&#x27;title&#x27;] = []&#xA;    with youtube_dl.YoutubeDL(self.YDL_OPTIONS) as ydl:&#xA;      info = ydl.extract_info(url, download=False)&#xA;      if &#x27;entries&#x27; in info:        # if no url is input&#xA;        url2 = info[&#x27;entries&#x27;][0][&#x27;formats&#x27;][0][&#x27;url&#x27;]&#xA;        queues[ctx.message.guild.id][&#x27;title&#x27;].append(info[&#x27;entries&#x27;][0][&#x27;title&#x27;])&#xA;      elif &#x27;formats&#x27; in info:      # if url is passed&#xA;        url2 = info[&#x27;formats&#x27;][0][&#x27;url&#x27;]&#xA;        queues[ctx.message.guild.id][&#x27;title&#x27;].append(info[&#x27;title&#x27;])&#xA;      #print(queues[ctx.message.guild.id][&#x27;title&#x27;][0])&#xA;      stream = await discord.FFmpegOpusAudio.from_probe(url2, **self.FFMPEG_OPTIONS)&#xA;    return stream&#xA;  &#xA;  @commands.command(name=&#x27;play&#x27;, help="Plays any song", aliases=[&#x27;p&#x27;])&#xA;  async def play(self, ctx, *, url):&#xA;    vc = ctx.guild.voice_client&#xA;    if not vc.is_playing():&#xA;      guild = ctx.message.guild&#xA;      &#xA;      queues[guild.id] = {}&#xA;      stream = await self.playSong(ctx, url)&#xA;      queues[guild.id] = stream&#xA;      vc.play(stream, after=lambda e: self.queueCheck(guild.id, vc))&#xA;      await ctx.send(&#x27;Now playing &#x27; &#x2B; &#x27;**&#x27; &#x2B; str(queues[ctx.message.guild.id][&#x27;title&#x27;][0]) &#x2B; &#x27;**&#x27;)&#xA;

    &#xA;

    I am aware that this can be solved with having two dictionaries but I wish to contain all data inside a single structure.

    &#xA;