Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (59)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • 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

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

Sur d’autres sites (8789)

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

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

    &#xA;

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

    &#xA;

    Any help will be appreciated.

    &#xA;

  • FileNotFoundError : [Errno 2] No such file or directory : 'ffmpeg'

    9 février 2021, par stackoverflow

    I'm new in python and i'm using pydub modules to play mp3 track.

    &#xA;&#xA;

    Here is my simple code to play mp3 :

    &#xA;&#xA;

    #Let&#x27;s play some mp3 files using python!&#xA;&#xA;from pydub import AudioSegment&#xA;from pydub.playback import play&#xA;&#xA;song = AudioSegment.from_mp3("/media/rajendra/0C86E11786E10256/05_I_Like_It_Rough.mp3")&#xA;play(song)&#xA;

    &#xA;&#xA;

    When i run this program, it says :

    &#xA;&#xA;

    */usr/bin/python3.4 /home/rajendra/PycharmProjects/pythonProject5/myProgram.py&#xA;/usr/local/lib/python3.4/dist-packages/pydub/utils.py:161: RuntimeWarning: Couldn&#x27;t find ffmpeg or avconv - defaulting to ffmpeg, but may not work&#xA;  warn("Couldn&#x27;t find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)&#xA;/usr/local/lib/python3.4/dist-packages/pydub/utils.py:174: RuntimeWarning: Couldn&#x27;t find ffplay or avplay - defaulting to ffplay, but may not work&#xA;  warn("Couldn&#x27;t find ffplay or avplay - defaulting to ffplay, but may not work", RuntimeWarning)&#xA;Traceback (most recent call last):&#xA;  File "/home/rajendra/PycharmProjects/pythonProject5/myProgram.py", line 11, in <module>&#xA;    song = AudioSegment.from_mp3("/media/rajendra/0C86E11786E10256/05_I_Like_It_Rough.mp3")&#xA;  File "/usr/local/lib/python3.4/dist-packages/pydub/audio_segment.py", line 355, in from_mp3&#xA;    return cls.from_file(file, &#x27;mp3&#x27;)&#xA;  File "/usr/local/lib/python3.4/dist-packages/pydub/audio_segment.py", line 339, in from_file&#xA;    retcode = subprocess.call(convertion_command, stderr=open(os.devnull))&#xA;  File "/usr/lib/python3.4/subprocess.py", line 533, in call&#xA;    with Popen(*popenargs, **kwargs) as p:&#xA;  File "/usr/lib/python3.4/subprocess.py", line 848, in __init__&#xA;    restore_signals, start_new_session)&#xA;  File "/usr/lib/python3.4/subprocess.py", line 1446, in _execute_child&#xA;    raise child_exception_type(errno_num, err_msg)&#xA;FileNotFoundError: [Errno 2] No such file or directory: &#x27;ffmpeg&#x27;&#xA;&#xA;Process finished with exit code 1*&#xA;</module>

    &#xA;&#xA;

    Please help me ! I've checked everything path but it's not working. I'm currently using Ubuntu.

    &#xA;&#xA;

    Help would be appreciated !

    &#xA;