
Recherche avancée
Autres articles (85)
-
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...) -
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 (...)
Sur d’autres sites (5490)
-
Dumping Subtitles From AVPicture into ppm Format File
23 janvier 2019, par Rishabh GargIn FFMPEG sofftware, AVPicture is used to store image data using data pointer and linesizes. It means all subtitles are stored in the form of picture inside ffmpeg . Now I want to dump subtitles from AVPicture in .ppm format file.
I have written this code to Dump subtitles with the help of data in AVPicture. May be my red,green,blue pixel data may be wrong in the loop.
w = ctx->sub->rects[0]->w;
h = ctx->sub->rects[0]->h;
line_size = ctx->sub->rects[0]->linesize[0];
int m,n;
FILE *fp = fopen("first.ppm", "wb");
(void) fprintf(fp, "P3\n%d %d\n255\n", w, h);
for (m = 0; m < h; ++m)
{
for (n = 0; n < line_size; ++n)
{
static int r,g,b,a,z;
uint32_t *pallet = ctx->sub->rects[0]->data[1];
z = ctx->sub->rects[0]->data[0][n];
b = pallet[z]&0xFF;
g = (pallet[z]>>8) & 0xFF;
r = (pallet[z]>>16)& 0xFF;
a = (pallet[z]>>24)& 0xFF;
fprintf(fp,"%d %d %d %d",b,g,r,a);
}
fprintf(fp,"\n");
fflush(fp);
}
(void) fclose(fp);The program is not dumping subtitles. Only 0 is coming in r,g,b,a by which subtitles are not dumping .
-
How to use rotate filter in FFmpeg ? [duplicate]
14 décembre 2020, par shubham rawatI have to overlay text at each second of the video and the text should be tilt. I am able to overlay text but can't rotate the text. The command I am using to overlay is.


ffmpeg -y -i gta5.mp4 -vf "[in]drawtext=text=\'"ALT"\': fontcolor=white: borderw=2: fontfile=Arial #Black:fontsize=w*0.04: x=(w-text_w)/1.5: y=120: enable=\'between(t,0,'+str(last_point)+')\',drawtext=text=\'"0"\': fontcolor=blue: borderw=2: fontfile=Arial #Black:fontsize=w*0.04: x=(w-text_w)/1.5: y=70: enable=\'between(t,0.00,10)\'[out]" -codec:a copy mos.mp4



I want to use the rotate filter in this command or any filter which can tilt the text by some degrees.
I know how to rotate one text as it is already answered in Overlaying text on video with required angle using FFMPEG but I am having issues with multiple texts at different times.


-
Combine Audio and Images in Stream
19 décembre 2017, par SenorContentoI would like to be able to create images on the fly and also create audio on the fly too and be able to combine them together into an rtmp stream (for Twitch or YouTube). The goal is to accomplish this in Python 3 as that is the language my bot is written in. Bonus points for not having to save to disk.
So far, I have figured out how to stream to rtmp servers using ffmpeg by loading a PNG image and playing it on loop as well as loading a mp3 and then combining them together in the stream. The problem is I have to load at least one of them from file.
I know I can use Moviepy to create videos, but I cannot figure out whether or not I can stream the video from Moviepy to ffmpeg or directly to rtmp. I think that I have to generate a lot of really short clips and send them, but I want to know if there’s an existing solution.
There’s also OpenCV which I hear can stream to rtmp, but cannot handle audio.
A redacted version of an ffmpeg command I have successfully tested with is
ffmpeg -loop 1 -framerate 15 -i ScreenRover.png -i "Song-Stereo.mp3" -c:v libx264 -preset fast -pix_fmt yuv420p -threads 0 -f flv rtmp://SITE-SUCH-AS-TWITCH/.../STREAM-KEY
or
cat Song-Stereo.mp3 | ffmpeg -loop 1 -framerate 15 -i ScreenRover.png -i - -c:v libx264 -preset fast -pix_fmt yuv420p -threads 0 -f flv rtmp://SITE-SUCH-AS-TWITCH/.../STREAM-KEY
I know these commands are not set up properly for smooth streaming, the result manages to screw up both Twitch’s and Youtube’s player and I will have to figure out how to fix that.
The problem with this is I don’t think I can stream both the image and the audio at once when creating them on the spot. I have to load one of them from the hard drive. This becomes a problem when trying to react to a command or user chat or anything else that requires live reactions. I also do not want to destroy my hard drive by constantly saving to it.
As for the python code, what I have tried so far in order to create a video is the following code. This still saves to the HD and is not responsive in realtime, so this is not very useful to me. The video itself is okay, with the one exception that as time passes on, the clock the qr code says versus the video’s clock start to spread apart farther and farther as the video gets closer to the end. I can work around that limitation if it shows up while live streaming.
def make_frame(t):
img = qrcode.make("Hello! The second is %s!" % t)
return numpy.array(img.convert("RGB"))
clip = mpy.VideoClip(make_frame, duration=120)
clip.write_gif("test.gif",fps=15)
gifclip = mpy.VideoFileClip("test.gif")
gifclip.set_duration(120).write_videofile("test.mp4",fps=15)My goal is to be able to produce something along the psuedo-code of
original_video = qrcode_generator("I don't know, a clock, pyotp, today's news sources, just anything that can be generated on the fly!")
original_video.overlay_text(0,0,"This is some sample text, the left two are coordinates, the right three are font, size, and color", Times_New_Roman, 12, Blue)
original_video.add_audio(sine_wave_generator(0,180,2)) # frequency min-max, seconds
# NOTICE - I did not add any time measurements to the actual video itself. The whole point is this is a live stream and not a video clip, so the time frame would be now. The 2 seconds list above is for our psuedo sine wave generator to know how long the audio clip should be, not for the actual streaming library.
stream.send_to_rtmp_server(original_video) # Doesn't matter if ffmpeg or some native libraryThe above example is what I am looking for in terms of video creation in Python and then streaming. I am not trying to create a clip and then stream it later, I am trying to have the program be able to respond to outside events and then update it’s stream to do whatever it wants. It is sort of like a chat bot, but with video instead of text.
def track_movement(...):
...
return ...
original_video = user_submitted_clip(chat.lastVideoMessage)
original_video.overlay_text(0,0,"The robot watches the user's movements and puts a blue square around it.", Times_New_Roman, 12, Blue)
original_video.add_audio(sine_wave_generator(0,180,2)) # frequency min-max, seconds
# It would be awesome if I could also figure out how to perform advance actions such as tracking movements or pulling a face out of a clip and then applying effects to it on the fly. I know OpenCV can track movements and I hear that it can work with streams, but I cannot figure out how that works. Any help would be appreciated! Thanks!Because I forgot to add the imports, here are some useful imports I have in my file !
import pyotp
import qrcode
from io import BytesIO
from moviepy import editor as mpyThe library, pyotp, is for generating one time pad authenticator codes, qrcode is for the qr codes, BytesIO is used for virtual files, and moviepy is what I used to generate the GIF and MP4. I believe BytesIO might be useful for piping data to the streaming service, but how that happens, depends entirely on how data is sent to the service, whether it be ffmpeg over command line (from subprocess import Popen, PIPE) or it be a native library.