Recherche avancée

Médias (91)

Autres articles (96)

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

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

  • Installation en mode standalone

    4 février 2011, par

    L’installation de la distribution MediaSPIP se fait en plusieurs étapes : la récupération des fichiers nécessaires. À ce moment là deux méthodes sont possibles : en installant l’archive ZIP contenant l’ensemble de la distribution ; via SVN en récupérant les sources de chaque modules séparément ; la préconfiguration ; l’installation définitive ;
    [mediaspip_zip]Installation de l’archive ZIP de MediaSPIP
    Ce mode d’installation est la méthode la plus simple afin d’installer l’ensemble de la distribution (...)

Sur d’autres sites (12272)

  • h264 ffmpeg : How to initialize ffmpeg to decode NALs created with x264

    19 février 2024, par Raul Calvo

    I encoded some frames using x264, using x264_encoder_encode() and after that I created AVPackets using a function like this :

    


    bool PacketizeNals( uint8_t* a_pNalBuffer, int a_nNalBufferSize, AVPacket* a_pPacket )
{
    if ( !a_pPacket )
return false;
    a_pPacket->data = a_pNalBuffer;
    a_pPacket->size = a_nNalBufferSize;
    a_pPacket->stream_index = 0;
    a_pPacket->flags = AV_PKT_FLAG_KEY;

    a_pPacket->pts = int64_t(0x8000000000000000);
    a_pPacket->dts = int64_t(0x8000000000000000);
}


    


    I call this function like this :

    


    x264_nal_t* nals;
int num_nals = encode_frame(pic, &nals);
for (int i = 0; i < num_nals; i++)
{
    AVPacket* pPacket = ( AVPacket* )av_malloc( sizeof( AVPacket ) );
    av_init_packet( pPacket );
    if ( PacketizeNals( nals[i].p_payload, nals[i].i_payload, pPacket ) )
    {
        packets.push_back( pPacket );
    }
}


    


    Now what I want to do is to decode these AVPackets using avcodec_decode_video2. I think the problem is that I haven't properly initialized the decoder because to encode I used "ultrafast" profile and "zerolatency" tune (x264) and to decode I don't know how to specify these options to ffmpeg.

    


    In some examples I have read people initialize the decoder using the file where the video is stored, but in this case I have the AVPackets directly.

    


    What I'm doing to try to decode is :

    


    avcodec_init();  
avcodec_register_all();  
AVCodec* pCodec;  
pCodec=avcodec_find_decoder(CODEC_ID_H264);  
AVCodecContext* pCodecContext;  
pCodecContext=avcodec_alloc_context();  
avcodec_open(pCodecContext,pCodec);  
pCodecContext->width = 320;
pCodecContext->height = 200;
pCodecContext->extradata = NULL;
unsigned int nNumPackets = packets.size();
int frameFinished = 0;
for ( auto it = packets.begin(); it != packets.end(); it++ )
{
    AVFrame* pFrame;
    pFrame = avcodec_alloc_frame();
    AVPacket* pPacket = *it;
    int iReturn = avcodec_decode_video2( pCodecContext, pFrame, &frameFinished, pPacket );
}


    


    But iReturn is always -1.

    


    Can anyone help me ? Sorry if my knowledge in this area is low, I'm new.

    


  • h264 ffmpeg : How to initialize ffmpeg to decode NALs created with x264

    19 février 2024, par Raul Calvo

    I encoded some frames using x264, using x264_encoder_encode() and after that I created AVPackets using a function like this :

    


    bool PacketizeNals( uint8_t* a_pNalBuffer, int a_nNalBufferSize, AVPacket* a_pPacket )
{
    if ( !a_pPacket )
return false;
    a_pPacket->data = a_pNalBuffer;
    a_pPacket->size = a_nNalBufferSize;
    a_pPacket->stream_index = 0;
    a_pPacket->flags = AV_PKT_FLAG_KEY;

    a_pPacket->pts = int64_t(0x8000000000000000);
    a_pPacket->dts = int64_t(0x8000000000000000);
}


    


    I call this function like this :

    


    x264_nal_t* nals;
int num_nals = encode_frame(pic, &nals);
for (int i = 0; i < num_nals; i++)
{
    AVPacket* pPacket = ( AVPacket* )av_malloc( sizeof( AVPacket ) );
    av_init_packet( pPacket );
    if ( PacketizeNals( nals[i].p_payload, nals[i].i_payload, pPacket ) )
    {
        packets.push_back( pPacket );
    }
}


    


    Now what I want to do is to decode these AVPackets using avcodec_decode_video2. I think the problem is that I haven't properly initialized the decoder because to encode I used "ultrafast" profile and "zerolatency" tune (x264) and to decode I don't know how to specify these options to ffmpeg.

    


    In some examples I have read people initialize the decoder using the file where the video is stored, but in this case I have the AVPackets directly.

    


    What I'm doing to try to decode is :

    


    avcodec_init();  
avcodec_register_all();  
AVCodec* pCodec;  
pCodec=avcodec_find_decoder(CODEC_ID_H264);  
AVCodecContext* pCodecContext;  
pCodecContext=avcodec_alloc_context();  
avcodec_open(pCodecContext,pCodec);  
pCodecContext->width = 320;
pCodecContext->height = 200;
pCodecContext->extradata = NULL;
unsigned int nNumPackets = packets.size();
int frameFinished = 0;
for ( auto it = packets.begin(); it != packets.end(); it++ )
{
    AVFrame* pFrame;
    pFrame = avcodec_alloc_frame();
    AVPacket* pPacket = *it;
    int iReturn = avcodec_decode_video2( pCodecContext, pFrame, &frameFinished, pPacket );
}


    


    But iReturn is always -1.

    


    Can anyone help me ? Sorry if my knowledge in this area is low, I'm new.

    


  • Having ffmpeg add a repeating text overlay on a video

    30 mai 2020, par Caius Jard

    I'm looking to create an overlay that cycles through the characters in a string over and over. I've succeeded in using a sendcmd file to put A, B, C, D, E on the first 5 seconds of a video

    



    0  drawtext reinit 'text=A';
1  drawtext reinit 'text=B';
2  drawtext reinit 'text=C';
3  drawtext reinit 'text=D';
4  drawtext reinit 'text=E';


    



    But it doesn't cycle and I haven't been able to find a way to make it, because sendcmd looks like it just takes a simple timecode. I could make a command file 3600 lines long for my hour video, with those commands in over and over (the command file would be generated programmatically so not onerous)

    




    



    After some considerable experimenting I was able to do it with 5 separate drawtext :

    



    drawtext=fontfile=/Windows/Fonts/bauhs93.ttf:fontsize=1024:fontcolor=white@0.1:bordercolor=black@0.1:borderw=10:r=250:text='A':x=if(trunc(mod(t\,5))\,-2000\,(w-tw)/2),
drawtext=fontfile=/Windows/Fonts/bauhs93.ttf:fontsize=1024:fontcolor=white@0.1:bordercolor=black@0.1:borderw=10:r=250:text='B':x=if(trunc(mod(t\,5))-1\,-2000\,(w-tw)/2),
drawtext=fontfile=/Windows/Fonts/bauhs93.ttf:fontsize=1024:fontcolor=white@0.1:bordercolor=black@0.1:borderw=10:r=250:text='C':x=if(trunc(mod(t\,5))-2\,-2000\,(w-tw)/2),
drawtext=fontfile=/Windows/Fonts/bauhs93.ttf:fontsize=1024:fontcolor=white@0.1:bordercolor=black@0.1:borderw=10:r=250:text='D':x=if(trunc(mod(t\,5))-3\,-2000\,(w-tw)/2),
drawtext=fontfile=/Windows/Fonts/bauhs93.ttf:fontsize=1024:fontcolor=white@0.1:bordercolor=black@0.1:borderw=10:r=250:text='E':x=if(trunc(mod(t\,5))-4\,-2000\,(w-tw)/2)


    



    But as can be seen, I have to repeat a lot of stuff here. Is there any slicker way ? It does seem to have a noticeable effect on encoding speed the more chars are added

    



    I was hoping that text expressions would help but it seems I can only return numerics from the values, so this expression didn't work out :

    



    %{e:if(trunc(mod(t,5)),'A', '')%{e:if(trunc(mod(t,5))-1,'B', '') ...