Recherche avancée

Médias (91)

Autres articles (104)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (9042)

  • Encoding AAC audio with libav

    14 mars 2018, par Michael IV

    I am trying to encode AAC using FFMPEG C libs. The closest thing I found on SO is this question,but it deals with mp4 container which has aac stream. That’s not what I am trying to do. I am encoding single audio file. Now, FFMPEG example for audio encoding doesn’t show aac and it is not clear if it is enough also for the aac codec. Here is how I do it :

    Setup :

       AVCodec*              mInputAudioCodec = NULL;  
       AVCodecContext*       mInputAudioCodecContext = NULL;
       AVPacket*             mAudioPacket = NULL;
       AVFrame*              mAudioInputFrame = NULL;

       mInputAudioCodec =  avcodec_find_encoder(AV_CODEC_ID_AAC);
       if (!mInputAudioCodec)
       {
           return false;
       }

       mInputAudioCodecContext = avcodec_alloc_context3(mInputAudioCodec);
       if (!mInputAudioCodecContext)
       {
           return false;
       }

       mInputAudioCodecContext->bit_rate = 192000;// 64000;
       mInputAudioCodecContext->sample_fmt = AV_SAMPLE_FMT_FLTP; AV_SAMPLE_FMT_S16;
       // check that a given sample format is supported by the encoder
       const enum AVSampleFormat *p = mInputAudioCodec->sample_fmts;
       bool formatSupported = false;
       while (*p != AV_SAMPLE_FMT_NONE)
       {
           if (*p == mInputAudioCodecContext->sample_fmt)
           {
               formatSupported = true;
               break;
           }
           p++;
       }
       if (formatSupported == false)
       {
           return false;
       }

       mInputAudioCodecContext->sample_rate = 48000;
       mInputAudioCodecContext->channel_layout = AV_CH_LAYOUT_STEREO;
       mInputAudioCodecContext->channels = av_get_channel_layout_nb_channels(mInputAudioCodecContext->channel_layout);
       //  open codec:
       if (avcodec_open2(mInputAudioCodecContext, mInputAudioCodec, NULL) < 0)
       {
           return false;
       }
       mAudioPacket = av_packet_alloc();
       mAudioInputFrame = av_frame_alloc();
       mAudioInputFrame->nb_samples     = mInputAudioCodecContext->frame_size;
       mAudioInputFrame->format         = mInputAudioCodecContext->sample_fmt;
       mAudioInputFrame->channel_layout = mInputAudioCodecContext->channel_layout;
       mAudioInputFrame->sample_rate    = mInputAudioCodecContext->sample_rate;
       if (av_frame_get_buffer(mAudioInputFrame, 0) < 0)
       {
           return false;
       }
       mFileOut = fopen("audio.aac","wb");

    Encoding :

    For the simplicity, I encode synthetic frames,just like in FFMPEG example.
    FLTP is planar format,so I write dummy data into two separate buffers.

       int ret = 0;
       ret = av_frame_make_writable(mAudioInputFrame);
       if (ret < 0)
       {
           return;
       }
            //generate sound data:
               float* samples0 = (float*)mAudioInputFrame->data[0];
               float* samples1 = (float*)mAudioInputFrame->data[1];
               float t = 0;
               float tincr = 2 * M_PI * 440.0f / mInputAudioCodecContext->sample_rate;
               for (int j = 0; j < mInputAudioCodecContext->frame_size; j++)
               {
                   *samples0 = (sin(t) * 10000);
                   *samples1 = (sin(t) * 10000);
                   samples0++;
                   samples1++;
                   t += tincr;
               }



               av_init_packet(mAudioPacket);
               mAudioPacket->data = NULL;
               mAudioPacket->size = 0;

               ret = avcodec_send_frame(mInputAudioCodecContext, mAudioInputFrame);
               if (ret < 0)
               {
                   fprintf(stderr, "Error sending the frame to the encoder\n");
               }

               /* read all the available output packets (in general there may be any
               * number of them */
               while (ret >= 0)
               {
                   ret = avcodec_receive_packet(mInputAudioCodecContext, mAudioPacket);
                   if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
                   {
                       return;
                   }
                   else if (ret < 0)
                   {
                       return;
                   }

                   fwrite(mAudioPacket->data, 1, mAudioPacket->size, mFileOut);


               }

               av_packet_unref(mAudioPacket);

    The encoding session performs ok, avcodec lib doesn’t spit any warnings or errors. But the resulting .aac file is not opened neither by VLC nor by any other audio player. It is corrupted. I ran FFProbe on the file and here is what it says :

    [aac @ 000000000274b840] Format aac detected only with low score of 1,
    misdetection possible ! [aac @ 00000000026fb2e0] More than one AAC RDB
    per ADTS frame is not implemented. Update your FFmpeg version to the
    newest one from Git. If the problem still occurs, it means that your
    file has a feature which has not been implemented. [aac @
    00000000026fb2e0] Sample rate index in program config element does not
    match the sample rate index configured by the container. [aac @
    00000000026fb2e0] Inconsistent channel configuration. [aac @
    00000000026fb2e0] get_buffer() failed [aac @ 00000000026fb2e0] channel
    element 2.15 is not allocated [aac @ 00000000026fb2e0] Assuming an
    incorrectly encoded 7.1 channel layout instead of a spec-compliant
    7.1(wide) layout, use -strict 1 to decode according to the specification instead. [aac @ 00000000026fb2e0] Multiple frames in a
    packet. [aac @ 00000000026fb2e0] Number of scalefactor bands in group
    (53) exceeds limit (51). [aac @ 00000000026fb2e0] channel element 2.1
    is not allocated [aac @ 000000000274b840] decoding for stream 0 failed
    [aac @ 000000000274b840] Estimating duration from bitrate, this may be
    inaccurate [aac @ 000000000274b840] Could not find codec parameters
    for stream 0 (Audio : aac (SSR), stereo, fltp, 254 kb/s) : unspecified
    sample rate Consider increasing the value for the ’analyzeduration’
    and ’probesize’ options Input #0, aac, from ’audio.aac’ : Duration :
    00:00:03.21, bitrate : 254 kb/s
    Stream #0:0 : Audio : aac (SSR), stereo, fltp, 254 kb/s

    What am I doing wrong here ?

  • avcodec/ffv1enc : mark RGB48 support as non-experimental

    5 janvier 2018, par Jérôme Martinez
    avcodec/ffv1enc : mark RGB48 support as non-experimental
    

    Resulting bitstream was tested with a conformance checker
    using the last draft of FFV1 specifications.

    Signed-off-by : Michael Niedermayer <michael@niedermayer.cc>

    Also the files are already in the wild, and decoder support is
    thus needed. And with decoders widely supporting it, there is no
    advantage in not allowing it in the encoder.
    The exact bitstream format may change in future versions of the
    spec, if improvments are found.

    • [DH] libavcodec/ffv1enc.c
  • using ffmpeg to automate splitting video into quarters and stacking

    14 novembre 2017, par user3297049

    I need to create a quick FFMPEG batch file that takes a very wide video file and splits it into quarters (dimension wise not time wise), then outputting a file where each quarter is under the previous.

    E.g.

    A B C D

    Would become :

    A
    B
    C
    D

    I know this should be possible with crop and pad commands, and through research I’ve found that someone divided into quarters and put the top left and bottom right next to each other horizontally using :

    "%~dp0\ffmpeg.exe" -i %1 -filter_complex "[0:0]crop=iw/2:ih/2:0:0,pad=iw*2:ih:0:0[tl];[0:0]crop=iw/2:ih:iw/2:ih/2[br];[tl][br]overlay=W/2" -b:v 32000k -b:a 128k %1_2.avi

    Can anyone help as the command line is beyond me ?