Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (104)

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

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Les sons

    15 mai 2013, par

Sur d’autres sites (9556)

  • ffmpeg : thumbnail of frame, preserve aspect ratio, apply background / padding / fill colour

    16 octobre 2014, par Pistos

    I already have found out how to scale the thumbnail to stay within specified bounding dimensions while maintaining aspect ratio. For example, to get the frame shown at 6 seconds into the input.mp4 video file, and scale it to fit into 96x60 (16:10 aspect ratio) :

    ffmpeg -y -i input.mp4 -ss 6 -vframes 1 -vf scale="'if(gt(a,16/10),96,-1)':'if(gt(a,16/10),-1,60)'" output.png

    This is fine, it works.

    Next, I would like to do the same, but if the video’s aspect ratio is not exactly 16:10, then I would like to force the output image to have an aspect ratio of 16:10 by taking the above transformation, and filling or padding the space with white. That is, I want the output to be as if I took, say, a 96x48 image, and laid it over a 96x60 white background, resulting in white bars above and below the 96x48 image.

    Ideally, I do not want to resort to using another tool or library, such as ImageMagick. It would be best if ffmpeg could do this on its own.

  • Setting dpi flag in image files generated using ffmpeg

    17 mars 2023, par jim_e_jib

    We're using ffmpeg to batch out some TIFF images that are being resized and having white borders created to fit specific paper sizes.

    


    The resulting images default to 72dpi, even when the source is 300dpi. Is there a way to set the dpi flag in the output file ?

    


    Many thanks :-)

    


    The command we're using :

    


    for %%a in ("*.tif") do ffmpeg -i "%%a" -vf "scale=6974:4919:force_original_aspect_ratio=decrease,pad=7016:4961:(ow-iw)/2:(oh-ih)/2:color=white, format=rgb24" "%%~na A2 poster 594x420mm-Border.tif"


    


    We have tried using -dpi 300 in the code but get the error that this is not a recognised.

    


    Edit :

    


    I have just managed to answer my own question :

    


    for %%a in ("*.tif") do ffmpeg -i "%%a" -vf "scale=6974:4919:force_original_aspect_ratio=decrease,pad=7016:4961:(ow-iw)/2:(oh-ih)/2:color=white,format=rgb24" -dpi 300 "%%~na A2 poster 594x420mm-Border.tif"


    


    I had been placing the -dpi 300 in the wrong place when I'd tried it...

    


  • why transparent drawbox does not work on some video sources ?

    28 mai 2019, par Wang

    It works on smptebars, smptehdbars, testsrc and testsrc2 but not other sources.

    ffplay -loglevel trace -f lavfi -i testsrc=r=1:d=1:size=800x600 -vf "drawbox=x=0:y=0:w='iw/2':h='ih/2':t=max:c=white@0.5"

    When I try this I can see the transparent box. But if I use color, and rgbtestsrc sources it does not work.

    ffplay -loglevel trace -f lavfi -i rgbtestsrc=r=1:d=1:size=800x600 -vf "drawbox=x=0:y=0:w='iw/2':h='ih/2':t=max:c=white@0.5"
    ffplay -loglevel trace -f lavfi -i color=c=red:r=1:d=1:size=800x600 -vf "drawbox=x=0:y=0:w='iw/2':h='ih/2':t=max:c=white@0.5"

    after looking at the trace output, it seems the transparency only works on rgb24 and yuv formats (yuv444p, yuv420p, etc.), this is surprising since we normally assume the rgba source can work with alpha channel.

    The following command change the pix_fmt to rgb24, then it works :

    ffplay -loglevel trace -f lavfi -i rgbtestsrc=r=1:d=1:size=800x600 -vf "format=pix_fmts=rgb24,drawbox=x=0:y=0:w='iw/2':h='ih/2':t=max:c=white@0.5"

    The following command change the pix_fmt to rgba, then it does not work :

    ffplay -loglevel trace -f lavfi -i rgbtestsrc=r=1:d=1:size=800x600 -vf "format=pix_fmts=rgba,drawbox=x=0:y=0:w='iw/2':h='ih/2':t=max:c=white@0.5"

    Why is that ? and how can I fix this ?