Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (79)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

Sur d’autres sites (5536)

  • av_frame_free not freeing memory after av_frame_clone

    19 juillet 2020, par user2578525

    I want to implement zero delay frame step forward, backward. So I am maintaining a blocking queue of AVFrame. I copy (increase refcount)frame received form avcodec_receive_frame using av_frame_clone and add this cloned frame to my queue. A separate thread then dequeue this frame, display and free using av_frame_free. But somehow, this frame is not getting released, and ,my memory usage remains same after flushing whole queue. Snippets below.

    


    Decoder Thread :

    


    void *decoder(void *player) {
    // declarations
    AVFrame *decoded = av_frame_alloc();

    int read = 0;
    while((read = av_read_frame(fmt_ctx, packet)) >= 0) {
        if(packet->stream_index == vstream) {
            decode_packet(player, packet, decoded);
        }
    }
    av_frame_free(&decoded);
}

void decode_packet(Player *player, AVPacket *packet, AVFrame *decoded) {
    AVCodecContext *codec_ctx = player->vcodec_ctx;

    int ret = avcodec_send_packet(codec_ctx, packet);
    if (ret < 0) {
        log_error("avcodec_send_packet: %s", av_err2str(ret));
        return;
    }
    while(ret >= 0) {

        ret = avcodec_receive_frame(codec_ctx, decoded);
        if(ret < 0) {
            if(ret == AVERROR_EOF || ret == AVERROR(EAGAIN)) {
                break;
            }
            log_error("avcodec_receive_frame: %s", av_err2str(ret));
            av_packet_unref(packet);
            return;
        }
        AVFrame *cloned = av_frame_clone(decoded);
        queue_enqueue(player->decoder->frame_queue, cloned);

        av_frame_unref(decoded);
    }
}


    


    Render Thread :

    


    void *func_render(void *pPlayer) {
    Player *player = (Player *) pPlayer;
    Renderer *renderer = player->renderer;
    Decoder *decoder = player->decoder;

    while(!(player->state & STATE_PAUSE)) {
        AVFrame *decoded = queue_dequeue(decoder->frame_queue);

        convert_and_display_to_surface(player, decoded);

        av_frame_free(&decoded);
    }
}


    


    I am measuring memory usage after completing both threads and flushing whole queue (i.e calling av_frame_free for each frame in queue). Still I am seeing memory allocated for decoded frame are not released.

    


    If I deep copy frame instead of av_frame_clone using below snippet, everything works fine.

    


        AVFrame *copyFrame = av_frame_alloc();
    copyFrame->format = decoded->format;
    copyFrame->width = decoded->width;
    copyFrame->height = decoded->height;
    copyFrame->channels = decoded->channels;
    copyFrame->channel_layout = decoded->channel_layout;
    copyFrame->nb_samples = decoded->nb_samples;
    av_frame_get_buffer(copyFrame, 32);
    av_frame_copy(copyFrame, decoded);
    av_frame_copy_props(copyFrame, decoded);


    


    EDIT :
Debugged this problem a bit, and found that for some frame, even after calling av_frame_free, reference count to AVBufferRef remains non zero (i.e not decreasing after calling av_frame_free or av_frame_ref multiple times).

    


  • Discord.js Music Bot ffmpeg not installed ?

    16 mars 2020, par cccmdm

    I just started learning javascript with node.js and I am attempting to create a music bot, I’ve set up the command handler and everything, however, I keep getting this error when I try to run the play command

    Error : FFmpeg/avconv not found !
    at Function.getInfo (C :\Users\johnd\OneDrive\Desktop\discordBot\node_modules\prism-media\src\core\FFmpeg.js:130:11)
    at Function.create (C :\Users\johnd\OneDrive\Desktop\discordBot\node_modules\prism-media\src\core\FFmpeg.js:143:38)
    at new FFmpeg (C :\Users\johnd\OneDrive\Desktop\discordBot\node_modules\prism-media\src\core\FFmpeg.js:44:27)
    at AudioPlayer.playUnknown (C :\Users\johnd\OneDrive\Desktop\discordBot\node_modules\discord.js\src\client\voice\player\BasePlayer.js:47:20)
    at VoiceConnection.play (C :\Users\johnd\OneDrive\Desktop\discordBot\node_modules\discord.js\src\client\voice\util\PlayInterface.js:71:28)
    at C :\Users\johnd\OneDrive\Desktop\discordBot\commands\play.js:7:39
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

    I’ll post my play function below

    async function playMusic(vc,songId) {
       const stream = await ytdl(songId,{type: 'opus',filter : 'audioonly'});
       vc.join().then(connection => {
           const dispatcher = connection.play(stream,{volume: 1});
           dispatcher.on('end', end => {
               console.log("Song ended!");
               vc.leave();
           }).catch(err => console.log(err));
       }).catch(err => console.log(err));
    }

    My proof of installation : https://imgur.com/a/EFM1G6s

  • LibVLC : Retrieving current frame number

    2 avril 2015, par Solidus

    I am doing a project which involves a bit of video recording and editing and I am struggling to find a good C++ library to use. I am using QT as my framework and their video player is not working properly for me to use (seeking crashes some times, e.g.). Also, I need to record video and audio from my camera and QCamera does not work in windows (for recording).

    On my program the user can draw on top of the video and I need to store the start frame and the end frame of those drawings.

    Right now I’ve been testing Libvlc which almost does what I want. From what I can see they don’t have a way to just jump to a certain frame as this can only be done by time or position.

    The first solution that I came up with was to capture the time change event and then calculate the frame using the FPS. The problem is that, as far as I can tell, the interval of this event is around 250ms, which for a 15fps video is almost 4 frames.

    So, the second solution was to use libvlc_video_set_callbacks to make my own "lock, unlock and display" and count the frames there. This works for recording from the camera, as there is no going back and the frames go from 0 until the video stops. The problem is when playing a video. Since there is no timestamp, as far as I can tell, there is no way for me to know in which frame number I am (the user can be seeking for example). My "hacky" solution was to have a "lastTime" and "numTimes" on the struct I pass into these callbacks and this is what I do :

    lastTime represents the "last new time" received and numTimes represents the number of times lastTime was received.

    get_the_current_time
    calculate_frame_num_with_fps
    if current_time is equal to lastTime:
        frameNum += numTimes
        numTimes++
    else
        lastTime = current_time
        numTimes = 1

    This kinda works but I hate the solution. I’m not sure if when doing seeking the time changes if the difference is less than 250ms. That would maybe be kinda hard for a user to do but I’d prefer not to implement it like that.

    So my question is if there is another solution for this ? If not, any libraries that could help me on this ? I know about FFMPEG which seems would solve me this problem as it’s more low level and I could implement this solution. The problem is my deadline is approaching and that would still me take some time (learning the library and doing all the work). So I was thinking of it as a last resort.

    Thank you for your time.