Recherche avancée

Médias (91)

Autres articles (51)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (7927)

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

  • 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 ?

    


  • 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 ?