Recherche avancée

Médias (91)

Autres articles (16)

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

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 is the first MediaSPIP stable release.
    Its official release date is June 21, 2013 and is announced here.
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

Sur d’autres sites (5557)

  • avutil : add ROI (Region Of Interest) data struct and bump version

    10 janvier 2019, par Guo, Yejun
    avutil : add ROI (Region Of Interest) data struct and bump version
    

    The encoders such as libx264 support different QPs offset for different MBs,
    it makes possible for ROI-based encoding. It makes sense to add support
    within ffmpeg to generate/accept ROI infos and pass into encoders.

    Typical usage : After AVFrame is decoded, a ffmpeg filter or user's code
    generates ROI info for that frame, and the encoder finally does the
    ROI-based encoding.

    The ROI info is maintained as side data of AVFrame.

    Signed-off-by : Guo, Yejun <yejun.guo@intel.com>
    Signed-off-by : Derek Buitenhuis <derek.buitenhuis@gmail.com>

    • [DH] doc/APIchanges
    • [DH] libavutil/frame.c
    • [DH] libavutil/frame.h
    • [DH] libavutil/version.h
  • moviepy black border around png when compositing into an MP4

    27 août 2022, par OneWorld

    compositing a png into an MP4 video creates a black border around the edge.

    &#xA;

    This is using moviepy 1.0.0

    &#xA;

    Code below reproduces the MP4 with the attached red text png.

    &#xA;

    enter image description here

    &#xA;

    import numpy as np&#xA;import moviepy.editor as mped&#xA;def composite_txtpng_on_colour():&#xA;    bg_color = mped.ColorClip(size=[400, 300], color=np.array([0, 255, 0]).astype(np.uint8),&#xA;                          duration=2).set_position((0, 0))&#xA;    text_png_postition = [5, 5]&#xA;    text_png = mped.ImageClip("./txtpng.png", duration=3).set_position((text_png_postition))&#xA;&#xA;    canvas_size = bg_color.size&#xA;    stacked_clips = mped.CompositeVideoClip([bg_color, text_png], size=canvas_size).set_duration(2)&#xA;    stacked_clips.write_videofile(&#x27;text_with_black_border_video.mp4&#x27;, fps=24)&#xA;&#xA;composite_txtpng_on_colour()&#xA;

    &#xA;

    The result is an MP4 that can be played in VLC player. A screenshot of the black edge can be seen below :-

    &#xA;

    enter image description here

    &#xA;

    Any suggestions to remove the black borders would be much appreciated.

    &#xA;

    Update : It looks like moviepy does a blit instead of alpha compositing.

    &#xA;

    def blit(im1, im2, pos=None, mask=None, ismask=False):&#xA;    """ Blit an image over another.  Blits ``im1`` on ``im2`` as position ``pos=(x,y)``, using the&#xA;    ``mask`` if provided. If ``im1`` and ``im2`` are mask pictures&#xA;    (2D float arrays) then ``ismask`` must be ``True``.&#xA;    """&#xA;    if pos is None:&#xA;        pos = [0, 0]&#xA;&#xA;    # xp1,yp1,xp2,yp2 = blit area on im2&#xA;    # x1,y1,x2,y2 = area of im1 to blit on im2&#xA;    xp, yp = pos&#xA;    x1 = max(0, -xp)&#xA;    y1 = max(0, -yp)&#xA;    h1, w1 = im1.shape[:2]&#xA;    h2, w2 = im2.shape[:2]&#xA;    xp2 = min(w2, xp &#x2B; w1)&#xA;    yp2 = min(h2, yp &#x2B; h1)&#xA;    x2 = min(w1, w2 - xp)&#xA;    y2 = min(h1, h2 - yp)&#xA;    xp1 = max(0, xp)&#xA;    yp1 = max(0, yp)&#xA;&#xA;    if (xp1 >= xp2) or (yp1 >= yp2):&#xA;        return im2&#xA;&#xA;    blitted = im1[y1:y2, x1:x2]&#xA;&#xA;    new_im2 = &#x2B;im2&#xA;&#xA;    if mask is None:&#xA;        new_im2[yp1:yp2, xp1:xp2] = blitted&#xA;    else:&#xA;        mask = mask[y1:y2, x1:x2]&#xA;        if len(im1.shape) == 3:&#xA;            mask = np.dstack(3 * [mask])&#xA;        blit_region = new_im2[yp1:yp2, xp1:xp2]&#xA;        new_im2[yp1:yp2, xp1:xp2] = (1.0 * mask * blitted &#x2B; (1.0 - mask) * blit_region)&#xA;    &#xA;    return new_im2.astype(&#x27;uint8&#x27;) if (not ismask) else new_im2&#xA;

    &#xA;

    and so, Rotem is right.

    &#xA;

    new_im2[yp1:yp2, xp1:xp2] = (1.0 * mask * blitted &#x2B; (1.0 - mask) * blit_region)&#xA;

    &#xA;

    is

    &#xA;

    (alpha * img_rgb &#x2B; (1.0 - alpha) * bg)&#xA;

    &#xA;

    and this is how moviepy composites. And this is why we see black at the edges.

    &#xA;

  • In FFmpeg, using -filter_complex, how can I overlay and blend at the same time ?

    20 avril 2023, par Kristian Boruff

    My code works to combine three videos, resize the videos to 1920X1080, resize the watermark to the correct size, and then overlays the watermark to the lower left hand side. Then converts to the intended codecs for Youtube.&#xA;My question is how do I Blend at the same time using the -filter_complex workflow ?&#xA;Currently, I have the following workflow that does everything but set the opacity

    &#xA;&#xA;

    ffmpeg -y -i fancy movie.mov -i logo.png -i in.mov -i out.mov -c:v libx264 -crf 18 -b:v 50000k -preset veryfast -tune film -profile:v high -x264opts cabac=1:keyint=16:bframes=2:keyint_min=15 -c:a libvo_aacenc -ab 128K -ar 48000 -filter_complex "[0:0] scale=1920X1080 [main]; [2:0] scale=1920X1080 [start]; [3:0] scale=1920X1080 [end]; [start] [2:1] [main] [0:1] [end] [3:1] concat=n=3:v=1:a=1 [prog]; [1:0] scale=480:90 [wm]; [prog] [wm] overlay=36:main_h-overlay_h-45" fart.mp4&#xA;

    &#xA;&#xA;

    I'm trying to add "blend=all_opacity=0.7" in the last step so the watermark will screen against the background. If I just add

    &#xA;&#xA;

    [prog] [wm] overlay=36:main_h-overlay_h-45, blend=all_mode=&#x27;overlay&#x27;:all_opacity=0.7" fart.mp4&#xA;

    &#xA;&#xA;

    I get the error, Cannot find a matching stream for unlabeled input pad 1 on filter Parsed_blend_6

    &#xA;&#xA;

    If I try a semicolon instead,

    &#xA;&#xA;

    [prog] [wm] overlay=36:main_h-overlay_h-45; blend=all_mode=&#x27;overlay&#x27;:all_opacity=0.7&#xA;

    &#xA;&#xA;

    I get the error, Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_blend_6 which makes me think that it's expecting something like [input 1] [input 2] blend command [output]. The problem is that I need it to overlay and blend.

    &#xA;&#xA;

    I tried simplifying the code to just test if the blend operation was working properly.

    &#xA;&#xA;

    ffmpeg -i test.mp4 -i logo.png -filter_complex "[0:0] scale=1920x1080 [wm]; [1:0] scale=1920x1080 [prog], [wm][prog] blend=all_mode=&#x27;overlay&#x27;:all_opacity=0.7" fart.mp4&#xA;

    &#xA;&#xA;

    I got the error First input link top parameters (size 1920x1080, SAR 1:1) do not match the corresponding second input link bottom parameters (1920x1080, SAR 243:80)&#xA;Failed to configure output pad on Parsed_blend_2

    &#xA;&#xA;

    So, in addition to the trouble with combining of filters, I'm also having an issue with resizing the watermark as FFMpeg sees it as a different aspect ratio than the other videos.

    &#xA;&#xA;

    This is my second day with FFmpeg, so any help would be appreciated.

    &#xA;&#xA;

    I'm currently working with FFMpeg version N-61061-gf34cceb

    &#xA;