Recherche avancée

Médias (0)

Mot : - Tags -/configuration

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

Autres articles (68)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (14449)

  • why the output of mp3 decode sounds so delayed ?(with ffmpeg mp3lame lib)

    11 mars 2014, par user3401739

    i'm recording sound and encoding to mp3 with ffmpeg lib. then decode the mp3 data right away, play the decode data, but it's sounds so delayed.
    here are the codes :
    the function encode first parameter accepts the raw pcm data, len = 44100.

    encode parameters :

    cntx_->channels = 1;
    cntx_->sample_rate = 44100;
    cntx_->sample_fmt = 6;
    cntx_->channel_layout =  AV_CH_LAYOUT_MONO;
    cntx_->bit_rate = 8000;
    err_ = avcodec_open2(cntx_, codec_, NULL);

    vector<unsigned char="char">       encode(unsigned char* encode_data, unsigned int len)
    {
       vector<unsigned char="char"> ret;
       AVPacket avpkt;
       av_init_packet(&amp;avpkt);

       unsigned int len_encoded = 0;
       int data_left = len / 2;
       int miss_c = 0, i = 0;
       while (data_left > 0)
       {
           int sz = data_left > cntx_->frame_size ? cntx_->frame_size : data_left;
           mp3_frame_->nb_samples = sz;
           mp3_frame_->format = cntx_->sample_fmt;
           mp3_frame_->channel_layout = cntx_->channel_layout;

           int needed_size = av_samples_get_buffer_size(NULL, 1,
               mp3_frame_->nb_samples, cntx_->sample_fmt, 1);

           int r = avcodec_fill_audio_frame(mp3_frame_, 1, cntx_->sample_fmt, encode_data + len_encoded, needed_size, 0);

           int gotted = -1;

           r = avcodec_encode_audio2(cntx_, &amp;avpkt, mp3_frame_, &amp;gotted);
           if (gotted){
               i++;
               ret.insert(ret.end(), avpkt.data, avpkt.data + avpkt.size);
           }
           else if (gotted == 0){
               miss_c++;
           }
           len_encoded += needed_size;
           data_left -= sz;
           av_free_packet(&amp;avpkt);
       }
       return ret;
    }

    std::vector<unsigned char="char">  decode(unsigned char* data, unsigned int len)
    {
       std::vector<unsigned char="char"> ret;

       AVPacket avpkt;
       av_init_packet(&amp;avpkt);
       avpkt.data = data;
       avpkt.size = len;

       AVFrame* pframe = av_frame_alloc();
       while (avpkt.size > 0){
           int goted = -1;av_frame_unref(pframe);
           int used = avcodec_decode_audio4(cntx_, pframe, &amp;goted, &amp;avpkt);
           if (goted){
               ret.insert(ret.end(), pframe->data[0], pframe->data[0] + pframe->linesize[0]);
               avpkt.data += used;
               avpkt.size -= used;
               avpkt.dts = avpkt.pts = AV_NOPTS_VALUE;
           }
           else if (goted == 0){
               avpkt.data += used;
               avpkt.size -= used;
               avpkt.dts = avpkt.pts = AV_NOPTS_VALUE;
           }
           else if(goted &lt; 0){
               break;
           }
       }
       av_frame_free(&amp;pframe);
       return ret;
    }
    </unsigned></unsigned></unsigned></unsigned>

    Suppose it's the 100th call to encode(data, len), this "frame" would appear in 150th or later in the decode call, the latency is not acceptable. It seems the mp3lame encoder would keep the sample data for later use, but not my desire.
    I don't know what is going wrong. Thank you for any information.

    today i debug the code again and post some detail :

    encode : each pcm sample frame len = 23040 ,which is 10 times of mp3 frame size, each time call encode only output 9 frames, this output cause decode output 20736 samples, 1 frame(2304 bytes) is lost, and the sound is noisy.

    if the mp3 or mp2 encode is not suitable for real time voice transfer, which encoder should i choose ?

  • avcodec : Add explicit capability flag for encoder flushing

    10 avril 2020, par Philip Langdale
    avcodec : Add explicit capability flag for encoder flushing
    

    Previously, there was no way to flush an encoder such that after
    draining, the encoder could be used again. We generally suggested
    that clients teardown and replace the encoder instance in these
    situations. However, for at least some hardware encoders, the cost of
    this tear down/replace cycle is very high, which can get in the way of
    some use-cases - for example : segmented encoding with nvenc.

    To help address that use case, we added support for calling
    avcodec_flush_buffers() to nvenc and things worked in practice,
    although it was not clearly documented as to whether this should work
    or not. There was only one previous example of an encoder implementing
    the flush callback (audiotoolboxenc) and it's unclear if that was
    intentional or not. However, it was clear that calling
    avocdec_flush_buffers() on any other encoder would leave the encoder in
    an undefined state, and that's not great.

    As part of cleaning this up, this change introduces a formal capability
    flag for encoders that support flushing and ensures a flush call is a
    no-op for any other encoder. This allows client code to check if it is
    meaningful to call flush on an encoder before actually doing it.

    I have not attempted to separate the steps taken inside
    avcodec_flush_buffers() because it's not doing anything that's wrong
    for an encoder. But I did add a sanity check to reject attempts to
    flush a frame threaded encoder because I couldn't wrap my head around
    whether that code path was actually safe or not. As this combination
    doesn't exist today, we'll deal with it if it ever comes up.

    • [DH] doc/APIchanges
    • [DH] libavcodec/audiotoolboxenc.c
    • [DH] libavcodec/avcodec.h
    • [DH] libavcodec/decode.c
    • [DH] libavcodec/nvenc_h264.c
    • [DH] libavcodec/nvenc_hevc.c
    • [DH] libavcodec/version.h
  • Building x264 with YASM : failing the ASM check

    11 janvier 2020, par radiofreemyourenji

    My question up front is, "I have new yasm, I think x264 is supposed to be cool with that, why is x264 not cool with that ?"

    For reasons, I am building a CentOS docker image (based on centos:latest) that contains a from-scratch ffmpeg build, following the guide here. It’s a good guide, it’s worked for me before, so I was feeling good about it.

    Today I’m hitting a choke point on the libx264 build point : specifically, I say

    PKG_CONFIG_PATH="/tmp/ffmpeg_build/lib/pkgconfig" \
     ./configure \
     --prefix="/tmp/ffmpeg_build" \
     --bindir="/tmp/bin" \
     --enable-static

    And I get a reply back

    Found no assembler

    Minimum version is nasm-2.13

    If you really want to compile without asm, configure with —disable-asm.

    That’s unexpected. I have yasm, which I understand to be 1) there to do the things nasm does but better, and 2) to be the daisy-fresh most modern version given that I pulled it from its repo about an hour ago, and built it about fifty-nine minutes ago. For what it’s worth, nasm is on the box too since the instructions request it, but it’s below their stated version (i.e. it’s "NASM version 2.10.07 compiled on Jun 9 2014")

    So it seems like yasm is not being found. There’s another StackExchange question that mentions that problem, which came out to a pathing issue. So, I added yasm to my path like so :

    PATH=/tmp/ffmpeg_sources/yasm:$PATH \
     PKG_CONFIG_PATH="/tmp/ffmpeg_build/lib/pkgconfig" \
     ./configure
     ...etc

    That still gave the Found-no-assembler problem. As a last, confused resort, I told the script explicitly what I wanted to use for the variable $AS, because based on my quick look into configure, that looked like where yasm/nasm was meant to go. The command becomes :

    AS=`which yasm`
     PKG_CONFIG_PATH="/tmp/ffmpeg_build/lib/pkgconfig" \
     ./configure
     ...etc

    That at least gave

    Found yasm 1.3.0

    Minimum version is nasm-2.13

    If you really want to compile without asm, configure with —disable-asm.

    Looking in the config.log I see the following :

    checking whether /tmp/bin/yasm supports vmovdqa32 [eax]{k1}{z}, zmm0... no
    Failed commandline was:
    --------------------------------------------------
    /tmp/bin/yasm conftest.asm  -I. -I$(SRCPATH) -DARCH_X86_64=1 -I$(SRCPATH)/common/x86/ -f elf64  -o conftest.o
    conftest.asm:1: error: instruction expected after label
    conftest.asm:1: warning: ignoring unrecognized character `{'
    conftest.asm:1: warning: ignoring unrecognized character `}'
    conftest.asm:1: warning: ignoring unrecognized character `{'
    conftest.asm:1: warning: ignoring unrecognized character `}'
    --------------------------------------------------
    Failed program was:
    --------------------------------------------------
    vmovdqa32 [eax]{k1}{z}, zmm0
    --------------------------------------------------

    So : what’s the deal here ? Is my assumption that yasm drop-in replaces nasm bad ? Is yasm good for this purpose, but I’m not providing the right information to ./configure ? Are my instructions for building ffmpeg for CentOS simply out of date with respect to this prerequisite and I should just try harder to get a modern nasm ?