Recherche avancée

Médias (91)

Autres articles (92)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

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

  • Dépôt de média et thèmes par FTP

    31 mai 2013, par

    L’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
    Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)

Sur d’autres sites (6081)

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

    


    This is using moviepy 1.0.0

    


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

    


    enter image description here

    


    import numpy as np
import moviepy.editor as mped
def composite_txtpng_on_colour():
    bg_color = mped.ColorClip(size=[400, 300], color=np.array([0, 255, 0]).astype(np.uint8),
                          duration=2).set_position((0, 0))
    text_png_postition = [5, 5]
    text_png = mped.ImageClip("./txtpng.png", duration=3).set_position((text_png_postition))

    canvas_size = bg_color.size
    stacked_clips = mped.CompositeVideoClip([bg_color, text_png], size=canvas_size).set_duration(2)
    stacked_clips.write_videofile('text_with_black_border_video.mp4', fps=24)

composite_txtpng_on_colour()


    


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

    


    enter image description here

    


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

    


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

    


    def blit(im1, im2, pos=None, mask=None, ismask=False):
    """ Blit an image over another.  Blits ``im1`` on ``im2`` as position ``pos=(x,y)``, using the
    ``mask`` if provided. If ``im1`` and ``im2`` are mask pictures
    (2D float arrays) then ``ismask`` must be ``True``.
    """
    if pos is None:
        pos = [0, 0]

    # xp1,yp1,xp2,yp2 = blit area on im2
    # x1,y1,x2,y2 = area of im1 to blit on im2
    xp, yp = pos
    x1 = max(0, -xp)
    y1 = max(0, -yp)
    h1, w1 = im1.shape[:2]
    h2, w2 = im2.shape[:2]
    xp2 = min(w2, xp + w1)
    yp2 = min(h2, yp + h1)
    x2 = min(w1, w2 - xp)
    y2 = min(h1, h2 - yp)
    xp1 = max(0, xp)
    yp1 = max(0, yp)

    if (xp1 >= xp2) or (yp1 >= yp2):
        return im2

    blitted = im1[y1:y2, x1:x2]

    new_im2 = +im2

    if mask is None:
        new_im2[yp1:yp2, xp1:xp2] = blitted
    else:
        mask = mask[y1:y2, x1:x2]
        if len(im1.shape) == 3:
            mask = np.dstack(3 * [mask])
        blit_region = new_im2[yp1:yp2, xp1:xp2]
        new_im2[yp1:yp2, xp1:xp2] = (1.0 * mask * blitted + (1.0 - mask) * blit_region)
    
    return new_im2.astype('uint8') if (not ismask) else new_im2


    


    and so, Rotem is right.

    


    new_im2[yp1:yp2, xp1:xp2] = (1.0 * mask * blitted + (1.0 - mask) * blit_region)


    


    is

    


    (alpha * img_rgb + (1.0 - alpha) * bg)


    


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

    


  • Mp3 file not showing in any media player after creating through ffmpeg

    4 mai 2019, par Aashit Shah

    Mp3 file not showing in any application after the mp3 file is saved . After 15 odd minutes it is automatically shown . if i manually change the name from file manager it will be instantly shown . How to solve this problem .

    Uri uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
               String[] projection = {
                       MediaStore.Audio.Media.TITLE,
                       MediaStore.Audio.Media.DATA,
                       MediaStore.Audio.Media.DISPLAY_NAME,
                       MediaStore.Audio.Media.DURATION,
                       MediaStore.Audio.Media.ALBUM_ID
               };
               String sortOrder =  MediaStore.Audio.Media.DISPLAY_NAME
               Cursor c = getContentResolver().query(uri,projection,null,null,sortOrder);
               if(c.moveToFirst())
               {
                   do {
                       String title = c.getString(c.getColumnIndex(MediaStore.Audio.Media.TITLE));
                       String data = c.getString(c.getColumnIndex(MediaStore.Audio.Media.DATA));
                       String name = c.getString(c.getColumnIndex(MediaStore.Audio.Media.DISPLAY_NAME));
                       String duration = c.getString(c.getColumnIndex(MediaStore.Audio.Media.DURATION));
                       String albumid= c.getString(c.getColumnIndex(MediaStore.Audio.Media.ALBUM_ID));
                       Songs song = new Songs(title,data,name,duration,albumid);
                       songs.add(song);
                       title1.add(name);
                   }while (c.moveToNext());
               }

    Output file path :

    Environment.getExternalStorageDirectory()+ "/Trim"+".mp3";

    This is my command :

    "-y","-ss", start,"-i", input_path,"-t", end,"-metadata","title=Trim","-acodec", "copy","-preset", "ultrafast",output_path
  • FFmpeg / Avconv video playback problems - black or green tint

    21 octobre 2014, par scottpaterson

    I am using FFmpeg / Avconv to convert a raw video file to a MP4 or AVI. Both FFmpeg and Avconv have the same problem.

    • The output video, both MP4 or AVI, play 100% percent perfect on Linux Mint in the default video player.

    • On Windows in WMP the MP4 plays, but the video is black, and the AVI plays and shows video but it has a green tint. On Windows in Quicktime both formats video is black.

    Here is the command I am using :

    avconv -i /home/scott/Desktop/out.wav -f rawvideo -pix_fmt rgb32 -s:v 540x240 -i
    /home/scott/Desktop/out.raw -c:v libx264 -strict -2 -preset ultrafast -b:v 160k  
    /home/scott/Dropbox/code/out.avi
    • I have spent a lot of time messing with the -pix_fmt and trying different pixel format, so far rgb32 returns the best results.

    • I have also tried -sws_flags options such as lanczos+accurate_rnd - but this did not help.

    How can I get this to play the same in all video players ?

    Thanks !