Recherche avancée

Médias (91)

Autres articles (74)

  • 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 ;

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

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

Sur d’autres sites (6657)

  • how spotify and other music players implement cross fading between music

    11 janvier 2023, par Arihant Jain

    I was working on a media streaming project and thought of implementing a cross fade between the next and current playing song.

    


    HLS is used for streaming music and .m3u8 file is presigned by cloudfront.

    


    Any help will be appreciated.

    


  • 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