Recherche avancée

Médias (0)

Mot : - Tags -/diogene

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (111)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

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

Sur d’autres sites (11694)

  • How to write HEVC frames to file using FFMpeg ?

    2 mai 2018, par boneill

    I have the following code used to output H264 frames to an mp4 file and this works fine :

    typedef struct _AvFileStreamContext
    {
       AVStream                 *pStreams[AV_FRAME_MAX];
       AVCodecContext           *streamCodec;
       AVFormatContext          *pAvContext;    // initialised with avformat_alloc_output_context2 for mp4 container

    }_AvFileStreamContext;

    static void WriteImageFrameToFile(const unsigned char * frame,
                                     const int frameSize,
                                     const struct timeval *frameTime,
                                     AvFileStreamContext *pContext,
                                     int keyFrame)
    {
       AVStream *stream pContext->pStreams[AV_FRAME_VIDEO];
       AVPacket pkt;

       av_init_packet(&pkt);
       if (keyFrame)
       {
           pkt.flags |= AV_PKT_FLAG_KEY;
       }
       pkt.stream_index = stream->index;
       pkt.data = (unsigned char*)frame;
       pkt.size = frameSize;

       int ptsValue = round((float)( ( (frameTime->tv_sec - pContext->firstFrameTime.tv_sec ) * 1000000 +
                                       (frameTime->tv_usec - pContext->firstFrameTime.tv_usec)) * pContext->streamCodec->time_base.den ) / 1000000);

       // Packets PTS/DTS must be in Stream time-base units before writing so
       // rescaling between coder and stream time bases is required.
       pkt.pts =  av_rescale_q(ptsValue, pContext->streamCodec->time_base, stream->time_base);
       pkt.dts =  av_rescale_q(ptsValue, pContext->streamCodec->time_base, stream->time_base);

       av_interleaved_write_frame(pContext->pAvContext, &pkt);
    }

    Once all frames have been received I call the following :

    av_write_trailer(pContext->pAvContext);
    avio_close(pContext->pAvContext->pb);

    The above function is supplied from a circular buffer of frames where each entry in the buffer represents a frame for H264. I am trying to understand how I can adapt this to handle H265/HEVC frames. When I blindly try and use this for H265 frames I end up with an mp4 file where each frame only contains a third of a complete frame i.e.

    h265partialframe
    The video continues to play for the correct duration but each frame is only a third of a complete frame. The implementation for receiving frames is the same as H264 and it is my understanding that with H265 each of the buffers I am receiving represents a ’tile’. In my case these are tile columns of which 3 tiles make up one frame. That said, it would seem that the above function would need to be adapted to combine 3 tiles until an end of frame marker is received. I have trawled the FFMpeg v3.3 documentation to find out how I can achieve this but have had limited luck.
    I have tried to use the following function call to combine frames :

    uint8_t * outputBuffer;
    unsigned int bufferSize;
    stream->parser = av_parser_init (AV_CODEC_ID_HEVC);
    int rc = av_parser_parse2(stream->parser, pContext->pAvContext,
                             &outputBuffer, &bufferSize,
                             frame, frameSize,
                             pkt.pts, pkt.dts, -1);

    It seems that the above call will ultimately call ;

    static int hevc_parse(AVCodecParserContext *s,
                         AVCodecContext *avctx,
                         const uint8_t **poutbuf, int *poutbuf_size,
                         const uint8_t *buf, int buf_size)

    Followed by :

    int ff_combine_frame(ParseContext *pc, int next,
                        const uint8_t **buf, int *buf_size)

    So it seems this is the correct path, however when I plug this all in the resulting mp4 file is not playable under gstreamer with the following errors :

    Prerolling...
    (gst-play-1.0:11225): GStreamer-WARNING **: gstpad.c:4943:store_sticky_event: Sticky event misordering, got 'segment' before 'caps'
    Redistribute latency...

    (gst-play-1.0:11225): GStreamer-WARNING **: gstpad.c:4943:store_sticky_event: Sticky event misordering, got 'segment' before 'caps'

    And I get the following errors (snippet of errors) from VLC where the frames appear to be correct in terms of height and width but are corrupt or incomplete during playback :

    [hevc @ 0x7f8128c30440] PPS changed between slices.
    [hevc @ 0x7f8128c42080] PPS changed between slices.
    [hevc @ 0x7f8128c53ce0] PPS changed between slices.
    [00007f8110293be8] freetype spu text error: Breaking unbreakable line
    [hevc @ 0x7f8128c1e0a0] First slice in a frame missing.
    [hevc @ 0x7f8128c1e0a0] First slice in a frame missing.
    [hevc @ 0x7f8128c1e0a0] Could not find ref with POC 7
    [hevc @ 0x7f8128c30440] PPS changed between slices.
    [hevc @ 0x7f8128c42080] PPS changed between slices.
    [hevc @ 0x7f8128c53ce0] PPS changed between slices.
    [hevc @ 0x7f8128c1e0a0] First slice in a frame missing.
    [hevc @ 0x7f8128c1e0a0] First slice in a frame missing.
    [hevc @ 0x7f8128c1e0a0] Could not find ref with POC 15
    [hevc @ 0x7f8128c30440] PPS changed between slices.
    [hevc @ 0x7f8128c42080] PPS changed between slices.
    [hevc @ 0x7f8128c53ce0] PPS changed between slices.
    [hevc @ 0x7f8128c1e0a0] First slice in a frame missing.
    [hevc @ 0x7f8128c1e0a0] First slice in a frame missing.
    [hevc @ 0x7f8128c1e0a0] Could not find ref with POC 23

    Here is an example frame from the VLC playback where you can just about see the outline of someone :
    h265combinedtiles

    It should be noted that when using the call to av_parser_parse2(), a frame is only passed to av_interleaved_write_frame() when outputBuffer is populated which seems to take a number of tiles (greater than 3) so I am possibly not setting something correctly.

    • Can I tell FFMpeg that a particular tile is an end of frame ?
    • Should I be using some other FFMpeg call to combine H265 tiles ?
    • Am I misunderstanding how HEVC operates ? (probably)
    • Once combined it the call to av_interleaved_write_frame() still valid ?
    • Note that use of libx265 is not possible.

    Any help appreciated.

  • Use ffmpeg as external tool to stream 2 or more different sources via pipeline

    25 février 2021, par StackDOX

    I have an application running on an embedded system. This application has 2 video sources (and, theorically, 1 audio source). Concentrating to the video sources, I have 2 subprocess that computes different frames sets (unrelated each others). I want to send these frames to 2 differents streams.

    


    I would to avoid to write a lot of ffmpeg/libav code. I have ffmpeg compiled for the embeeded system and I can use it as tool. For example, I can write to the stdout the first frames set and pass it to the ffmpeg like this :

    


    ./my_app|ffmpeg -an -i - -vcodec copy -f rtp rtp://"remote_ip

    


    This basically works. But, now i would to send the other one frame set. How to do that ? Theorically I need anoter ffmpeg instance that read from another source that can't be the stdout of "my_app", because is already busy.

    



    


    I'm thinking to use 2 video files as support. I can record the 2 frames sets into 2 video files and then run 2 ffmpeg instances from these sources. In this case I think I need a way to limit the video files dimensions (like a circular buffer), because 2 streams can become really huge in time. It is a possibility ?
This can sound "weird" to me : I need to record a video source in realtime and stream it via ffmpeg (always in realtime). I don't know if it is a good idea, there are realtime problems for sure :

    


    loop:
my_app --write_into--> video_stream1.mp4 
ffmpeg <--read_from-- video_stream1.mp4

my_app --write_into--> video_stream2.mp4 
ffmpeg <--read_from-- video_stream2.mp4


    


    Have you some suggestion to address this kind of situation ?

    


    many thanks, bye.

    


  • Evolution #4657 : Renommage du menu maintenance

    10 février 2021, par nicod _

    Maïeul Rouquette a écrit :

    Dans la même veine que #2835 et #4626. Le menu "maintenance" c’est forcément de la maintenance technique.

    Ma proposition :
    - renommer le menu "Maintenance" en "maintenance technique"

    "Maintenance" tout court n’est pas suffisant ? Sinon ça va passer sur deux lignes, ce serait moche.

    - changer la sous entrée "Maintenance technique" en "gestion des bases", et y regrouper aussi sauvegarde et restauration de la base
    - deporter de "Maintenance technique" tout ce qui concerne les statistique, dans une entrée "Historique des statistiques".

    Un peu de rangement, pourquoi pas :)