
Recherche avancée
Autres articles (69)
-
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 (...) -
Demande de création d’un canal
12 mars 2010, parEn fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)
Sur d’autres sites (2855)
-
Can you insert text from a file in real time with ffmpeg streaming ?
6 décembre 2020, par Fight Fire With FireI have this code i use to stream a file and place the name of the show of the video at a certain time of the video ( name_of_show ) at the top of the screen, and the bottom of the screen it take the name of the show from video_title.txt and places it on the bottom of the screen.


What I want to do is find a way at a interval say 1 or 2 minutes, pull whatever text is currently in video_title.txt and place it in the video for a few seconds.


I would update video_title.txt from another python program. Here's my current code below.


command = [
 "ffmpeg" , "-re" , "-i" , video[0] ,
 "-vf" , "[in]drawtext=fontsize=40:fontcolor=white:box=1:boxcolor=black@0.8:boxborderw=5:fontfile=/home/fonts/timeless.ttf: text='" + name_of_show + "':x='W-(W+tw)*mod(t\,10)/10':y='H/20':enable='between(t,50,70)',drawtext=fontsize=20:fontfile=/home/fonts/timeless.ttf:textfile=/video_title.txt:fontcolor=white:box=1:boxcolor=black@0.8:boxborderw=5:x=W-w+5:y=h-th-50:enable='1'[out]"
 "-vcodec" , "libx264", "-pix_fmt", "yuv420p",
 "-preset" , "medium" , "-r" , "30" , "-g" , "48" , "-b:v" , "2500k" ,
 "-acodec" , "libmp3lame" , "-ar" , "44100", "-threads" , "6" ,
 "-q:a" , "3" , "-b:a" , "712000" ,"-bufsize", "512k" , "-f" ,
 "flv" , STREAM_URL,



Ultimately the effect I am trying to achieve is a long stream of lets say 1 hour on twitch/youtube where someone could send a text message and it would appear in the stream.


-
How can I simply replace the colors using the color masks on this image and then save it ? With RGBA channels as example
31 août 2020, par karl-policeSo I got this GIF here :




As you can see, it has Red, Green and Blue in it. And it also has a full transparency in it. This was composed together with FFMPEG out of images that looked exactly like that.




Then, with FFMPEG I "decomposed" the RGB and Alpha channels using the filter "extractplanes".


The gallery of that, in correct order starting from up to down, can be found here :




I am not sure if this actually helps me or if I'm supposed to decompose them. Because apperantly now, after decomposing them, I'm supposed to modify them, but I'm not really sure how. It's like how do I modify the red channel that only has black and white, so all at the end, will match to the specified HEX color that I want it to be to.




Now, my question is. How do I exactly make the color changing happen ? Can I do this simply with JavaScript ? Is it possible to do with FFMPEG, if possible without ImageMagicks ? Maybe a programming language where not much installation is needed to do that ?


What I understood is that. These channels basically contain values from 0 to 255 with black and white. I think the "brightness" is that what 0 and 255. So something inbetween, would be like grey.


So basically, like we do (255,0,0) for red. In these channels, if I want red somewhere I need to put one fully white pixel on the red channel and on all the other channels, there has to be a fully black pixel.


That's the concept. Now is the question, how can I do this ?




At the end I want to make it look like the colors this one has, as example :




This is from a game. So basically that's how it looks like in the game. And the game files only use these RGBA template sprites.




I asked a similar question here : How to change colors of an image using RGBA and more channels independently of their color


But somehow, I might didn't seem to explain it that well.




I made a thing here to test around with things. I guess that's nearly close, but the lines are kinda weird. jsfiddle.net/qsgazubk


-
FFMPEG with moviepy
5 novembre 2023, par Shenhav MorI'm working on something that concatenate videos and adds some titles on through moviepy.


As I saw on the web and on my on pc moviepy works on the CPU and takes a lot of time to save(render) a movie. Is there a way to improve the speed by running the writing of moviepy on GPU ? Like using FFmpeg or something like this ?


I didn't find an answer to that on the web, so I hope that some of you can help me.
I tried using
thread=4
andthread=16
but they are still very very slow and didn't change much.

My CPU is very strong (i7 10700k), but still, rendering on moviepy takes me for a compilation with a total of 8 minutes 40 seconds, which is a lot.


Any ideas ?Thanks !
the code doesnt realy matter but :


def Edit_Clips(self):

 clips = []

 time=0.0
 for i,filename in enumerate(os.listdir(self.path)):
 if filename.endswith(".mp4"):
 tempVideo=VideoFileClip(self.path + "\\" + filename)

 txt = TextClip(txt=self.arrNames[i], font='Amiri-regular',
 color='white', fontsize=70)
 txt_col = txt.on_color(size=(tempVideo.w + txt.w, txt.h - 10),
 color=(0, 0, 0), pos=(6, 'center'), col_opacity=0.6)

 w, h = moviesize = tempVideo.size
 txt_mov = txt_col.set_pos(lambda t: (max(w / 30, int(w - 0.5 * w * t)),
 max(5 * h / 6, int(100 * t))))

 sub=txt_mov.subclip(time,time+4)
 time = time + tempVideo.duration

 final=CompositeVideoClip([tempVideo,sub])

 clips.append(final)

 video = concatenate_videoclips(clips, method='compose')
 print("after")
 video.write_videofile(self.targetPath+"\\"+'test.mp4',threads=16,audio_fps=44100,codec = 'libx264')