Recherche avancée

Médias (0)

Mot : - Tags -/organisation

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

Autres articles (45)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (10080)

  • ffmpeg generate m3u8 from mp4 (Resume option)

    20 août 2014, par diogopms

    I have a mp4 file or other file (non mp4 format) and i need generate ts files and m3u8 playlist.

    I am using this command and works fine :

    ffmpeg -i foo.mp4 -codec copy -vbsf h264_mp4toannexb -map 0 -f segment
    -segment_list out.m3u8 -segment_time 10 out%03d.ts

    Now I need to generate many ts simultaneous so i need a "resume option".

    Please see the example below :

    One thread (first 20 seconds (0-20))

    ffmpeg -i foo.mp4 -codec copy -vbsf h264_mp4toannexb -map 0 -f segment
    -segment_list out.m3u8 -segment_time 10 out%03d.ts

    Seconds thread (20 seconds to 40 seconds)

    ffmpeg -i foo.mp4 ......

    Third thread (40 seconds to 60 seconds)

    ffmpeg -i foo.mp4 ......

    I have lots of core processor to do this jobs.

    In resume i need generate .ts files and m3u8 fastest way possible

    I need help or advises to resolve my problem.

    Prove of concept i build a litle script that use -ss and -t option :

    <?php

    //generate all the commands using -ss and -t <seconds>
    $startTime = new DateTime("00:00:00");
    for ($i=1; $i &lt; 20; $i++) {
       $data = $startTime->format('H:i:s');
       $exec = 'ffmpeg  -i "<file>" -ss '.$data.' -t 10 -c:v copy -bsf h264_mp4toannexb -flags -global_header -map 0 -f segment -segment_time 10 -segment_start_number '.$i.' -segment_list '.sprintf("%04d", $i).'_test.m3u8 -segment_format mpegts '.$i.'stream%05d.ts';
       shell_exec($exec);
       $startTime->modify('+10 seconds');
       echo "\n";
    }

    //cycle all m3u8 and creates a master hls playlist
    $files = glob('*.{m3u8}', GLOB_BRACE);
    sort($files);
    $ret = "#EXTM3U
    #EXT-X-VERSION:3
    #EXT-X-MEDIA-SEQUENCE:0
    #EXT-X-ALLOW-CACHE:YES
    #EXT-X-TARGETDURATION:11
    ";
    foreach($files as $file) {
       $ret .= shell_exec('sed -n -e 6,7p '. $file);
    }
    $ret .= "#EXT-X-ENDLIST";

    file_put_contents('final.m3u8', $ret);

    ?>
    </file></seconds>

    Thanks

  • how to kill a thread which hang up and release resources [duplicate]

    15 octobre 2019, par DJI_lover

    This question already has an answer here :

    I am doing some jobs in ubuntu with c++.I want to know how to kill a thread when function blocking in a thread and there is no timeout mechanism for this function. I want to force to kill the thread when function is blocking and release all the resources in the thread and then restart the thread.I can’t set a quit flag in thread because it nerver get there when function hang up.Could someone tell me the better way to do this ? Thanks !

    Code :

    static int encode_and_write_frame(AVCodecContext *codec_ctx, AVFormatContext *fmt_ctx, AVFrame *frame)
    {
       AVPacket pkt = {0};
       av_init_packet(&amp;pkt);
       int ret = avcodec_send_frame(codec_ctx, frame);
       if (ret &lt; 0)
       {
           fprintf(stderr, "Error sending frame to codec context!\n");
           return ret;
       }
       ret = avcodec_receive_packet(codec_ctx, &amp;pkt);
       if (ret &lt; 0)
       {
           fprintf(stderr, "Error receiving packet from codec context!\n" );
           return ret;
       }
       int ret1 = av_interleaved_write_frame(fmt_ctx, &amp;pkt);
       av_packet_unref(&amp;pkt);
       return ret1;
    }

    void thread_worker(){
       while(ros::ok()){
           encode_and_write_frame(param1,param2,param3);
           usleep(500000);
       }
    }

    thread t(&amp;thread_worker);

    when the network situation is good, av_interleaved_write_frame() can return quickly,but when network was broken down, av_interleaved_write_frame() will hang forever, and I can’t set timeout for av_interleaved_write_frame so that I want to kill the blocking thread and restart it.

  • FFmpeg compiling error(libavfilter/vf_scale_cuda.cu)

    11 août 2021, par Amir Mousavi

    installed packages :

    &#xA;

    &#xA;

    libx264 - cuda11.2 - cuda-toolkit - nvidia-driver-465

    &#xA;

    &#xA;

    command :

    &#xA;

    ./configure —enable-nonfree —enable-cuvid —enable-nvenc —enable-cuda-nvcc —enable-libx264 —enable-gpl —extra-cflags=-I/usr/local/cuda/include —extra-ldflags=-L/usr/local/cuda/lib64

    &#xA;

    here is latest lines errors :

    &#xA;

    &#xA;

    libavfilter/vf_scale_cuda.cu(1123) : error : a template argument may not reference a non-external entity

    &#xA;

    libavfilter/vf_scale_cuda.cu(1123) : error : a template argument may not reference a non-external entity

    &#xA;

    libavfilter/vf_scale_cuda.cu(1124) : error : a template argument may not reference a non-external entity

    &#xA;

    libavfilter/vf_scale_cuda.cu(1124) : error : a template argument may not reference a non-external entity

    &#xA;

    libavfilter/vf_scale_cuda.cu(1124) : error : a template argument may not reference a non-external entity

    &#xA;

    libavfilter/vf_scale_cuda.cu(1124) : error : a template argument may not reference a non-external entity

    &#xA;

    Error limit reached.&#xA;100 errors detected in the compilation of >"/tmp/tmpxft_000032a1_00000000-7_vf_scale_cuda.cpp1.ii".&#xA;Compilation terminated.&#xA;ffbuild/common.mak:108 : recipe for target >'libavfilter/vf_scale_cuda.ptx' failed&#xA;make : *** [libavfilter/vf_scale_cuda.ptx] Error 4&#xA;make : *** Waiting for unfinished jobs....

    &#xA;

    &#xA;

    I don't know where is the problem.

    &#xA;

    lines that error referenced :

    &#xA;

    EAREST_KERNELS(yuv420p)&#xA;NEAREST_KERNELS(nv12)&#xA;NEAREST_KERNELS(yuv444p)&#xA;NEAREST_KERNELS(p010le)&#xA;NEAREST_KERNELS(p016le)&#xA;NEAREST_KERNELS(yuv444p16le)&#xA;

    &#xA;