Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP 0.2

Autres articles (93)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Configuration spécifique pour PHP5

    4 février 2011, par

    PHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
    Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
    Modules spécifiques
    Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

Sur d’autres sites (9827)

  • Why does ffmpeg return "No such file or directory"

    4 juillet 2020, par JackNewman

    I'm trying to split a video file into 2 second increments and then merge the video back together.

    


    source_vid_path = r"C:\SplitAndMergeVids\Before\before.mp4"
ffcat_path = r'C:\SplitAndMergeVids\Chunk\video.ffcat'
chunks_path = r'C:\SplitAndMergeVids\Chunk\chunk-%03d.mp4'
segments_time = '2'
cmd_input = rf'ffmpeg -fflags +genpts -i {source_vid_path} -map 0 -c copy -f segment -segment_format mp4 -segment_time {segments_time} -segment_list {ffcat_path} -reset_timestamps 1 -v error {chunks_path}'
output = str(subprocess.run(cmd_input, shell=True, capture_output=True))
print(output)

output_path = r'C:\SplitAndMergeVids\Output\output.mp4'
second_input = rf'ffmpeg -y -v error -i {ffcat_path} -map 0 -c copy {output_path}'
output = str(subprocess.run(second_input, shell=True, capture_output=True))
print(output)


    


    First subprocess runs perfectly although the second outputs returns

    


    "Impossible to open 'chunk-000.mp4'\r\nC:\\SplitAndMergeVids\\Chunk\\video.ffcat: No such file or directory".


    


    Full output looks like

    


    CompletedProcess(args='ffmpeg -fflags +genpts -i C:\\SplitAndMergeVids\\Before\\before.mp4 -map 0 -c copy -f segment -segment_format mp4 -segment_time 2 -segment_list C:\\SplitAndMergeVids\\Chunk\\video.ffcat -reset_timestamps 1 -v error C:\\SplitAndMergeVids\\Chunk\\chunk-%03d.mp4', returncode=0, stdout=b'', stderr=b'')
CompletedProcess(args='ffmpeg -y -v error -i C:\\SplitAndMergeVids\\Chunk\\video.ffcat -map 0 -c copy C:\\SplitAndMergeVids\\Output\\output.mp4', returncode=1, stdout=b'', stderr=b"[concat @ 0000028691a6c6c0] Impossible to open 'chunk-000.mp4'\r\nC:\\SplitAndMergeVids\\Chunk\\video.ffcat: No such file or directory\r\n")


    


    When I run cmd_input and second_input manually in cmd, everything functions perfectly. I don't understand how in the first command I am making a file at "ffcat_path", then in the second command I'm using the same "ffcat_path" and it returns "No such file or directory" when it certainly does exist.

    


  • FFmpeg overwrite an AVPacket

    26 janvier 2019, par Alejandro Ramírez

    Hello guys I am working with video. I wan to encrypt the I-frames of one video compressed in H.264. So I get the AVPacket from the video and compare if (AVPacket.flags & AV_PKT_FLAG_KEY) to know if the packet has an I frame, but when I try to print the AVPacket.data I don’t have any information to encrypt.
    Where can I get the information regarding to I-frame. ahead a put my code, thank you.

    #include <iostream>
    extern "C" {
    #include <libavcodec></libavcodec>avcodec.h>
    #include <libavformat></libavformat>avformat.h>
    #include <libswscale></libswscale>swscale.h>
    #include <libavutil></libavutil>avutil.h>
    }
    #define INBUF_SIZE 4096
    //#define AV_INPUT_BUFFER_PADDING_SIZE 32
    int main (int argc, char * argv[])
    {
       //av_register_all();//omit
       //revisar el número de argumentos en el video
       AVFormatContext *pFormatCtx = NULL;
       AVCodec *dec = NULL;
       AVCodecContext *pCodecCtx = NULL;
       AVStream *st = NULL;
       AVDictionary *opts = NULL;
       AVFrame *frame;
       AVPacket avpkt;
       uint8_t inbuf [INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
       FILE *f;
       int frame_count;
       int video_stream_index = -1;

       //av_init_packet (&amp;avpkt);

       memset (inbuf + INBUF_SIZE, 0, AV_INPUT_BUFFER_PADDING_SIZE);
       if (avformat_open_input (&amp;pFormatCtx, argv[1], NULL, NULL) != 0)
           return -1;
       if (avformat_find_stream_info (pFormatCtx, NULL) &lt; 0)
           return -1;
       //video_stream_index = av_find_best_stream (pFormatCtx,AVMEDIA_TYPE_VIDEO, -1, -1, &amp;dec,0);
       video_stream_index = av_find_best_stream (pFormatCtx,AVMEDIA_TYPE_VIDEO, -1, -1, &amp;dec,0);
       if ( video_stream_index &lt; 0)
           return -1;
       std::cout &lt;&lt; "video_stream; " &lt;&lt; video_stream_index &lt;&lt; "\n";
       st = pFormatCtx -> streams [video_stream_index];
       std::cout &lt;&lt; "number of frames " &lt;&lt; st -> nb_frames &lt;&lt; "\n";
       std::cout &lt;&lt; "event_flags " &lt;&lt; st -> event_flags &lt;&lt; "\n";
       //pCodecCtx = st -> codec;//deprecated

       dec = avcodec_find_decoder (st -> codecpar -> codec_id);
       std::cout &lt;&lt; "codec_id: " &lt;&lt; st -> codecpar -> codec_id &lt;&lt; "\n";
       std::cout &lt;&lt; "AV_CODEC_ID_H264: " &lt;&lt; AV_CODEC_ID_H264 &lt;&lt; "\n";
       if (!dec)
           return -1;
       pCodecCtx = avcodec_alloc_context3 (dec);
       if (!pCodecCtx)
           return -1;
       //av_dict_set (&amp;opts, "refcounted_frames", "0", 0);
       avcodec_parameters_to_context (pCodecCtx, st -> codecpar);


       std::cout &lt;&lt; "todo bien \n";    
       if (avcodec_open2 (pCodecCtx, dec, &amp;opts) &lt; 0)
           return -1;
       /*************hasta aqui buen codigo*********************************************/
       frame = av_frame_alloc ();
       if (!frame)
           return -1;
       av_init_packet (&amp;avpkt);
       avpkt.data = NULL;
       avpkt.size = 0;
       f = fopen (argv[1], "r");
       int times = 1;
       while (av_read_frame (pFormatCtx, &amp;avpkt) >= 0){
           AVPacket oripkt = avpkt;
           if (oripkt.stream_index == video_stream_index){
               if (oripkt.flags &amp; AV_PKT_FLAG_KEY){
                   std::cout &lt;&lt; "times: " &lt;&lt; times ++ &lt;&lt; "\n";
                   std::cout &lt;&lt; "avpkt.flags: " &lt;&lt; oripkt.flags &lt;&lt; "\n";
                   std::cout &lt;&lt; "tam avpkt.data: " &lt;&lt; sizeof(oripkt.data) &lt;&lt; "\n";
                   std::cout &lt;&lt; "tam avpkt.data: " &lt;&lt; oripkt.data &lt;&lt; "\n";
                   std::cout &lt;&lt; "oripkt.size: " &lt;&lt; oripkt.size &lt;&lt; "\n";
                   std::cout &lt;&lt; "oripkt.side_date_eme: " &lt;&lt; oripkt.side_data_elems &lt;&lt; "\n";
                   if (!oripkt.data)
                       std::cout &lt;&lt; "no tengo dinero \n";
               }
           }
       }

       std::cout &lt;&lt; "Fin del programa " &lt;&lt; "\n";
    }
    </iostream>
  • Qt Video Recorder

    11 mai 2014, par Davlog

    I am trying to create a video recorder with Qt. What I did so far was taking a screenshot of a rectangle on the screen and save it. At the end I use ffmpeg to get a video file out of the images.

    I connected a timer’s signal timeout() to my custom slot which takes the snapshot and saves it to my tmp folder. The timer has an intervall of 1000 / 30. That should be 30 times per second. But 1000 / 30 is a little bit more than 33 milliseconds so I cannot really get 30 fps. It’s a bit more.

    I recorded a youtube video with my recorder and everything was smooth but a little bit faster / slower depending on the intervall.

    So my question basically is how do I get really 30 / 40 / 50 / ... fps ?