Recherche avancée

Médias (0)

Mot : - Tags -/configuration

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

Autres articles (84)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

  • MediaSPIP en mode privé (Intranet)

    17 septembre 2013, par

    À partir de la version 0.3, un canal de MediaSPIP peut devenir privé, bloqué à toute personne non identifiée grâce au plugin "Intranet/extranet".
    Le plugin Intranet/extranet, lorsqu’il est activé, permet de bloquer l’accès au canal à tout visiteur non identifié, l’empêchant d’accéder au contenu en le redirigeant systématiquement vers le formulaire d’identification.
    Ce système peut être particulièrement utile pour certaines utilisations comme : Atelier de travail avec des enfants dont le contenu ne doit pas (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

Sur d’autres sites (10763)

  • avcodec/vvc : simplify priority logical to improve performance for 4K/8K

    24 septembre 2024, par Nuo Mi
    avcodec/vvc : simplify priority logical to improve performance for 4K/8K
    

    For 4K/8K video processing, it's possible to have over 1,000 tasks pending on the executor.
    In such cases, O(n) and O(log(n)) insertion times are too costly.
    Reducing this to O(1) will significantly decrease the time spent in critical sections

    clip | before | after | delta


    |--------|--------|-------
    VVC_HDR_UHDTV2_OpenGOP_7680x4320_50fps_HLG10.bit | 24 | 27 | 12.5%
    VVC_HDR_UHDTV2_OpenGOP_7680x4320_50fps_HLG10_HighBitrate.bit| 12 | 17 | 41.7%
    tears_of_steel_4k_8M_8bit_2000.vvc | 34 | 102 | 200.0%
    VVC_UHDTV1_OpenGOP_3840x2160_60fps_HLG10.bit | 126 | 128 | 1.6%
    RitualDance_1920x1080_60_10_420_37_RA.266 | 350 | 378 | 8.0%
    NovosobornayaSquare_1920x1080.bin | 341 | 369 | 8.2%
    Tango2_3840x2160_60_10_420_27_LD.266 | 69 | 70 | 1.4%
    RitualDance_1920x1080_60_10_420_32_LD.266 | 243 | 259 | 6.6%
    Chimera_8bit_1080P_1000_frames.vvc | 420 | 392 | -6.7%
    BQTerrace_1920x1080_60_10_420_22_RA.vvc | 148 | 144 | -2.7%

    • [DH] libavcodec/executor.c
    • [DH] libavcodec/executor.h
    • [DH] libavcodec/vvc/thread.c
  • FFmpeg encoding live audio to aac issue

    12 juillet 2015, par Ruurd Adema

    I’m trying to encode live raw audio coming from a Blackmagic Decklink input card to a mov file with AAC encoding.

    The issue is that the audio sounds distorted and plays to fast.

    I created the software based on a couple of examples/tutorials including the Dranger tutorial and examples on Github (and of course the examples in the FFmpeg codebase).

    Honestly, at this moment I don’t exactly know what the cause of the problem is. I’m thinking about PTS/DTS values or a timebase mismatch (because of the too fast playout), I tried a lot of things, including working with an av_audio_fifo.

    • When outputting to the mov file with the AV_CODEC_ID_PCM_S16LE codec, everything works well
    • When outputting to the mov file with the AV_CODEC_ID_AAC codec, the problems occur
    • When writing RAW audio VLC media info shows :
      Type : Audio, Codec : PCM S16 LE (sowt), Language : English, Channels : Stereo, Sample rate : 48000 Hz, Bits per sample.
    • When writing with AAC codec VLC media info shows :
      Type : Audio, Codec : MPEG AAC Audio (mp4a), Language : English, Channels : Stereo, Sample rate : 48000 Hz.

    Any idea(s) of what’s causing the problems ?

    Code

    // Create output context

    output_filename = "/root/movies/encoder_debug.mov";
    output_format_name = "mov";
    if (avformat_alloc_output_context2(&output_fmt_ctx, NULL, output_format_name, output_filename) < 0)
    {
       printf("[ERROR] Unable to allocate output format context for output: %s\n", output_filename);
    }

    // Create audio output stream

    static AVStream *encoder_add_audio_stream(AVFormatContext *oc, enum AVCodecID codec_id)
    {
       AVCodecContext  *c;
       AVCodec         *codec;
       AVStream        *st;

       st = avformat_new_stream(oc, NULL);
       if (!st)
       {
           printf("[ERROR] Could not allocate new audio stream!\n");
           exit(-1);
       }

       c                 = st->codec;
       c->codec_id       = codec_id;
       c->codec_type     = AVMEDIA_TYPE_AUDIO;
       c->sample_fmt     = AV_SAMPLE_FMT_S16;
       c->sample_rate    = decklink_config()->audio_samplerate;
       c->channels       = decklink_config()->audio_channel_count;
       c->channel_layout = av_get_default_channel_layout(decklink_config()->audio_channel_count);
       c->time_base.den  = decklink_config()->audio_samplerate;
       c->time_base.num  = 1;

       if (codec_id == AV_CODEC_ID_AAC)
       {
           c->bit_rate       = 96000;  
           //c->profile = FF_PROFILE_AAC_MAIN; //FIXME Generates error: "Unable to set the AOT 1: Invalid config"
           // Allow the use of the experimental AAC encoder
           c->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
       }

       // Some formats want stream headers to be seperate (global?)
       if (oc->oformat->flags & AVFMT_GLOBALHEADER)
       {
           c->flags |= CODEC_FLAG_GLOBAL_HEADER;
       }

       codec = avcodec_find_encoder(c->codec_id);
       if (!codec)
       {
           printf("[ERROR] Audio codec not found\n");
           exit(-1);
       }

       if (avcodec_open2(c, codec, NULL) < 0)
       {
           printf("[ERROR] Could not open audio codec\n");
           exit(-1);
       }

       return st;
    }

    // En then, at every incoming frame this function gets called:

    void encoder_handle_incoming_frame(IDeckLinkVideoInputFrame *videoframe, IDeckLinkAudioInputPacket *audiopacket)
    {
       void *pixels = NULL;
       int   pitch = 0;
       int got_packet = 0;

       void *audiopacket_data          = NULL;
       long  audiopacket_sample_count  = 0;
       long  audiopacket_size          = 0;
       long  audiopacket_channel_count = 2;

       if (audiopacket)
       {  
           AVPacket pkt = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
           AVFrame *frame;
           BMDTimeValue audio_pts;
           int requested_size;
           static int last_pts1, last_pts2 = 0;

           audiopacket_sample_count  = audiopacket->GetSampleFrameCount();
           audiopacket_channel_count = decklink_config()->audio_channel_count;
           audiopacket_size          = audiopacket_sample_count * (decklink_config()->audio_sampletype/8) * audiopacket_channel_count;

           audiopacket->GetBytes(&audiopacket_data);

           av_init_packet(&pkt);    

           printf("\n=== Audiopacket: %d ===\n", audio_stream->codec->frame_number);

           if (AUDIO_TYPE == AV_CODEC_ID_PCM_S16LE)
           {
               audiopacket->GetPacketTime(&audio_pts, audio_stream->time_base.den);

               pkt.pts          = audio_pts;
               pkt.dts          = pkt.pts;
               pkt.flags       |= AV_PKT_FLAG_KEY;                 // TODO: Make sure if this still applies
               pkt.stream_index = audio_stream->index;
               pkt.data         = (uint8_t *)audiopacket_data;
               pkt.size         = audiopacket_size;

               printf("[PACKET] size:              %d\n", pkt.size);
               printf("[PACKET] pts:               %li\n", pkt.pts);
               printf("[PACKET] pts delta:         %li\n", pkt.pts - last_pts2);
               printf("[PACKET] duration:          %d\n", pkt.duration);
               last_pts2 = pkt.pts;

               av_interleaved_write_frame(output_fmt_ctx, &pkt);
           }
           else if (AUDIO_TYPE == AV_CODEC_ID_AAC)
           {
               frame = av_frame_alloc();
               frame->format = audio_stream->codec->sample_fmt;
               frame->channel_layout = audio_stream->codec->channel_layout;
               frame->sample_rate = audio_stream->codec->sample_rate;
               frame->nb_samples = audiopacket_sample_count;

               requested_size = av_samples_get_buffer_size(NULL, audio_stream->codec->channels, audio_stream->codec->frame_size, audio_stream->codec->sample_fmt, 1);

               audiopacket->GetPacketTime(&audio_pts, audio_stream->time_base.den);

               printf("[DEBUG] Sample format:      %d\n", frame->format);
               printf("[DEBUG] Channel layout:     %li\n", frame->channel_layout);
               printf("[DEBUG] Sample rate:        %d\n", frame->sample_rate);
               printf("[DEBUG] NB Samples:         %d\n", frame->nb_samples);
               printf("[DEBUG] Datasize:           %li\n", audiopacket_size);
               printf("[DEBUG] Requested datasize: %d\n", requested_size);
               printf("[DEBUG] Too less/much:      %li\n", audiopacket_size - requested_size);
               printf("[DEBUG] Framesize:          %d\n", audio_stream->codec->frame_size);
               printf("[DEBUG] Audio pts:          %li\n", audio_pts);
               printf("[DEBUG] Audio pts delta:    %li\n", audio_pts - last_pts1);
               last_pts1 = audio_pts;

               frame->pts = audio_pts;

               if (avcodec_fill_audio_frame(frame, audiopacket_channel_count, audio_stream->codec->sample_fmt, (const uint8_t *)audiopacket_data, audiopacket_size, 0) < 0)
               {
                   printf("[ERROR] Filling audioframe failed!\n");
                   exit(-1);
               }

               got_packet = 0;
               if (avcodec_encode_audio2(audio_stream->codec, &pkt, frame, &got_packet) != 0)
               {
                   printf("[ERROR] Encoding audio failed\n");
               }

               if (got_packet)
               {
                   pkt.stream_index = audio_stream->index;
                   pkt.flags       |= AV_PKT_FLAG_KEY;

                   //printf("[PACKET] size:              %d\n", pkt.size);
                   //printf("[PACKET] pts:               %li\n", pkt.pts);
                   //printf("[PACKET] pts delta:         %li\n", pkt.pts - last_pts2);
                   //printf("[PACKET] duration:          %d\n", pkt.duration);
                   //printf("[PACKET] timebase codec:    %d/%d\n", audio_stream->codec->time_base.num, audio_stream->codec->time_base.den);
                   //printf("[PACKET] timebase stream:   %d/%d\n", audio_stream->time_base.num, audio_stream->time_base.den);
                   last_pts2 = pkt.pts;

                   av_interleaved_write_frame(output_fmt_ctx, &pkt);
               }
               av_frame_free(&frame);
           }

           av_free_packet(&pkt);
       }
       else
       {
           printf("[WARNING] No audiopacket received!\n");
       }

       static int count = 0;
       count++;
    }
  • libavformat : Improve ff_configure_buffers_for_index for excessive deltas

    21 mars 2023, par Martin Storsjö
    libavformat : Improve ff_configure_buffers_for_index for excessive deltas
    

    Previously, the ff_configure_buffers_for_index function had
    upper sanity limits of 16 MB (1<<24) for buffer_size and
    8 MB (1<<23) for short_seek_threshold.

    However, if the index contained entries with a much larger
    delta, setting pos_delta to a value larger than the sanity
    limit, we would end up not increasing the buffer size at all.

    Instead, ignore the individual deltas that are excessive, but
    increase the buffer size based on the deltas that are below the
    sanity limit.

    Only count deltas that are below 1<<23, 8 MB ; pos_delta gets doubled
    before setting the buffer size - this matches the previous maximum
    buffer size of 1<<24, 16 MB.

    This can happen e.g. with a mov file with some tracks containing
    some samples that belong in the start of the file, at the end of
    the mdat, while the rest of the file is mostly reasonably interleaved ;
    previously those samples caused the maximum pos_delta to skyrocket,
    skipping any buffer size enlargement.

    Signed-off-by : Martin Storsjö <martin@martin.st>

    • [DH] libavformat/seek.c