Recherche avancée

Médias (91)

Autres articles (93)

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

  • Les notifications de la ferme

    1er décembre 2010, par

    Afin d’assurer une gestion correcte de la ferme, il est nécessaire de notifier plusieurs choses lors d’actions spécifiques à la fois à l’utilisateur mais également à l’ensemble des administrateurs de la ferme.
    Les notifications de changement de statut
    Lors d’un changement de statut d’une instance, l’ensemble des administrateurs de la ferme doivent être notifiés de cette modification ainsi que l’utilisateur administrateur de l’instance.
    À la demande d’un canal
    Passage au statut "publie"
    Passage au (...)

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

Sur d’autres sites (7652)

  • FFmpeg can't process videos with filenames containing emojis on Google Colab

    25 novembre 2022, par athena

    I mounted my Google Drive on Google Colab, inside the Drive, there's a video file with an emoji on it's filename (example : 20221124 [우리의식탁 W TABLE] 직접 기른 허브로 만들면 더 맛있는 허브포카치아 🌿 (8m2hNIEoXEw).mkv).

    


    !ffmpeg -i "/content/drive/MyDrive/DOWNLOAD/20221124 [우리의식탁 W TABLE] 직접 기른 허브로 만들면 더 맛있는 허브포카치아 🌿 (8m2hNIEoXEw).mkv"


    


    Trying to run FFmpeg gives me this error :

    


    ---------------------------------------------------------------------------&#xA;UnicodeEncodeError                        Traceback (most recent call last)&#xA; in <module>&#xA;      3 video = "/content/drive/MyDrive/DOWNLOAD/20221124 [\u110B\u116E\u1105\u1175\u110B\u1174\u1109\u1175\u11A8\u1110\u1161\u11A8 W TABLE] \u110C\u1175\u11A8\u110C\u1165\u11B8 \u1100\u1175\u1105\u1173\u11AB \u1112\u1165\u1107\u1173\u1105\u1169 \u1106\u1161\u11AB\u1103\u1173\u11AF\u1106\u1167\u11AB \u1103\u1165 \u1106\u1161\u11BA\u110B\u1175\u11BB\u1102\u1173\u11AB \u1112\u1165\u1107\u1173\u1111\u1169\u110F\u1161\u110E\u1175\u110B\u1161 \uD83C\uDF3F (8m2hNIEoXEw).mkv" #@param {type: "string"}&#xA;      4 &#xA;----> 5 get_ipython().system(&#x27;ffmpeg -i "$video" #-hide_banner&#x27;)&#xA;&#xA;4 frames&#xA;/usr/local/lib/python3.7/dist-packages/google/colab/_shell.py in system(self, *args, **kwargs)&#xA;     93       kwargs.update({&#x27;also_return_output&#x27;: True})&#xA;     94 &#xA;---> 95     output = _system_commands._system_compat(self, *args, **kwargs)  # pylint:disable=protected-access&#xA;     96 &#xA;     97     if pip_warn:&#xA;&#xA;/usr/local/lib/python3.7/dist-packages/google/colab/_system_commands.py in _system_compat(shell, cmd, also_return_output)&#xA;    435   # stack.&#xA;    436   result = _run_command(&#xA;--> 437       shell.var_expand(cmd, depth=2), clear_streamed_output=False)&#xA;    438   shell.user_ns[&#x27;_exit_code&#x27;] = result.returncode&#xA;    439   if -result.returncode in _INTERRUPTED_SIGNALS:&#xA;&#xA;/usr/local/lib/python3.7/dist-packages/google/colab/_system_commands.py in _run_command(cmd, clear_streamed_output)&#xA;    189           stdin=stdin,&#xA;    190           stderr=child_pty,&#xA;--> 191           close_fds=True)&#xA;    192       # The child PTY is only needed by the spawned process.&#xA;    193       os.close(child_pty)&#xA;&#xA;/usr/lib/python3.7/subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)&#xA;    798                                 c2pread, c2pwrite,&#xA;    799                                 errread, errwrite,&#xA;--> 800                                 restore_signals, start_new_session)&#xA;    801         except:&#xA;    802             # Cleanup if the child failed starting.&#xA;&#xA;/usr/lib/python3.7/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)&#xA;   1480                             errread, errwrite,&#xA;   1481                             errpipe_read, errpipe_write,&#xA;-> 1482                             restore_signals, start_new_session, preexec_fn)&#xA;   1483                     self._child_created = True&#xA;   1484                 finally:&#xA;&#xA;UnicodeEncodeError: &#x27;utf-8&#x27; codec can&#x27;t encode characters in position 131-132: surrogates not allowed&#xA;</module>

    &#xA;

    My Colab uses Python 3.7.15 and ffmpeg/ffprobe version N-109226-g2ad199ae31-20221125 (from https://github.com/BtbN/FFmpeg-Builds).

    &#xA;

    I tried searching similar issues as mine here, but most of the solutions are way beyond my knowledge, I'm not sure how to apply them to my use case.

    &#xA;

    I'll appreciate your help, thank you !

    &#xA;

  • mux / remux / box in memory h264 frames to mp4 via C / C++ (no ffmpeg cmdline)

    28 février 2019, par Vans S

    I have looked at various tutorials and I am still struggling to correctly frame raw h264 into an mp4 container. The problem is the stream does not have an end (live) and is in memory, a lot of the examples available of muxers assume the streams are located on disk as files.

    I have tried and looked at
    http://www.ffmpeg.org/doxygen/trunk/doc_2examples_2remuxing_8c-example.html
    https://ffmpeg.org/doxygen/trunk/muxing_8c-source.html
    and countless other examples.

    This is what I have now :

    AVFormatContext *outFmtCtx = NULL;
    AVFormatContext *inFmtCtx = NULL;
    std::vector g_p;

    static int read_packet(void *opaque, uint8_t *pBuf, int nBuf) {
       printf("read_packet %d\n", g_p.size());
       memcpy(pBuf, &amp;g_p[0], g_p.size());
       return g_p.size();
    }

    static int write_packet(void *opaque, uint8_t *buf, int buf_size) {
       printf("write_packet %d %lld\n", buf_size, timestamp_micro());
       return buf_size;
    }

    static int64_t seek_packet(void *opaque, int64_t offset, int whence) {
       printf("seek_packet\n");
       exit(0);
       return 0;
    }

    void create_mp4() {
       av_log_set_level(AV_LOG_DEBUG);

       //alloc memory buffer
       uint8_t *avioc_buffer = NULL;
       int avioc_buffer_size = 8 * 1024 * 1024;
       avioc_buffer = (uint8_t *)av_malloc(avioc_buffer_size);
       if (!avioc_buffer) {
           printf("failed make avio buffer\n");
           exit(1);
       }
       AVIOContext* pIOCtx = avio_alloc_context(avioc_buffer, avioc_buffer_size, 1,
           NULL/*outptr*/, &amp;read_packet, &amp;write_packet, &amp;seek_packet);
       if (!pIOCtx) {
           printf("failed make avio context\n");
           exit(1);
       }

       inFmtCtx = avformat_alloc_context();
       inFmtCtx->pb = pIOCtx;
       inFmtCtx->iformat = av_find_input_format("h264");
       avformat_open_input(&amp;inFmtCtx, "", inFmtCtx->iformat, NULL);

       AVOutputFormat* outFmt = av_guess_format("mp4", NULL, NULL);
       avformat_alloc_output_context2(&amp;outFmtCtx, outFmt, NULL, NULL);

       //set the AIO buffer to the memory one
       outFmtCtx->pb = pIOCtx;
       //outFmtCtx->flags = AVFMT_FLAG_CUSTOM_IO;//pIOCtx;

       AVCodec* codec = avcodec_find_encoder(AV_CODEC_ID_H264);
       AVStream * outStrm = avformat_new_stream(outFmtCtx, codec);

       avcodec_get_context_defaults3(outStrm->codec, codec);
       outStrm->id = 0;
       outStrm->codec->coder_type = AVMEDIA_TYPE_VIDEO;
       outStrm->codec->codec_id = AV_CODEC_ID_H264;
       outStrm->codec->bit_rate = 8000000;
       outStrm->codec->width = 1280;
       outStrm->codec->height = 720;
       outStrm->codec->time_base.den = 60;
       outStrm->codec->time_base.num = 1;
       outStrm->codec->gop_size = 0xffffffff;
       outStrm->codec->pix_fmt = AV_PIX_FMT_NV12;
       outStrm->duration = 0;

       //Allow it to play immediately
       AVDictionary* options = nullptr;
       av_dict_set( &amp;options, "movflags", "empty_moov+default_base_moof+frag_keyframe", 0 );

       avformat_write_header(outFmtCtx, &amp;options);
       printf("mp4 muxer created\n");
    }

    //set the first raw h264 frame from capture
    g_p = raw_h264_frame;
    AVPacket pkt;
    //call av_read_frame (infinite loop here on read_packet)
    int wret = av_read_frame(inFmtCtx, &amp;pkt);

    I get an infinite loop on read_packet after calling av_read_frame, I tried to construct the packets myself by also doing

    AVPacket pkt;
    av_init_packet(&amp;pkt);
    if (nFrame == 0) {
       pkt.flags        |= AV_PKT_FLAG_KEY;
    }
    pkt.stream_index  = 0;
    pkt.data          = &amp;raw_h264_frame[0];
    pkt.size          = raw_h264_frame.size();
    //pkt.dts = AV_NOPTS_VALUE;
    //pkt.pts = AV_NOPTS_VALUE;
    pkt.dts = nFrame;
    pkt.pts = nFrame;

    int ret = av_interleaved_write_frame(outFmtCtx, &amp;pkt);
    if (ret &lt; 0) {
       printf("error av_write_frame\n");
       exit(1);
    }

    But this does not work either. Some help would be greatly appreciated or guidance where to look (perhaps drop libFFMPEG and look elsewhere, etc).

    VLC errors look like :

    mp4 warning: out of bound child    �
    mp4 warning: out of bound child    �
    mp4 warning: no chunk defined
    mp4 warning: STTS table of 0 entries
    mp4 warning: cannot select track[Id 0x1]

    or

    mp4 warning: no chunk defined
    mp4 warning: STTS table of 0 entries
    mp4: Fragment sequence discontinuity detected 1 != 0
    avcodec warning: thread type 1: disabling hardware acceleration
    main warning: picture is too late to be displayed (missing 14 ms)
    main warning: picture is too late to be displayed (missing 14 ms)
    main warning: picture is too late to be displayed (missing 14 ms)
  • Kill an unresolved promise (or ignore and move on)

    17 septembre 2017, par Trees4theForest

    Using node child process exec, I’m calling a ffmpeg conversion via a promise that takes a bit of time. Each time the use clicks "next" it starts the FFMpeg command on a new file :

    function doFFMpeg(path){
     return new Promise((resolve, reject) => {
       exec('ffmpeg (long running command)', (error, stdout, stderr) => {
         if (error) {
           reject();
         }
       }).on('exit', (code) => { // Exit returns code 0 for good 1 bad
         if (code) {
           reject();
         } else {
           resolve();
         }
       });
     });
    }

    The problem is, if the user moves on to the next video before the promise is returned, I need to scrap the process and move on to converting the next video.

    How do I either :

    A) (Ideally) Cancel the current promised exec process*
    B) Let the current promised exec process complete, but just ignore that promise while I start a new one.

    *I realize that promise.cancel is not yet in ECMA, but I’d like to know of a workaround — preferably without using a 3rd party module / library.

    Attempt :

    let myChildProcess;

    function doFFMpeg(path){

     myChildProcess.kill();

     return new Promise((resolve, reject) => {
       myChildProcess = exec('ffmpeg (long running command)', (error, stdout, stderr) => {
         if (error) {
           reject();
         }
       }).on('exit', (code) => { // Exit returns code 0 for good 1 bad
         if (code) {
           reject();
         } else {
           resolve();
         }
       });
     });
    }