Recherche avancée

Médias (91)

Autres articles (61)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

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

Sur d’autres sites (9816)

  • lavf/matroskaenc : use mkv_check_tag_name consistently

    6 septembre 2016, par Rodger Combs
    lavf/matroskaenc : use mkv_check_tag_name consistently
    

    Previously, we used a different list of checks when deciding whether to
    write a set of tags at all than we did when deciding whether to write an
    individual tag in the set. This resulted in sometimes writing an empty
    tag master and seekhead. Now we use mkv_check_tag_name everywhere, so
    if a dictionary is entirely composed of tags we skip, we don’t write a
    tag master at all.

    This affected the test file, since "language" was on one list but not
    the other, so we were writing an empty tag master there. The test hash
    is updated to reflect that change.

    • [DH] libavformat/matroskaenc.c
    • [DH] tests/fate/matroska.mak
  • How to create an animated GIF using FFMPEG with an interval ?

    26 octobre 2014, par Jeff Wilbert

    Hello fellow overflowers,

    A brief overview of what I’m trying to accomplish ; I have a site that will accept video uploads, uploads get converted into the mp4 format to be uniformed and playable on the web using one of the many available players. That part is all fine and dandy.

    The problem now is I want to show the user a short scaled preview (animated gif) of the video before they click to play it. The code I’m working with now is

    ffmpeg -i test.mp4 -vf scale=150:-1 -t 10 -r 1 test.gif

    Which works for creating a scaled animated gif with a fixed width of 150px at a rate of 1 frame per second but its only an animation of the first 10 seconds of the video. I’m trying to do something that spreads out the frame gap to cover the whole video length but create an animated gift that’s no more then 10 seconds long.

    For example say I have a video that’s 30 seconds I want the gif to be 10 seconds long but cover frames of the entire 30 seconds so it might start at frame 3 or 3 seconds in and create a frame in the gif, then at 6 seconds in the video create another frame, then 9 seconds in another, and so forth where the final outcome is

       example video 30 seconds long          example video 1 minute 45 second long

    video position - gif frame/per second      video position - gif frame/per second
         00:03:00   1                               00:10:50   1
         00:06:00   2                               00:21:00   2
         00:09:00   3                               00:31:50   3
         00:12:00   4                               00:42:00   4
         00:15:00   5                               00:52:50   5
         00:18:00   6                               01:03:00   6
         00:21:00   7                               01:13:50   7
         00:24:00   8                               01:24:00   8
         00:27:00   9                               01:34:50   9
         00:30:00   10                              01:45:00   10

     3 second interval between frames         10.5 second interval between frames

    Where you end up with an animated gif that’s 10 seconds long showing a preview of the entire video no matter the length of it. Which basically just boils down to
    video length / 10 (length of desired animated gif) = interval to use between frames but I don’t know how I can use that data to accomplish my problem...

    So does anyone have an idea or suggestion on how this can be accomplished with relative ease ? I can probably do it by calculating the length through code and running a command to extract each individual frame from the video that’s needed then generate a gif from the images but I’d like to be able to do it all with just one command. Thanks.

  • Cross Fade Arbitrary Number of Videos ffmpeg Efficiently

    15 avril 2022, par jippyjoe4

    I have a series of videos named 'cut_xxx.mp4' where xxx represents a number 000 through 999. I want to do a cross fade on an arbitrary number of them to create a compilation, and each fade should last 4 seconds long. Currently, I'm doing this with Python, but I suspect this is not the most efficient way :

    


    import subprocess    
def get_length(filename):
  result = subprocess.run(["ffprobe", "-v", "error", "-show_entries",
                          "format=duration", "-of",
                          "default=noprint_wrappers=1:nokey=1", filename],
    stdout=subprocess.PIPE,
    stderr=subprocess.STDOUT)
  return float(result.stdout)

CROSS_FADE_DURATION = 4

basevideo = 'cut_000.mp4'
for ii in range(total_videos - 1):
  fade_start = math.floor(get_length(basevideo) - CROSS_FADE_DURATION) # new one
  outfile = f'cross_fade_{ii}.mp4'
  append_video = f'cut_{str(ii+1).zfill(3)}.mp4'
  cfcmd = f'ffmpeg -y -i {basevideo} -i {append_video} -filter_complex "xfade=offset={fade_start}:duration={CROSS_FADE_DURATION}" -an {outfile}'
  basevideo = outfile
  subprocess.call(cfcmd)
  print(fade_start)


    


    I specifically remove the audio with -an because I'll add an audio track later. The issue I see here is that I'm compressing the video over and over again with each individual video file I add to the compilation because I'm only adding one video at a time and then re-encoding.

    


    There should be a way to cross fade multiple videos together into a compilation, but I'm not sure what this would look like or how I would get it to work for an arbitrary number of video files of different durations. Any idea on what that monolithic ffmppeg command would look like or how I could automatically generate it given a list of videos and their durations ?