Recherche avancée

Médias (1)

Mot : - Tags -/école

Autres articles (51)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, 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 (...)

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

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

Sur d’autres sites (5607)

  • How to add outro background music to another audio file with FFMpeg ?

    8 novembre 2019, par Sebastian

    I have two files : story.wav (180 seconds) and background-music.wav (90 seconds). I need a FFMpeg command that merges the two files and fades in background-music.wav (with esin) 30 seconds before the end of story.wav.

    I have this in separate commands :

    ffmpeg -i background-music.wav -filter_complex afade=t=in:curve=esin:ss=0:d=30 fadein.wav
    ffmpeg -i fadein.wav -af "adelay=150000|150000" delayed.wav
    ffmpeg -i delayed.wav -i story.wav -filter_complex amix=inputs=2:duration=longest final.wav

    This is ugly - and it has the problem, that the volume of the first part is only 50% (the volume should be kept).

    There must be an elegant way to achieve this in one command - but how ?

    Bonus question : how can I convert the result to mp3 (with parameters like bit rate set) in the same command ?

    Thanks for any help !
    Sebastian

  • avcodec/dpx : fix check of minimal data size for unpadded content

    19 octobre 2022, par Jerome Martinez
    avcodec/dpx : fix check of minimal data size for unpadded content
    

    stride value is not relevant with unpadded content and the total count
    of pixels (width x height) must be used instead of the rounding based on
    width only then multiplied by height

    unpadded_10bit value computing is moved sooner in the code in order to
    be able to use it during computing of minimal content size. Also make sure to
    only set it for 10bit.

    Fix 'Overread buffer' error when the content is not lucky enough to have
    (enough) padding bytes at the end for not being rejected by the formula
    based on the stride value

    Fixes ticket #10259.

    Signed-off-by : Jerome Martinez <jerome@mediaarea.net>
    Signed-off-by : Marton Balint <cus@passwd.hu>

    • [DH] libavcodec/dpx.c
  • Why is ffmpeg faster than this minimal example ?

    23 juillet 2022, par Dave Ceddia

    I'm wanting to read the audio out of a video file as fast as possible, using the libav libraries. It's all working fine, but it seems like it could be faster.

    &#xA;

    To get a performance baseline, I ran this ffmpeg command and timed it :

    &#xA;

    time ffmpeg -threads 1 -i file -map 0:a:0 -f null -&#xA;

    &#xA;

    On a test file (a 2.5gb 2hr .MOV with pcm_s16be audio) this comes out to about 1.35 seconds on my M1 Macbook Pro.

    &#xA;

    On the other hand, this minimal C code (based on FFmpeg's "Demuxing and decoding" example) is consistently around 0.3 seconds slower.

    &#xA;

    #include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;&#xA;static int decode_packet(AVCodecContext *dec, const AVPacket *pkt, AVFrame *frame)&#xA;{&#xA;    int ret = 0;&#xA;&#xA;    // submit the packet to the decoder&#xA;    ret = avcodec_send_packet(dec, pkt);&#xA;&#xA;    // get all the available frames from the decoder&#xA;    while (ret >= 0) {&#xA;        ret = avcodec_receive_frame(dec, frame);&#xA;        av_frame_unref(frame);&#xA;    }&#xA;&#xA;    return 0;&#xA;}&#xA;&#xA;int main (int argc, char **argv)&#xA;{&#xA;    int ret = 0;&#xA;    AVFormatContext *fmt_ctx = NULL;&#xA;    AVCodecContext  *dec_ctx = NULL;&#xA;    AVFrame *frame = NULL;&#xA;    AVPacket *pkt = NULL;&#xA;&#xA;    if (argc != 3) {&#xA;        exit(1);&#xA;    }&#xA;&#xA;    int stream_idx = atoi(argv[2]);&#xA;&#xA;    /* open input file, and allocate format context */&#xA;    avformat_open_input(&amp;fmt_ctx, argv[1], NULL, NULL);&#xA;&#xA;    /* get the stream */&#xA;    AVStream *st = fmt_ctx->streams[stream_idx];&#xA;&#xA;    /* find a decoder for the stream */&#xA;    AVCodec *dec = avcodec_find_decoder(st->codecpar->codec_id);&#xA;&#xA;    /* allocate a codec context for the decoder */&#xA;    dec_ctx = avcodec_alloc_context3(dec);&#xA;&#xA;    /* copy codec parameters from input stream to output codec context */&#xA;    avcodec_parameters_to_context(dec_ctx, st->codecpar);&#xA;&#xA;    /* init the decoder */&#xA;    avcodec_open2(dec_ctx, dec, NULL);&#xA;&#xA;    /* allocate frame and packet structs */&#xA;    frame = av_frame_alloc();&#xA;    pkt = av_packet_alloc();&#xA;&#xA;    /* read frames from the specified stream */&#xA;    while (av_read_frame(fmt_ctx, pkt) >= 0) {&#xA;        if (pkt->stream_index == stream_idx)&#xA;            ret = decode_packet(dec_ctx, pkt, frame);&#xA;&#xA;        av_packet_unref(pkt);&#xA;        if (ret &lt; 0)&#xA;            break;&#xA;    }&#xA;&#xA;    /* flush the decoders */&#xA;    decode_packet(dec_ctx, NULL, frame);&#xA;&#xA;    return ret &lt; 0;&#xA;}&#xA;

    &#xA;

    I tried measuring parts of this program to see if it was spending a lot of time in the setup, but it's not – at least 1.5 seconds of the runtime is the loop where it's reading frames.

    &#xA;

    So I took some flamegraph recordings (using cargo-flamegraph) and ran each a few times to make sure the timing was consistent. There's probably some overhead since both were consistently higher than running normally, but they still have the 0.3 second delta.

    &#xA;

    # 1.812 total&#xA;time sudo flamegraph ./minimal file 1&#xA;&#xA;# 1.542 total&#xA;time sudo flamegraph ffmpeg -threads 1 -i file -map 0:a:0 -f null - 2>&amp;1&#xA;

    &#xA;

    Here are the flamegraphs stacked up, scaled so that the faster one is only 85% as wide as the slower one. (click for larger)

    &#xA;

    ffmpeg versus a minimal example, audio from the same file

    &#xA;

    The interesting thing that stands out to me is how long is spent on read in the minimal example vs. ffmpeg :

    &#xA;

    time spent on read call, ffmpeg vs minimal example

    &#xA;

    The time spent on lseek is also a lot longer in the minimal program – it's plainly visible in that flamegraph, but in the ffmpeg flamegraph, lseek is a single pixel wide.

    &#xA;

    What's causing this discrepancy ? Is ffmpeg actually doing less work than I think it is here ? Is the minimal code doing something naive ? Is there some buffering or other I/O optimizations that ffmpeg has enabled ?

    &#xA;

    How can I shave 0.3 seconds off of the minimal example's runtime ?

    &#xA;