Recherche avancée

Médias (1)

Mot : - Tags -/vidéo

Autres articles (37)

  • Configuration spécifique pour PHP5

    4 février 2011, par

    PHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
    Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
    Modules spécifiques
    Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

Sur d’autres sites (8385)

  • Revision 891793a540 : Conditionally skip reference frame check For regular inter frames, if the dista

    29 septembre 2014, par Jingning Han

    Changed Paths :
     Modify /vp9/encoder/vp9_rdopt.c



    Conditionally skip reference frame check

    For regular inter frames, if the distance from GOLDEN_FRAME is larger
    than 2 and if the predicted motion vector of LAST_FRAME gives lower
    sse than that of GOLDEN_FRAME, skip the GOLDE_FRAME mode checking in
    the rate-distortion optimization. It provides about 5% speed-up at
    expense of -0.137% and -0.230% performance down for speed 3. Local
    experiment results :

    pedestrian 1080p 2000 kbps
    66712 b/f, 40.908 dB, 113688 ms ->
    66768 b/f, 40.911 dB, 108752 ms

    blue_sky 1080p 2000 kbps
    51054 b/f, 35.894 dB, 70406 ms ->
    51051 b/f, 35.891 dB, 67236 ms

    old_town_cross 720p 1500 kbps
    14412 b/f, 36.252 dB, 60690 ms ->
    14431 b/f, 36.249 dB, 57346 ms

    Change-Id : Idfcafe7f63da7a4896602fc60bd7093f0f0d82ca

  • Extraction motion vectors from H.264 bitstream [on hold]

    22 juillet 2015, par Serhan

    I’m looking for an open-source tool/code or some guidance to extract the motion vectors (MVs) of a H.264 encoded bit sequence. I’m already aware that motion vectors can be visualized using ffmpeg with the following command :

    ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb

    However, I want to produce a log file where the MVs of P and B frames are listed frame by frame. I checked out the structure of MVs from libavutil/motion_vector.h, but I couldn’t find an example which shows how they are extracted and laid over the original sequence by ffplay. I thought that if I can find that out, I could possibly re-arrange the code to extract the MVs to a text file.

    I also tried the code given in this answer, but it doesn’t seem to work with the newer versions of ffmpeg :

    I would appreciate any example codes or hints.

  • Access violation reading location when opening avfromat_open_input

    28 mai 2023, par nokla

    I am trying to build a function for reading a video from .mp4 file using ffmpeg and c++.

    


    This function was already working on one computer but when I copied the code to another one, with the same environment it returned the following error :

    


    Exception thrown at 0x00007FFC81B7667C (avutil-57.dll)
in VideoEditor.exe: 0xC0000005: Access violation 
reading location 0x0000000000000000.


    


    If anyone has ever encountered such an issue or have any idea how to solve it please share.

    



    


    This is the function :

    


    void VideoSource::ReadSource()
{
    auto lock = this->LockSource();
    std::vector> newSource;

    // Open the file using libavformat
    AVFormatContext* av_format_ctx = avformat_alloc_context();
    if (!av_format_ctx) {
        //wxMessageBox("Couldn't create AVFormatContext\n");
        read = false;
        return;
    }
    if (avformat_open_input(&av_format_ctx, path.c_str(), NULL, NULL) != 0) { // error here
        //wxMessageBox("Couldn't open video file\n");
        read = false;
        return;
    }

    // Find the first valid video stream inside the file
    int video_stream_index = -1;
    AVCodecParameters* av_codec_params = NULL;
    const AVCodec* av_codec = NULL;
    for (uint i = 0; i < av_format_ctx->nb_streams; i)
    {
        av_codec_params = av_format_ctx->streams[i]->codecpar;
        av_codec = avcodec_find_decoder(av_codec_params->codec_id);

        if (!av_codec) {
            continue;
        }
        if (av_codec_params->codec_type == AVMEDIA_TYPE_VIDEO) {
            video_stream_index = i;
            break;
        }
    }

    if (video_stream_index == -1) {
        //wxMessageBox("Couldn't find valid video stream inside file\n");
        read = false;
        return;
    }

    // Set up a codec context for the decoder
    AVCodecContext* av_codec_ctx = avcodec_alloc_context3(av_codec);
    if (!av_codec_ctx) {
        //wxMessageBox("Couldn't create AVCpdecContext\n");
        read = false;
        return;
    }

    if (avcodec_parameters_to_context(av_codec_ctx, av_codec_params) < 0)
    {
        //wxMessageBox("Couldn't initialize AVCodecContext\n");
        read = false;
        return;
    }
    if (avcodec_open2(av_codec_ctx, av_codec, NULL) < 0) {
        //wxMessageBox("Couldn't open codec\n");

        read = false;
        return;
    }

    AVFrame* av_frame = av_frame_alloc();
    if (!av_frame) {
        //wxMessageBox("Couldn't allocate AVFrame\n");

        read = false;
        return;
    }
    AVPacket* av_packet = av_packet_alloc();
    if (!av_packet) {
        //wxMessageBox("Couldn't allocate AVPacket\n");

        read = false;
        return;
    }
    int response;
    int counter = 0;
    while (av_read_frame(av_format_ctx, av_packet) >= 0 && counter < 100000) {
        if (av_packet->stream_index != video_stream_index) {
            av_packet_unref(av_packet);
            continue;
        }
        response = avcodec_send_packet(av_codec_ctx, av_packet);
        if (response < 0) {
            //wxMessageBox("Failed to decode packet: %s\n", av_err2str(response));

            read = false;
            return;
        }
        response = avcodec_receive_frame(av_codec_ctx, av_frame);
        if (response == AVERROR(EAGAIN) || response == AVERROR_EOF) {
            av_packet_unref(av_packet);
            continue;
        }
        else if (response < 0) {
            //wxMessageBox("Failed to decode frame: %s\n", av_err2str(response));

            read = false;
            return;
        }
        counter++;
        av_packet_unref(av_packet);

        av_packet = av_packet_alloc();

        response = avcodec_send_frame(av_codec_ctx, av_frame);
        std::string tmp = av_err2str(response);
        //source.push_back(*av_frame);
        //auto mat_frame = Avframe2Cvmat(av_frame);

        //source.push_back(im);
        //bool isEqual = (cv::sum(Avframe2Cvmat(av_frame) != Avframe2Cvmat(&source[0])) == cv::Scalar(0, 0, 0, 0));
        //bool isEqual = (cv::sum(im != source[0]) == cv::Scalar(0, 0, 0, 0));
        //im.release();
        newSource.push_back(SyncObject(av_frame_clone(av_frame)));

        /*
        if (int iRet = av_frame_copy(&source.back(), av_frame) == 0) {
            av_log(NULL, AV_LOG_INFO, "Ok");
        }
        else {
            av_log(NULL, AV_LOG_INFO, "Error: %s\n", av_err2str(iRet));
        }*/
        av_frame_unref(av_frame);
    }


    avformat_close_input(&av_format_ctx);
    avformat_free_context(av_format_ctx);
    av_frame_free(&av_frame);
    av_packet_free(&av_packet);
    avcodec_free_context(&av_codec_ctx);
    //this->LockSource();
    source_.swap(newSource);
}


    


    This function is inside A class and those are its memebers :

    


        bool created;
    bool read;
    std::string path; // THE PATH TO THE FILE
    std::vector> source_; // vector containing all of the video frames


    


    This is what I get in Call Stack

    


    This is what I get in the debugger when the error accures :

    


    [![Debugger values][1]][1]