Recherche avancée

Médias (91)

Autres articles (112)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

Sur d’autres sites (12043)

  • Libav API : How to modify the start time of an audio stream ?

    24 avril 2022, par xtingray

    Currently, I am working on a new feature for my software using the Libav API. I was able to merge a video file with and audio file, the output is an MP4 file and the source code works perfectly.

    


    Right now, I have a new requirement : the start time for the video and the audio streams are the same. Both start at 00:00. My next challenge is to add an option to shift the start time for the audio stream based on a variable. For example, if audio start variable is equal to 10 seconds, then the audio stream should be played at time 00:10.

    


    So I wonder, what is the best approach to implement this feature ? Should I insert silent packets before the audio start time is reached ? Or should I modify the timestamp information for every audio stream packet before it is written into the output container ?

    


    Here is the piece of code I use to write the audio stream into the MP4 file. Right now it works like a charm, but I guess this is the place where I should implement the new requirement. I will appreciate any suggestion.

    


    while (1) {&#xA;    AVStream *in_stream;&#xA;&#xA;    int ret = av_read_frame(audioInputFormatContext, pkt);&#xA;    if (ret &lt; 0)&#xA;        break;&#xA;&#xA;    in_stream  = audioInputFormatContext->streams[pkt->stream_index];&#xA;    pkt->stream_index = outIndex;&#xA;&#xA;    AVRational out_time_base = audioStreamList.at(i)->time_base;&#xA;&#xA;    // copy packet&#xA;    pkt->pts = av_rescale_q_rnd(pkt->pts, in_stream->time_base, audioStreamList.at(i)->time_base,&#xA;                                static_cast<avrounding>(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX));&#xA;    pkt->dts = av_rescale_q_rnd(pkt->dts, in_stream->time_base, audioStreamList.at(i)->time_base,&#xA;                                static_cast<avrounding>(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX));&#xA;    pkt->duration = av_rescale_q(pkt->duration, in_stream->time_base, audioStreamList.at(i)->time_base);&#xA;    pkt->pos = -1;&#xA;&#xA;    ret = av_interleaved_write_frame(formatContext, pkt);&#xA;    if (ret &lt; 0) {&#xA;        fprintf(stderr, "Error muxing packet\n");&#xA;        break;&#xA;    }&#xA;    av_packet_unref(pkt);&#xA;}&#xA;</avrounding></avrounding>

    &#xA;

  • FFMPEG streaming RTP : time base not set

    25 octobre 2020, par Managarm

    I'm trying to create a small demo to get a feeling for streaming programmatically with ffmpeg. I'm using the code from this question as a basis. I can compile my code, but when I try to run it I always get this error :

    &#xA;&#xA;

    &#xA;

    [rtp @ 0xbeb480] time base not set

    &#xA;

    &#xA;&#xA;

    The thing is, I have set the time base parameters. I even tried setting them for the stream (and the codec associated with the stream) as well, even though this should not be necessary as far as I understand it. This is the relevant section in my code :

    &#xA;&#xA;

    AVCodec* codec = avcodec_find_encoder(AV_CODEC_ID_H264);&#xA;AVCodecContext* c = avcodec_alloc_context3(codec);&#xA;c->pix_fmt = AV_PIX_FMT_YUV420P;&#xA;c->flags = CODEC_FLAG_GLOBAL_HEADER;&#xA;c->width = WIDTH;&#xA;c->height = HEIGHT;&#xA;c->time_base.den = FPS;&#xA;c->time_base.num = 1;&#xA;c->gop_size = FPS;&#xA;c->bit_rate = BITRATE;&#xA;&#xA;avcodec_open2(c, codec, NULL);&#xA;struct AVStream* stream = avformat_new_stream(avctx, codec);&#xA;&#xA;// TODO: causes an error&#xA;avformat_write_header(avctx, NULL);&#xA;

    &#xA;&#xA;

    The error occurs when calling "avformat_write_header" near the end. All methods that can fail (like avcodec_open2) are checked, I just removed the checks to make the code more readable.

    &#xA;&#xA;

    Digging through google and the ffmpeg source code didn't yield any useful results. I think it's really basic, but I'm stuck. Who can help me ?

    &#xA;

  • FFMPEG streaming RTP : time base not set

    15 novembre 2016, par Managarm

    I’m trying to create a small demo to get a feeling for streaming programmatically with ffmpeg. I’m using the code from this question as a basis. I can compile my code, but when I try to run it I always get this error :

    [rtp @ 0xbeb480] time base not set

    The thing is, I have set the time base parameters. I even tried setting them for the stream (and the codec associated with the stream) as well, even though this should not be necessary as far as I understand it. This is the relevant section in my code :

    AVCodec* codec = avcodec_find_encoder(AV_CODEC_ID_H264);
    AVCodecContext* c = avcodec_alloc_context3(codec);
    c->pix_fmt = AV_PIX_FMT_YUV420P;
    c->flags = CODEC_FLAG_GLOBAL_HEADER;
    c->width = WIDTH;
    c->height = HEIGHT;
    c->time_base.den = FPS;
    c->time_base.num = 1;
    c->gop_size = FPS;
    c->bit_rate = BITRATE;

    avcodec_open2(c, codec, NULL);
    struct AVStream* stream = avformat_new_stream(avctx, codec);

    // TODO: causes an error
    avformat_write_header(avctx, NULL);

    The error occurs when calling "avformat_write_header" near the end. All methods that can fail (like avcodec_open2) are checked, I just removed the checks to make the code more readable.

    Digging through google and the ffmpeg source code didn’t yield any useful results. I think it’s really basic, but I’m stuck. Who can help me ?