Recherche avancée

Médias (1)

Mot : - Tags -/publicité

Autres articles (73)

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

  • Déploiements possibles

    31 janvier 2010, par

    Deux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
    L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
    Version mono serveur
    La version mono serveur consiste à n’utiliser qu’une (...)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

Sur d’autres sites (11800)

  • Where is moviepy getting the video fps from ?

    7 février 2017, par Gloin

    I am using the Python 3 moviepy module for video editing, and I have a few videos that are taken in slow motion. When imported into moviepy, they are massively sped up, and then sit on the last frame for the rest of their duration. Note that, the videos are supposed to be normal for the first couple and last couple of seconds, then slow in the middle.

    Unfortunately, I cannot provide the actual video for you to test with, but here is the relevant metadata (fetched with the command ffprobe -v quiet -print_format json -show_format -show_streams slo-mo_movie.mov)

    "r_frame_rate": "240/1",                              
    "avg_frame_rate": "1679400/39481",
    "time_base": "1/2400",

    For comparison, here is the equivalent metadata from a video taken, I think, from the same phone, but without slo-mo :

    "r_frame_rate": "30/1",
    "avg_frame_rate": "143160/4771",
    "time_base": "1/600",

    I can import the videos in to moviepy with clip = VideoFileClip("path/to/file.mp4"), and then for each run print(clip.fps). The first video prints 2400 (not a typo from me !), and the second 30.

    Here is the moviepy code (in moviepy/video/io/ffmpeg_reader.py) at line 293) that gets the fps :

    # Get the frame rate. Sometimes it's 'tbr', sometimes 'fps', sometimes
    # tbc, and sometimes tbc/2...
    # Current policy: Trust tbr first, then fps. If result is near from x*1000/1001
    # where x is 23,24,25,50, replace by x*1000/1001 (very common case for the fps).

    try:
       match = re.search("( [0-9]*.| )[0-9]* tbr", line)
       tbr = float(line[match.start():match.end()].split(' ')[1])
       result['video_fps'] = tbr

    except:
       match = re.search("( [0-9]*.| )[0-9]* fps", line)
       result['video_fps'] = float(line[match.start():match.end()].split(' ')[1])


    # It is known that a fps of 24 is often written as 24000/1001
    # but then ffmpeg nicely rounds it to 23.98, which we hate.
    coef = 1000.0/1001.0
    fps = result['video_fps']
    for x in [23,24,25,30,50]:
       if (fps!=x) and abs(fps - x*coef) < .01:
           result['video_fps'] = x*coef

    if check_duration:
       result['video_nframes'] = int(result['duration']*result['video_fps'])+1
       result['video_duration'] = result['duration']
    else:
       result['video_nframes'] = 1
       result['video_duration'] = None
    # We could have also recomputed the duration from the number
    # of frames, as follows:
    # >>> result['video_duration'] = result['video_nframes'] / result['video_fps']

    If I set the slo-mo video’s fps using moviepy to 24, it outputs it the same (very fast, then still on the last frame), but if I set the slo-mo video’s fps to 20, then it outputs it correctly.

    Obviously video players like VLC player and Quicktime can correctly work out what frame speed to play, but moviepy/ffmpeg fails. Moviepy/ffmpeg is getting the wrong fps from somewhere.

    So, how can I get moviepy to automatically output them as they are supposed to be without human trial and error like above ?

  • c Can you use variables from other files without using include ?

    2 juin 2021, par aszswaz

    I am reading the code of the ffmpeg project.In the fftools/ffmpeg.c file of this project, there is a piece of code on line 519 :

    


    519         if (do_benchmark) {
520             int maxrss = getmaxrss() / 1024;
521             av_log(NULL, AV_LOG_INFO, "bench: maxrss=%ikB\n", maxrss);
522         }


    


    I use gdb to find the definition location of the do_benchmark variable :

    


    (gdb) info variables do_benchmark
All variables matching regular expression "do_benchmark":

File fftools/ffmpeg_opt.c:
159:    int do_benchmark;
160:    int do_benchmark_all;


    


    However, I cannot find a statement like include fftools/ffmpeg_opt.c in the fftools/ffmpeg.c file.I use find + grep to no avail.

    


    $ find . -type f | xargs grep 'ffmpeg_opt'
grep: ./.git/objects/pack/pack-c2a6a6b1765b632f6fa88814ec92d3b0e4c11dad.pack:Match to binary file
grep: ./.git/index:Match to binary file
grep: ./ffmpeg:Match to binary file
./fftools/ffmpeg_opt.d:fftools/ffmpeg_opt.o: fftools/ffmpeg_opt.c fftools/ffmpeg.h config.h \
grep: ./fftools/ffmpeg_opt.o:Match to binary file
./fftools/Makefile:OBJS-ffmpeg                        += fftools/ffmpeg_opt.o fftools/ffmpeg_filter.o fftools/ffmpeg_hw.o
grep: ./ffmpeg_g:Match to binary file


    


    I wanted to try a similar approach, but failed.

    


    demo-01.c

    


    #include "stdio.h"

int main(void){
    fptintf(stdout, "demo: %d", demo);
    return 0;
}


    


    demo-02.c

    


    int demo = 0;


    


    $ gcc demo-01.c demo-02.c -o demo
demo-01.c: In the function ‘main’:
demo-01.c:4:33: Error: ‘demo’ is not declared (first use in this function)
    4 |     fprintf(stdout, "demo: %d", demo);
      |                                 ^~~~
demo-01.c:4:33: Note: Each undeclared identifier is only reported once in the function in which it appears.


    


    why is that ?

    


  • FFMPEG Conversion Options [migrated]

    7 mars 2013, par Mike

    So, I've got some video files I want to convert so they match the formatting on another video file. I've got the format data (from ffprobe) for the video I want to match but I'm not sure how to use that to determine the options to convert my other videos. Any help ?

    Here are the settings on the file I want to match from ffprobe :

       Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'clip #19.mov':
         Metadata:
           major_brand     : qt  
           minor_version   : 537199360
           compatible_brands: qt  
           creation_time   : 2013-03-05 22:27:26
         Duration: 00:15:00.00, start: 0.000000, bitrate: 119406 kb/s
           Stream #0:0(eng): Video: prores (apcn / 0x6E637061), yuv422p10le, 1440x1080, 117804 kb/s, SAR 4:3 DAR 16:9, 29.97 fps, 29.97 tbr, 2997 tbn, 2997 tbc
           Metadata:
             creation_time   : 2013-03-05 22:27:26
             handler_name    : Apple Alias Data Handler
             timecode        : 00:00:00;00
           Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 2 channels, s16, 1536 kb/s
           Metadata:
             creation_time   : 2013-03-05 22:27:26
             handler_name    : Apple Alias Data Handler
           Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
           Metadata:
             creation_time   : 2013-03-05 22:27:26
             handler_name    : Apple Alias Data Handler
             timecode        : 00:00:00;00
       Unsupported codec with id 0 for input stream 2

    Any help would be greatly appreciated. Thanks.