
Recherche avancée
Autres articles (81)
-
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...) -
Récupération d’informations sur le site maître à l’installation d’une instance
26 novembre 2010, parUtilité
Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...) -
De l’upload à la vidéo finale [version standalone]
31 janvier 2010, parLe chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
Upload et récupération d’informations de la vidéo source
Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)
Sur d’autres sites (4237)
-
Crop a video in Python, centered on a 16x9 video, cropped to 9x16, moviepy ?
22 décembre 2022, par LevfoI want to crop a video that is 16x9 resolution to 9x16. This can be done by cropping a centered 607px wide rectangle on the 16x9 video. Can this be done ? EDIT : I do not care to stay within moviepy. I want to use something with speed. Currently, writing a 5 min video file with moviepy is taking 10+ minutes.




from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
import moviepy.editor as mpy

origVideo = 'video.mp4'
video = mpy.VideoFileClip(origVideo)

#Crop 'video' here and output 'cropped-video.mp4'

video.write_videofile('video-cropped.mp4')



Currently only getting a black screen with no audio. The video won't play, but it has a time code.


-
How create a circular video (transparent area on top of video) effect without applying image mask to video
26 septembre 2024, par Arina LubimovaBasically i googled a lot and solutions suggests apply some PNG mask or do not provide needed solution.


What i've found.


ffmpeg -i main.mkv -i facecloseup.mkv
 -filter_complex "[1]trim=end_frame=1,
 geq='st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),pow(min(W/2,H/2),2)),255,0)':128:128,
 loop=-1:1,setpts=N/FRAME_RATE/TB[mask];
 [1][mask]alphamerge[cutout];
 [0][cutout]overlay=x=W-w:y=0[v];
 [0][1]amix=2[a]"
 -map "[v]" -map "[a]" out.mp4



command = "-i " + this.video1Path.getPath() + " -i " + this.video2Path.getPath() + " -filter_complex [1]trim=end_frame=1,geq=lum_expr='st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3)," + (this.mZoomLayout.getZoomedWidth()/2) + "*" + (this.mZoomLayout.getZoomedWidth()/2) + "),255,0)':128:128,format=gray,loop=-1:1,setpts=N/FRAME_RATE/TB[mask];[1][mask]alphamerge,format=rgba,lutrgb=a=if(gte(val\\,16)\\,val)[cutout];[0][cutout]overlay=" + this.mZoomLayout.getCircleX() + ":" + this.mZoomLayout.getCircleY() + ":enable='between(t,0," + this.videoTwoDuration + ") -c:v libx264 -crf 24 -preset ultrafast " + videoPath.getPath(); 



So i tried to extract needed things from them, but i don't understand how exactly i need to do that, i did this :


ffmpeg -i video.mp4 -filter_complex "[0]geq='st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),pow(min(W/2,H/2),2)),255,0)':H:W; [0:v][mask]alphamerge" out.mp4



[mov,mp4,m4a,3gp,3g2,mj2 @ 000001f761dd8e40] Invalid stream specifier: mask.
 Last message repeated 1 times
Stream specifier 'mask' in filtergraph description [0]geq='st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),pow(min(W/2,H/2),2)),255,0)':H:W; [0:v][mask]alphamerge matches no streams.



ffmpeg -i video.mp4 -filter_complex "[0]geq=lum_expr='st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),pow(min(W/2,H/2),2)),255,0)':H:W; [0:v][mask]alphamerge" out.mp4



[mov,mp4,m4a,3gp,3g2,mj2 @ 000001bfd9218e80] Invalid stream specifier: mask.
 Last message repeated 1 times
Stream specifier 'mask' in filtergraph description [0]geq=lum_expr='st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),pow(min(W/2,H/2),2)),255,0)':H:W; [0:v][mask]alphamerge matches no streams.



And one more time, guys, if you are going to post some "prepared image mask" solution - just leave, the question is about creating mask on air.


So, let's say we have red square (yes, ratio is static, always 1:1), yes, i can't post it because i dont have 10 rep. (...).


https://i.sstatic.net/MsL71.png - red square.


https://i.sstatic.net/aIFEV.png - circle


https://i.sstatic.net/R8EAx.png - result


https://i.sstatic.net/WtqQg.png - final result


I actually want to get the answer from @Gyan or @llogan because i searched a lot and only these two guys do understand how to make things programmatically.


More tech details :
Aspect ratio is constant - 1:1, width and height should be taken from the video in auto way, we need to create a white square with transparent circle inside it, the end result must contain "rounded" video with white background.


-
Is there any way to provide different video qualities in my web application without converting each video to each format ?
15 octobre 2019, par Dheeraj Arorai am building a web application which will handle thousand of videos. Currently, I am using ffmpeg to convert each video to 4 formats(1080,720,480,340px). It consumes lot of memory and time to upload for each video. Is there any best way that allows user to stream my videos in different video quality without converting each video ?