Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (82)

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

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

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

Sur d’autres sites (5319)

  • Simultaneous fragmentation and video encoding FFMPEG

    20 mai 2020, par Искандер

    Good day !
I encrypted and fragmented .mp4 video file, but after encryption, I can't decode it back. Could you tell me please what I'm doing wrong ?
Command, which I use to encrypt :

    



    ffmpeg -i C:\ffmpeg-3.2.2-win64-static\111.mp4 -vcodec copy -acodec copy -encryption_scheme cenc-aes-ctr -encryption_key 76a6c65c5ea762046bd749a2e632ccbb -encryption_kid a7e61c373e219033c21091fa607bf3b8 -g 52 -f mp4 -movflags frag_keyframe+empty_moov C:\ffmpeg-3.2.2-win64-static\result.mp4


    



    Command, which I use to decode :

    



    ffmpeg -decryption_key 76a6c65c5ea762046bd749a2e632ccbb -i C:\ffmpeg-3.2.2-win64-static\resultfragm.mp4 -max_muxing_queue_size 9999 C:\ffmpeg-3.2.2-win64-static\resultlast.mp4


    



    Result :

    



    Result image

    


  • FFmpeg SwrContext incorrectly converting leftover data after seek

    27 avril 2017, par trigger_death

    I currently have my own custom SFML SoundFileReader that uses FFmpeg for more file formats. It works great for the most part until you seek and then you get leftover data from the previous location when using swr_convert. I currently have a hackish (I think) solution to the problem where I call swr_init after seeking to remove whatever data is leftover in there. I assumed that swr_convert’s documentation on flushing would be the solution to the issue yet either it doesn’t help or I’m not doing it correctly. Is there a proper way to clear the leftover data in the SwrContext after seeking ?

    void seekBeginning() {
       av_seek_frame(
           m_formatContext, m_audioStream,
           m_formatContext->streams[m_audioStream]->first_dts,
           AVSEEK_FLAG_BACKWARD | AVSEEK_FLAG_ANY
       );
       avcodec_flush_buffers(m_codecContext);

       // This fixes the issue but it seems like a horribly incorrect way of doing it
       swr_init(m_convertContext);

       // I've tried this but it doesn't seem to work
       //swr_convert(m_convertContext, NULL, 0, NULL, 0);
    }

    Uint64 read(Int16* samples, Uint64 maxCount) {
       Uint64 count = 0;
       while (count < maxCount) {
           if (m_packet->stream_index == m_audioStream) {
               while (m_packet->size > 0) {
                   int gotFrame = 0;
                   int result = avcodec_decode_audio4(m_codecContext, m_frame, &gotFrame, m_packet);
                   if (result >= 0 && gotFrame) {
                       int samplesToRead = static_cast<int>(maxCount - count) / m_codecContext->channels;
                       if (samplesToRead > m_frame->nb_samples)
                           samplesToRead = m_frame->nb_samples;
                       m_packet->size -= result;
                       m_packet->data += result;
                       result = swr_convert(m_convertContext, (uint8_t**)&amp;samples, samplesToRead, (const uint8_t**)m_frame->data, m_frame->nb_samples);

                       if (result > 0) {
                           count += result * m_codecContext->channels;
                           samples += result * m_codecContext->channels;
                       }
                       else {
                           m_packet->size = 0;
                           m_packet->data = NULL;
                       }
                   }
                   else {
                       m_packet->size = 0;
                       m_packet->data = NULL;
                   }
               }
           }
           av_free_packet(m_packet);
       }

       return count;
    }
    </int>
  • Concatenating chunks of videos with different formats using FFmpeg

    12 avril 2014, par SCC

    I was exploring the functionalities of FFmpeg recently. I have two different videos with different formats (e.g. mov and mp4). I will first split these videos up into smaller chunks, and concatenate them back with a mix of chunks from these two videos. However the concatenated video wasn't able to show properly. I did some research and found that mp4 cannot be concatenated using the normal concatenation method since it contains extra headers and information. Therefore I first converted all the videos into mpg, split them up, concatenate an convert back to mp4. However, still no luck on that.

    Below are the commands I used :

    // convert input (1st video) to mpg
    ffmpeg -i input.mp4 input.mpg

    // convert to keyframe video
    ffmpeg -i input.mpg -strict -2 -g 20 keyframe_input.mpg

    // split keyframe_input into smaller chunks
    ffmpeg -i keyframe_input.mpg -acodec copy -f segment -segment_time 0.3 -segment_list  s.m3u8 -vcodec copy -reset_timestamps 1 -map 0 split_input-%d.mpg

    // convert input2 (2nd video) to mpg
    ffmpeg -i input2.mov input2.mpg

    // convert to keyframe video
    ffmpeg -i input2.mpg -strict -2 -g 20 keyframe_input2.mpg

    // split keyframe_input2 into smaller chunks
    ffmpeg -i keyframe_input2.mpg -acodec copy -f segment -segment_time 0.3 -segment_list  s.m3u8 -vcodec copy -reset_timestamps 1 -map 0 split_input2-%d.mpg

    // concatenate video according to the video files written in mylist.txt
    ffmpeg -f concat -i mylist.txt -c copy output.mpg

    When I tried to concatenate these chunks of videos, errors were thrown out saying buffer underflow, packet size too large.

    These are parts of the errors I had. I am not really sure about which errors refer to which video (either input.mp4 or input2.mov), but this is what I had :

    [mpeg @ 0x7f972406ca00] Non-monotonous DTS in output stream 0:0; previous: 2953328, current: 2541459; changing to 2953329. This may result in incorrect timestamps in the output file.
    [mpeg @ 0x7f972406ca00] Non-monotonous DTS in output stream 0:0; previous: 2953329, current: 2545059; changing to 2953330. This may result in incorrect timestamps in the output file.
    [mpeg @ 0x7f972406ca00] Non-monotonous DTS in output stream 0:0; previous: 2953330, current: 2548659; changing to 2953331. This may result in incorrect timestamps in the output file.
    [mpeg @ 0x7f972406ca00] Non-monotonous DTS in output stream 0:0; previous: 2953331, current: 2552259; changing to 2953332. This may result in incorrect timestamps in the output file.


    [mpeg @ 0x7f972406ca00] buffer underflow st=0 bufi=7973 size=8360
    [mpeg @ 0x7f972406ca00] buffer underflow st=0 bufi=923 size=954
    [mpeg @ 0x7f972406ca00] buffer underflow st=0 bufi=2538 size=7686
    [mpeg @ 0x7f972406ca00] buffer underflow st=0 bufi=4579 size=7686
    [mpeg @ 0x7f972406ca00] buffer underflow st=0 bufi=6620 size=7686
    [mpeg @ 0x7f972406ca00] buffer underflow st=0 bufi=339 size=511
    [mpeg @ 0x7f972406ca00] buffer underflow st=0 bufi=721 size=2766
    [mpeg @ 0x7f972406ca00] buffer underflow st=0 bufi=2762 size=2766
    [mpeg @ 0x7f972406ca00] buffer underflow st=0 bufi=988 size=1814

    Does any experts know why this happens ?