
Recherche avancée
Autres articles (69)
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs
Sur d’autres sites (7838)
-
ffmpeg vaapi - scale a video keeping the aspect ratio and padding with black lines
26 décembre 2022, par Rusty LemurI'm trying to use my Vega 11 GPU to perform hardware accelerated transcoding of some video files to a resolution of 1280x720. I would like to keep the original aspect ratio and add black bars to the borders as necessary. I can get the scaling to work with the following :


ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -vaapi_device /dev/dri/renderD128 -i input.mp4 -codec:v h264_vaapi -vf scale_vaapi=w=1280:h=720,setsar=1:1 output.mp4



But some of the image gets stretched with that, and the original aspect ratio is not preserved.


On the Raspberry Pi I can get the effect I want with the following :


ffmpeg -i input.mp4 -b:v 2M -vf scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:'(ow-iw)/2':'(oh-ih)/2',setsar=1 -vcodec h264_v4l2m2m -num_capture_buffers 128 output.mp4



But when I try to use the force_original_aspect_ratio and pad options with the vaapi codec, I get the following error :


ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -vaapi_device /dev/dri/renderD128 -i input.mp4 -codec:v h264_vaapi -vf scale_vaapi=w=1280:h=720,pad=1280:720:'(ow-iw)/2':'(oh-ih)/2',setsar=1:1 output.mp4

Impossible to convert between the formats supported by the filter 'Parsed_scale_vaapi_0' and the filter 'auto_scaler_0'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:0



Is there another option I should use to get the padding and keep the original aspect ratio ?


-
lavfi/fade : fix black level for non studio-level pixel formats
29 mars 2012, par Stefano Sabatinilavfi/fade : fix black level for non studio-level pixel formats
-
FFmpeg transparent PNG black outline issue
5 février 2024, par kklmarvelmediaI'm encoding a video with a transparent PNG using ffmpeg. I noticed there's a slight black outline surrounding the image. Is there any way to remove it ?



Output image :




Transparent PNG sample :




My ffmpeg command



ffmpeg -hide_banner -y -ss 0.0 -t 8.5 -i C:\Users\Admin\Desktop\test_movies\6.mp4 -i C:\Users\Admin\Desktop\test_movies\text_and_emoji.png -filter_complex [0:v]setpts=PTS-STARTPTS,scale=640:640:force_original_aspect_ratio=decrease,pad=640:640:(ow-iw)/2:(oh-ih)/2:color=#18ffff[0v];[1:v]scale=556.24744:141.41884[1v];[0v][1v]overlay=(W-w)/2-(W/2-325.33328):(H-h)/2-(H/2-567.7075):enable='between(t,0.0,8.5)' -ac 2 -ar 44100 -vcodec libx264 -g 75 -r 20 -preset ultrafast -strict experimental C:\Users\Admin\Desktop\test_movies\test.mp4




Last edit 1 :



I tried using without
[1:v]scale=556.24744:141.41884[1v]
, the output still have the slight outline


Sample output :




Sample code :



ffmpeg -hide_banner -y -ss 0.0 -t 8.5 -i C:\Users\Admin\Desktop\test_movies\white.mp4 -i C:\Users\Admin\Desktop\test_movies\text_and_emoji.png -filter_complex [0:v]scale=640:640:force_original_aspect_ratio=decrease,pad=640:640:(ow-iw)/2:(oh-ih)/2:color=#18ffff[0v];[0v][1:v]overlay=(W-w)/2-(W/2-325.33328):(H-h)/2-(H/2-567.7075):enable='between(t,0.0,8.5)' -ac 2 -ar 44100 -vcodec libx264 -preset ultrafast -strict experimental C:\Users\Admin\Desktop\test_movies\test.mp4




Last edit 2 :



I tried another one with added
alpha=premultiplied
with latest ffmpeg version. It somehow removed the outline, but the quality of the picture reduced alot till it seems like it's pixelated. Plus. there's another unknown white layer at the back of the image.





Sample code :



C:\Users\Admin\Downloads\ffmpeg-20180102-57d0c24-win64-static\bin\ffmpeg -y -ss 0.0 -t 8.5 -i C:\Users\Admin\Desktop\test_movies\white.mp4 -i C:\Users\Admin\Desktop\test_movies\text_and_emoji.png -filter_complex [0:v]scale=640:640:force_original_aspect_ratio=decrease,pad=640:640:(ow-iw)/2:(oh-ih)/2:color=#00ffff[0v];[1:v]scale=480:120[1v];[0v][1v]overlay=(W-w)/2-(W/2-325.33328):(H-h)/2-(H/2-567.7075):alpha=premultiplied:enable='between(t,0.0,8.5)' -ac 2 -ar 44100 -vcodec libx264 C:\Users\Admin\Desktop\test_movies\test.mp4




Latest edit 3 :



As suggested by @Mulvya, I combined his code with
alpha=premultiplied
and it seems alot better now, with very slight black outline (almost not visible)





Sample code :



C:\Users\Admin\Downloads\ffmpeg-20180102-57d0c24-win64-static\bin\ffmpeg -y -ss 0.0 -t 8.5 -i C:\Users\Admin\Desktop\test_movies\white.mp4 -i C:\Users\Admin\Desktop\test_movies\text_and_emoji.png -filter_complex [0:v]setpts=PTS-STARTPTS,scale=640:640:force_original_aspect_ratio=decrease,pad=640:640:(ow-iw)/2:(oh-ih)/2:color=#18ffff[0v];[1:v]premultiply=inplace=1,scale=480:120[1v];[0v][1v]overlay=(W-w)/2-(W/2-325.33328):(H-h)/2-(H/2-567.7075):alpha=premultiplied:enable='between(t,0.0,8.5)':format=rgb,format=yuv420p -ac 2 -ar 44100 -vcodec libx264 C:\Users\Admin\Desktop\test_movies\test.mp4