Recherche avancée

Médias (91)

Autres articles (16)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

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

Sur d’autres sites (3389)

  • split video (avi/h264) on keyframe

    30 novembre 2012, par m.sr

    Hallo.

    I have a big video file. ffmpeg, tcprobe and other tool say, it is an h264-stream in an AVI-container.

    Now i'd like to cut out small chunks form the video.

    1. Problem : The index of the video seam corrupted/destroyed. I kind of fixed this via mplayer -forceidx -saveidx <indexfile> <bigvideofile></bigvideofile></indexfile>. The Problem here is, that I'm now stuck with mplayer/mencoder which can use this index file via -loadidx <indexfile></indexfile>. I have tried correcting the index like described in man aviindex (mplayer -frames 0 -saveidx mpidx broken.avi ; aviindex -i mpidx -o tcindex ; avimerge -x tcindex -i broken.avi -o fixed.avi), but this didn't fix my video - meaning that most tools i've tested couldn't search in the video file.

    2. Problem : I cut out parts of the video via following command : mencoder -loadidx in.idx -ss 8578 -endpos 20 -oac faac -ovc x264 -sws 9 -lavfopts format=mp4 -x264encopts <lotsofopts> -of lavf -vf scale=800:-10,harddup in.avi -o out.mp4</lotsofopts>. Now here the problem is, that some videos are corrupted at the beginning. I think this is because the fact, that i do not necessarily cut at keyframe.

    Questions :

    1. What is the best way to fix the index of an avi "inline" so that every tool can again work as expected with it ?

    2. How can i split at the keyframes ? Is there an mencoder-option for this ?

    3. Are Keyframes coming in a frequency ? How to find out this frequency ? (So with a bit of math it should be possible to calculate the next keyframe and cut there)

    4. Is ther perhaps some completely other way to split this movie ? Doing it by hand is no option, i've to cut out 1000+ chunks ...

    Thanks a lot !

  • Lossless compression of a sequence of similar grayscale images

    25 octobre 2020, par damien200

    I would like to have the best compression ratio of a sequence of similar grayscale images. I note that I need an absolute lossless solution (meaning I should be able to check it with an hash algorithm).

    &#xA;

    What I tried

    &#xA;

    I had the idea to convert my images into a video because there is a chronology between images. The encoding algorithm would compress using the fact that not all the scene change between 2 pictures. So I tried using ffmpeg but I had several problems due to sRGB -> YUV colorspace compression. I didn't understand all the thing but it's seems like a nightmare.

    &#xA;

    Example of code used :

    &#xA;

    ffmpeg -i %04d.png -c:v libx265 -crf 0 video.mp4 #To convert into video&#xA;ffmpeg -i video.mp4 %04d.png #To recover images&#xA;&#xA;

    &#xA;

    My second idea was to do it by hand with imagemagik. So I took the first image as reference and create a new image that is the difference between image1 and image2. Then I tried to add the difference image with the image 1 (trying to recover image 2) but it didn't work. Noticing the size of the recreated picture, it's clear that the image is not the same. I think there was an unwanted compression during the process.

    &#xA;

    Example of code used :

    &#xA;

    composite -compose difference 0001.png 0002.png diff.png #To create the diff image&#xA;composite -compose difference 0001.png diff.png recover.png #To recover image 2&#xA;

    &#xA;

    Do you have any idea about my problem ?&#xA;And why I don't manage to do the perfect recover with iamgemagik ?

    &#xA;

    Thanks ;)

    &#xA;

    Here are 20 samples images : https://cloud.damien.gdn/d/f1a7954a557441989432/

    &#xA;

  • FFmpeg C Api - Reduce fps but maintain video duration

    25 mars 2015, par Justin Bradley

    Using the FFmpeg C API I’m trying to convert an input video into a video that looks like an animated gif - meaning no audio stream and a video stream of 4/fps.

    I have the decode/encode part working. I can drop the audio stream from the output file, but I’m having trouble reducing the fps. I can change the output video stream’s time_base to 4/fps, but it increases the video’s duration - basically playing it in slow mo.

    I think I need to drop the extra frames before I write them to the output container.

    Below is the loop where I read the input frames, and then write them to output container.

    Is this where I’d drop the extra frames ? How do I determine which frames to drop (I,P,B frames) ?

    while(av_read_frame(input_container, &amp;decoded_packet)>=0) {

       if (decoded_packet.stream_index == video_stream_index) {
           len = avcodec_decode_video2(input_stream->codec, decoded_frame, &amp;got_frame, &amp;decoded_packet);
           if(len &lt; 0) {
               exit(1);
           }

           if(got_frame) {
               av_init_packet(&amp;encoded_packet);
               encoded_packet.data =  NULL;
               encoded_packet.size =  0;

               if(avcodec_encode_video2(output_stream->codec, &amp;encoded_packet, decoded_frame, &amp;got_frame) &lt; 0) {
                   exit(1);
               }
               if(got_frame) {
                   if (output_stream->codec->coded_frame->key_frame) {
                       encoded_packet.flags |= AV_PKT_FLAG_KEY;
                   }

                   encoded_packet.stream_index = output_stream->index;
                   encoded_packet.pts = av_rescale_q(current_frame_num, output_stream->codec->time_base, output_stream->time_base);
                   encoded_packet.dts = av_rescale_q(current_frame_num, output_stream->codec->time_base, output_stream->time_base);

                   if(av_interleaved_write_frame(output_container, &amp;encoded_packet) &lt; 0) {
                       exit(1);
                   }
                   else {
                       current_frame_num +=1;
                   }
               }
               frame_count+=1;
               av_free_packet(&amp;encoded_packet);
           }
       }
    }