Recherche avancée

Médias (0)

Mot : - Tags -/metadatas

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (76)

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

  • Participer à sa documentation

    10 avril 2011

    La documentation est un des travaux les plus importants et les plus contraignants lors de la réalisation d’un outil technique.
    Tout apport extérieur à ce sujet est primordial : la critique de l’existant ; la participation à la rédaction d’articles orientés : utilisateur (administrateur de MediaSPIP ou simplement producteur de contenu) ; développeur ; la création de screencasts d’explication ; la traduction de la documentation dans une nouvelle langue ;
    Pour ce faire, vous pouvez vous inscrire sur (...)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (10796)

  • My C++ software uses ffmpeg in streaming mode, but I want to decode the data as quickly as possible, how do I do that ?

    14 septembre 2022, par Alexis Wilke

    When I run ffmpeg in my command line to convert an m4a file to mp3, it says ×45 to ×55 for the speed at which is decodes the input data. In this case, the 45 minute audio file gets converter in 2 minutes.

    


    When I run the same process through my C++ code, I stream the data. This is because my code accepts data coming from the network so often it will a little faster to do streaming (unfortunately, not with m4a data since the header is placed at the end of the file...)

    


    However, there seems to be something in ffmpeg that makes it think that if I want to stream the data it needs to be done in realtime. In other words, the frames come through at a speed of ×1 instead of the possible average of ×50.

    


    Is there a flag/setup that I need to turn ON or OFF so the streaming process goes ×50 or so ?

    



    


    I allocate the context like so :

    


    size_t const avio_buffer_size(4096);&#xA;unsigned char * avio_buffer(reinterpret_cast<unsigned char="char">(av_malloc(avio_buffer_size)));&#xA;AVIOContext * context(avio_alloc_context(&#xA;                          avio_buffer&#xA;                        , avio_buffer_size&#xA;                        , 0             // write flag&#xA;                        , this          // opaque&#xA;                        , decoder_read_static&#xA;                        , nullptr       // write func.&#xA;                        , decoder_seek_static));&#xA;</unsigned>

    &#xA;

    To do the streaming, I use custom I/O in the context :

    &#xA;

    AVFormatContext * format_context(avformat_alloc_context());&#xA;format_context->pb = context;&#xA;format_context->flags |= AVFMT_FLAG_CUSTOM_IO;&#xA;avformat_open_input(&#xA;          &amp;format_context&#xA;        , "input"           // filename (unused)&#xA;        , nullptr           // input format&#xA;        , nullptr);         // options&#xA;

    &#xA;

    Next I get the audio stream index :

    &#xA;

    avformat_find_stream_info(format_context, nullptr);&#xA;AVCodec * decoder_codec(nullptr);&#xA;int const index(av_find_best_stream(&#xA;              format_context&#xA;            , AVMEDIA_TYPE_AUDIO&#xA;            , -1            // wanted stream number&#xA;            , -1            // related stream&#xA;            , &amp;decoder_codec&#xA;            , 0));          // flags&#xA;

    &#xA;

    That has the side effect of telling us which decoder to use :

    &#xA;

    AVCodecContext * decoder_context = avcodec_alloc_context3(decoder_codec);&#xA;avcodec_parameters_to_context(&#xA;          decoder_context&#xA;        , format_context->streams[index]->codecpar);&#xA;avcodec_open2(&#xA;              decoder_context&#xA;            , decoder_codec&#xA;            , nullptr);        // options&#xA;

    &#xA;

    And finally, I loop through the frames :

    &#xA;

    AVFrame *frame(av_frame_alloc());&#xA;AVPacket av_packet;&#xA;av_init_packet(&amp;av_packet);&#xA;for(;;)&#xA;{&#xA;    av_read_frame(format_context, &amp;av_packet);&#xA;    if(end-detected)&#xA;    {&#xA;        break;&#xA;    }&#xA;    if(av_packet.stream_index != index) continue;&#xA;    avcodec_send_packet(decoder_context, &amp;av_packet);&#xA;    for(;;)&#xA;    {&#xA;        avcodec_receive_frame(decoder_context, frame);&#xA;        if(end-detected)&#xA;        {&#xA;            break;&#xA;        }&#xA;        ...copy data from frame...&#xA;        av_frame_unref(frame);&#xA;    }&#xA;    av_packet_unref(&amp;av_packet);&#xA;}&#xA;

    &#xA;

    Note : I don't show all the error handling, use of RAII, etc. in an attempt to show the code in its simplest form.

    &#xA;

  • How to make customizable subtitles with FFmpeg ?

    6 août 2022, par Alex Rypun

    I need to generate videos with text (aka subtitles) and styles provided by users.&#xA;The styles are a few fonts, text border, text background, text shadow, colors, position on the video, etc.

    &#xA;

    As I understand there are 2 filters I can use : drawtext and subtitles.

    &#xA;

    subtitles is easier to use but it's not fully customizable. For example, I can't add shadow and background for the same text.

    &#xA;

    drawtext is more customizable but quite problematic.

    &#xA;

    I've implemented almost everything I need with drawtext but have one problem : multiline text with a background.

    &#xA;

    boxborderw parameter adds specified pixels count from all 4 sides from the extreme text point. I need to make backgrounds touch each other (pixel perfect). That means I have to position text lines with the same space between extreme text points (not between baselines). With crazy workarounds I solved it.&#xA;Everything almost works but sometimes some strange border appears between lines :

    &#xA;

    enter image description here

    &#xA;

    Spending ages investigating I figured out that it depends on the actual line height and the position on the video.&#xA;Each letter has its own distances between baseline and the highest point and between baseline and the lowest point.&#xA;The whole line height is the difference between the highest point of the highest symbol and the lowest point of the lowest symbol :

    &#xA;

    enter image description here

    &#xA;

    Now the most interesting.

    &#xA;

    For lines that have even pixels height.

    &#xA;

    If the line is positioned on the odd pixel (y-axis) and has an odd boxborderw (or positioned on the even pixel (y-axis) and has an even boxborderw ), then it's rendered as expected (without any additional borders).&#xA;In other cases, the thin dark line is noticeable on the contact line (it's rendered either on top or at bottom of each text block :

    &#xA;

    enter image description here

    &#xA;
    &#xA;

    For lines that have odd pixels height.

    &#xA;

    In all cases the thin dark line is noticeable. Depending on y coordinate (odd or even) and boxborderw value (odd or even) that magic line appears on top or bottom :

    &#xA;

    enter image description here

    &#xA;

    I can make text lines overlap a bit. This solves the problem but adds another problem.&#xA;I use fade-in/out by smoothly changing alfa (transparency). When the text becomes semi-transparent the overlapped area has a different color :

    &#xA;

    enter image description here

    &#xA;

    Here is the command I use :

    &#xA;

    ffmpeg "-y" "-f" "lavfi" "-i" "color=#ffffff" "-filter_complex" \&#xA;"[0:v]loop=-1:1:0,trim=duration=2.00,format=yuv420p,scale=960:540,setdar=16/9[video];\&#xA;[video]drawtext=text=&#x27;qqq&#x27;:\&#xA;fontfile=ComicSansMS.ttf:\&#xA;fontcolor=#ffffff:\&#xA;fontsize=58:\&#xA;bordercolor=#000000:\&#xA;borderw=2:\&#xA;box=1:\&#xA;boxcolor=#ff0000:\&#xA;boxborderw=15:\&#xA;x=(w-text_w)/2:\&#xA;y=105:\&#xA;alpha=&#x27;if(lt(t,0),0,if(lt(t,0.5),(t-0)/0.5,if(lt(t,1.49),1,if(lt(t,1.99),(0.5-(t-1.49))/0.5,0))))&#x27;,\&#xA;drawtext=text=&#x27;qqq&#x27;:\&#xA;fontfile=ComicSansMS.ttf:\&#xA;fontcolor=#ffffff:\&#xA;fontsize=58:\&#xA;bordercolor=#000000:\&#xA;borderw=2:\&#xA;box=1:\&#xA;boxcolor=#ff0000:\&#xA;boxborderw=15:\&#xA;x=(w-text_w)/2:\&#xA;y=182:\&#xA;alpha=&#x27;if(lt(t,0),0,if(lt(t,0.5),(t-0)/0.5,if(lt(t,1.49),1,if(lt(t,1.99),(0.5-(t-1.49))/0.5,0))))&#x27;[video]" \&#xA;"-vsync" "2" "-map" "[video]" "-r" "25" "output_multiline.mp4"&#xA;

    &#xA;

    I tried to draw rectangles with drawbox following the same logic (changing the position and height). But there were no problems.

    &#xA;

    Does anybody know what is the nature of that dark line ?&#xA;And how it can depend on the even/odd of the height and position ?&#xA;What should I investigate to figure out such a behavior ?

    &#xA;

    UPD :

    &#xA;

    Just accidentally figured out that changing the pixel format (from format=yuv420p to format=uyvy422 or many others) solved the problem. At least on my test commands.&#xA;Now will learn about what is pixel format)

    &#xA;

  • How to Drop all matched frames that are the same with a specified frame

    2 octobre 2022, par zgno

    After researching into this for a couple of days, I found that mpdecimate only drop frames that is similar to the PREVIOUS frame. My problem is that just one same frame is duplicated throughout the whole video, and it is duplicated between frames(in other words, not sequentially,so mpdecimate always treats them as not duplicated) . It's almost like that frame is inserted randomly for a 1000+ times throughout the video. And I use ffmpeg -err_detect ignore_err -i only to find that no errors are detected. This strange situation happens in some hls streaming video. I will provide a small segment of the whole video for anyone who are interested to test.&#xA;A 6 seconds video down below, it is a badminton game.&#xA;A segment from the m3u8 file list

    &#xA;