Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (43)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

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

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

Sur d’autres sites (8884)

  • Using libavformat to mux H.264 frames into RTP

    18 septembre 2021, par DanielB6

    I have an encoder that produces a series of H.264 I-frames and P-frames. I'm trying to use libavformat to mux and transmit these frames over RTP, but I'm stuck.

    



    My program sends RTP data, but the RTP timestamp increments by 1 each successive frame, instead of 90000/fps. It also doesn't look like it's doing the proper framing for H.264 NAL, since I can't decode the stream as H.264 in Wireshark.

    



    I suspect that I'm not setting up the codec information properly, but it appears in many places in the output format context, so it's unclear what exactly needs to be setup. The examples seem to all copy codec context info from encoders, which isn't my use case.

    



    This is what I'm trying :

    



    int main() {
    AVFormatContext context = avformat_alloc_context();

    if (!context) {
        printf("avformat_alloc_context failed\n");
        return;
    }

    AVOutputFormat *format = av_guess_format("rtp", NULL, NULL);

    if (!format) {
        printf("av_guess_format failed\n");
        return;
    }

    context->oformat = format;

    snprintf(context->filename, sizeof(context->filename), "rtp://%s:%d", "192.168.2.16", 10000);

    if (avio_open(&(context->pb), context->filename, AVIO_FLAG_READ_WRITE) < 0) {
        printf("avio_open failed\n");
        return;
    }

    stream = avformat_new_stream(context, NULL);

    if (!stream) {
        printf("avformat_new_stream failed\n");
        return;
    }

    stream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
    stream->codecpar->codec_id = AV_CODEC_ID_H264;
    stream->codecpar->width = 1920;
    stream->codecpar->height = 1080;

    avformat_write_header(context, NULL);

    ...
    write packets
    ...
}


    



    Example write packet :

    



    int write_packet(uint8_t *data, int size) {
    AVPacket p;
    av_init_packet(&p);
    p.data = buffer;
    p.size = size;
    p.stream_index = stream->index;

    av_interleaved_write_frame(context, &p);
}


    



    I've even went so far to build in libx264, find the encoder, and copy the codec context info from there into the stream codecpar, with the same result. My goal is to build without libx264, and any other libs that aren't required, but it isn't clear whether libx264 is required for defaults such as time base.

    



    How can the libavformat RTP muxer be initialized to properly send H.264 frames over RTCP+RTP ?

    


  • Using libavformat to mux H.264 frames into RTP

    22 novembre 2016, par DanielB6

    I have an encoder that produces a series of H.264 I-frames and P-frames. I’m trying to use libavformat to mux and transmit these frames over RTP, but I’m stuck.

    My program sends RTP data, but the RTP timestamp increments by 1 each successive frame, instead of 90000/fps. It also doesn’t look like it’s doing the proper framing for H.264 NAL, since I can’t decode the stream as H.264 in Wireshark.

    I suspect that I’m not setting up the codec information properly, but it appears in many places in the output format context, so it’s unclear what exactly needs to be setup. The examples seem to all copy codec context info from encoders, which isn’t my use case.

    This is what I’m trying :

    int main() {
       AVFormatContext context = avformat_alloc_context();

       if (!context) {
           printf("avformat_alloc_context failed\n");
           return;
       }

       AVOutputFormat *format = av_guess_format("rtp", NULL, NULL);

       if (!format) {
           printf("av_guess_format failed\n");
           return;
       }

       context->oformat = format;

       snprintf(context->filename, sizeof(context->filename), "rtp://%s:%d", "192.168.2.16", 10000);

       if (avio_open(&(context->pb), context->filename, AVIO_FLAG_READ_WRITE) < 0) {
           printf("avio_open failed\n");
           return;
       }

       stream = avformat_new_stream(context, NULL);

       if (!stream) {
           printf("avformat_new_stream failed\n");
           return;
       }

       stream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
       stream->codecpar->codec_id = AV_CODEC_ID_H264;
       stream->codecpar->width = 1920;
       stream->codecpar->height = 1080;

       avformat_write_header(context, NULL);

       ...
       write packets
       ...
    }

    Example write packet :

    int write_packet(uint8_t *data, int size) {
       AVPacket p;
       av_init_packet(&p);
       p.data = buffer;
       p.size = size;
       p.stream_index = stream->index;

       av_interleaved_write_frame(context, &p);
    }

    I’ve even went so far to build in libx264, find the encoder, and copy the codec context info from there into the stream codecpar, with the same result. My goal is to build without libx264, and any other libs that aren’t required, but it isn’t clear whether libx264 is required for defaults such as time base.

    How can the libavformat RTP muxer be initialized to properly send H.264 frames over RTCP+RTP ?

  • MP4Box : Concatenating track ID 1 even though sample descriptions do not match

    29 avril 2021, par Lysander Cox

    Essentially, I wish to concatenate a series of videos using MP4Box. When I attempt to do so, I receive the following error :

    


    No suitable destination track found - creating new one (type soun)
0.500 secs Interleaving 


    


    I can circumvent the issue, at least temporarily, by adding a -force-cat parameter to the MP4Box command. However, this creates issues with the alignment of audio and video and produces the following warning :

    


    Concatenating track ID 1 even though sample descriptions do not match


    


    Now, as far as I can tell, this has to do with differing parameters between video types. I will display the ffprobe output of each video type below in order to hopefully shed some light on the issue.

    


    VIDEO TYPE 1 FFPROBE OUTPUT :

    


    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '0.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.29.100
  Duration: 00:00:02.25, start: 0.000000, bitrate: 851 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 816 kb/s, 4 fps, 4 tbr, 16384 tbn, 8 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
    Metadata:
      handler_name    : SoundHandler


    


    VIDEO TYPE 2 FFPROBE OUTPUT :

    


    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'static.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.78.100
  Duration: 00:00:01.00, start: 0.000000, bitrate: 662 kb/s
    Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 654 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler



    


    Can anyone identify what the incongruity between video types is and how I can resolve it ? Thanks.