Recherche avancée

Médias (91)

Autres articles (68)

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

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

Sur d’autres sites (6648)

  • why AVFrame pts value doesn't affect bitrate of frames ?

    31 janvier 2021, par fsdfhdsjkhfjkds

    I'm trying code realtime screen sharing I noticed H264 codec doesn't do constant time encode for every frame. That causes being not able to encode exact same amount frame rate with context->time_base. When we encode less frames per second than time_base bitrate of second becomes lower than what we set.

    


    I modified libav's example encode code and put 1/1000 time base and supply it with only 10 frame. I increase frame->pts related with time_base but bitrates still stay at low.

    


    For results I just change context->time_base to 1, 1000, 1, 10 etc

    


    1/1000 time base (as sum 1989 bytes per second) :

    


    encoded frame 0 (size=1169)
encoded frame 100 (size=95)
encoded frame 200 (size=92)
encoded frame 300 (size=102)
encoded frame 400 (size=90)
encoded frame 500 (size=90)
encoded frame 600 (size=90)
encoded frame 700 (size=83)
encoded frame 800 (size=95)
encoded frame 900 (size=83)


    


    1/10 time base (as sum 95324 bytes per second) :

    


    encoded frame 0 (size=14187)
encoded frame 1 (size=6053)
encoded frame 2 (size=8530)
encoded frame 3 (size=9277)
encoded frame 4 (size=9508)
encoded frame 5 (size=11163)
encoded frame 6 (size=9685)
encoded frame 7 (size=9346)
encoded frame 8 (size=7662)
encoded frame 9 (size=9913)


    


    code :

    


    #include &#xA;#include &#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;&#xA;static void encode(AVCodecContext *context, AVFrame *frame, AVPacket *pkt, FILE *outfile){&#xA;    int ret = avcodec_send_frame(context, frame);&#xA;    assert(ret >= 0);&#xA;    while(ret >= 0){&#xA;        ret = avcodec_receive_packet(context, pkt);&#xA;        if(ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)&#xA;            return;&#xA;        else if(ret &lt; 0)&#xA;            assert(0);&#xA;        printf("encoded frame %lld (size=%d)\n", pkt->pts, pkt->size);&#xA;        fwrite(pkt->data, 1, pkt->size, outfile);&#xA;        av_packet_unref(pkt);&#xA;    }&#xA;}&#xA;&#xA;int main(int argc, char **argv){&#xA;    if(argc &lt;= 1){&#xA;        fprintf(stderr, "Usage: %s <output file="file">\n", argv[0]);&#xA;        exit(0);&#xA;    }&#xA;    av_log_set_level(AV_LOG_QUIET);&#xA;    const char *filename = argv[1];&#xA;    const AVCodec *codec = avcodec_find_encoder(AV_CODEC_ID_H264);&#xA;    assert(codec);&#xA;    AVCodecContext *context = avcodec_alloc_context3(codec);&#xA;    assert(context);&#xA;    AVFrame *frame = av_frame_alloc();&#xA;    assert(frame);&#xA;    AVPacket *pkt = av_packet_alloc();&#xA;    assert(pkt);&#xA;    context->bit_rate = 800000;&#xA;    context->width = 1280;&#xA;    context->height = 720;&#xA;    context->time_base = (AVRational){1, 1000};&#xA;    context->pix_fmt = AV_PIX_FMT_YUV420P;&#xA;    AVDictionary *dict = 0;&#xA;    assert(av_dict_set(&amp;dict, "preset", "veryfast", 0) >= 0);&#xA;    assert(av_dict_set(&amp;dict, "tune", "zerolatency", 0) >= 0);&#xA;    assert(avcodec_open2(context, codec, &amp;dict) >= 0);&#xA;    FILE *f = fopen(filename, "wb");&#xA;    assert(f);&#xA;    frame->format = context->pix_fmt;&#xA;    frame->width  = context->width;&#xA;    frame->height = context->height;&#xA;    assert(av_frame_get_buffer(frame, 0) >= 0);&#xA;    for(int i = 0; i &lt; 10; i&#x2B;&#x2B;){&#xA;        for(int y = 0; y &lt; context->height; y&#x2B;&#x2B;){&#xA;            for(int x = 0; x &lt; context->width; x&#x2B;&#x2B;){&#xA;                frame->data[0][y * frame->linesize[0] &#x2B; x] = x &#x2B; y &#x2B; i * 3;&#xA;            }&#xA;        }&#xA;        for(int y = 0; y &lt; context->height / 2; y&#x2B;&#x2B;){&#xA;            for(int x = 0; x &lt; context->width / 2; x&#x2B;&#x2B;){&#xA;                frame->data[1][y * frame->linesize[1] &#x2B; x] = 128 &#x2B; y &#x2B; i * 2;&#xA;                frame->data[2][y * frame->linesize[2] &#x2B; x] = 64 &#x2B; x &#x2B; i * 5;&#xA;            }&#xA;        }&#xA;        frame->pts = i * (context->time_base.den / 10);&#xA;        encode(context, frame, pkt, f);&#xA;    }&#xA;    fclose(f);&#xA;    avcodec_free_context(&amp;context);&#xA;    av_frame_free(&amp;frame);&#xA;    av_packet_free(&amp;pkt);&#xA;    return 0;&#xA;}&#xA;</output>

    &#xA;

    How we can keep right bitrate with different time_base than frame rate ?

    &#xA;

  • How to stream audio from ffserver

    22 mai 2019, par Doro

    I trying to stream 2 files - 1.mkv without audio (which streaming ok) and 2.mkv with audio encoded with Vorbis codec which i can’t stream. For encoding I used

    ffmpeg -i 2.mp4 -strict -2 -c:a vorbis ex.mkv

    And it playing ok with ffplay

    Server log :

    Fri May 17 00:49:08 2019 Opening feed file '1.mkv' for stream 'test1-rtsp'
    Fri May 17 00:49:08 2019 [matroska,webm @ 0x200746c0]Unknown entry 0x55B0
    Thu Dec 14 21:35:00 1950 [h264 @ 0x2007dcc0]gray chroma
    Fri May 17 00:49:08 2019 [h264 @ 0x2007dcc0]error while decoding MB 18 1, bytestream 1989
    Fri May 17 00:49:08 2019 [h264 @ 0x2007dcc0]concealing 432 DC, 432 AC, 432 MV errors in I frame
    Fri May 17 00:49:08 2019 Opening feed file '2.mkv' for stream 'test2-rtsp'
    Fri May 17 00:49:08 2019 [matroska,webm @ 0x200746c0]Unknown entry 0x55B0
    Fri May 17 00:49:08 2019 FFserver started.
    Fri May 17 00:49:25 2019 [matroska,webm @ 0x20080de0]Unknown entry 0x55B0
    Fri May 17 00:49:25 2019 127.0.0.1:33582 - - "PLAY test2-rtsp/streamid=0 RTP/UDP"
    Fri May 17 00:49:25 2019 127.0.0.1 - - [SETUP] "rtsp://127.0.0.1:7654/test2-rtsp/ RTSP/1.0" 200 2553

    Client log :

    Bad packed header lengths (30,0,1250,2673)
    [udp @ 00000236f6318500] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
    [udp @ 00000236f63185c0] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
    [udp @ 00000236f633dc40] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
    [udp @ 00000236f634df00] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
    [rtsp @ 00000236f63153c0] method SETUP failed: 503 Service Unavailable
    rtsp://127.0.0.1:7654/test2-rtsp: Server returned 5XX Server Error reply

    Configure ffserver file :

    Port 8090
    BindAddress 0.0.0.0
    MaxHTTPConnections 2000
    MaxClients 1000
    MaxBandwidth 500000
    CustomLog -
    NoDaemon

    RTSPPort 7654
    RTSPBindAddress 0.0.0.0

    <stream>
       Format rtp
       File "1.mkv"
    </stream>
    <stream>
       Format rtp
       Strict -2
       AudioCodec vorbis
       File "2.mkv"
    </stream>
  • ffmpeg channels don't work (PHP)

    15 avril 2016, par Y.Saad

    I have a lot of channels with " ffmpeg " (4 channels) that start automatically, I create a code for show the first channel and after 5 seconds show the second .. Etc All things as right but I have a small problem the seconds channel doesn’t start automatically, I need to make stop to the first channel

    Code for 4 channel work 100% but without function for show first channel and after 5 seconds show the second ... Etc

    &lt;?php

    ffmpeg -i http://clay24.webhop.net:8000/live/mario/mario/13.ts -i http://clay24.webhop.net:8000/live/mario/mario/12.ts -i http://clay24.webhop.net:8000/live/mario/mario/10.ts -map 0 -c:a aac -b:a 64k -strict -2 -preset fast -crf 25 -vcodec libx264 -f flv rtmp://178.33.231.108:1989/mylive/1 -map 1 -c:a aac -b:a 64k -strict -2 -preset fast -crf 25 -vcodec libx264 -f flv rtmp://178.33.231.108:1989/mylive/21 -map 2 -c:a aac -b:a 64k -strict -2 -preset fast -crf 25 -vcodec libx264 -f flv rtmp://178.33.231.108:1989/mylive/24

    ?>

    the second code with functions

    &lt;?php
    echo'
       <code class="echappe-js">&lt;script&gt;<br />
    <br />
                    window.addEventListener(&quot;load&quot;, function() {<br />
    <br />
    var urls = iframes = [ &quot;'; ffmpeg -i http://mygameravatar.zapto.org:43666/live/test1/test2/81.ts -c:a aac -b:a 64k -preset fast -crf 25 -vcodec libx264 -f flv rtmp://178.33.231.108:1989/mylive/2 <br />
            echo '];<br />
    <br />
    var iframes = document.querySelectorAll(&quot;div&quot;);<br />
    <br />
    var n = 0;<br />
    <br />
    var interval = setInterval(function() {<br />
     <br />
     iframes[++n].src = urls[n - 1];<br />
     iframes[n].style.display = &quot;block&quot;;<br />
     console.log(n);<br />
     if (n === iframes.length -1) {<br />
       clearInterval(interval);<br />
       console.log(&quot;all iframes loaded&quot;)<br />
     }<br />
     <br />
    }, 5000)<br />
    <br />
    })<br />
            &lt;/script&gt;
    ’ ;

    ffmpeg -i http://mygameravatar.zapto.org:43666/live/test1/test2/297.ts -c:a aac -b:a 64k -preset fast -crf 25 -vcodec libx264 -f flv rtmp ://178.33.231.108:1989/mylive/1

    echo ’

    ’ ;
     ?>