
Recherche avancée
Médias (91)
-
Géodiversité
9 septembre 2011, par ,
Mis à jour : Août 2018
Langue : français
Type : Texte
-
USGS Real-time Earthquakes
8 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
SWFUpload Process
6 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
-
Podcasting Legal guide
16 mai 2011, par
Mis à jour : Mai 2011
Langue : English
Type : Texte
-
Creativecommons informational flyer
16 mai 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (68)
-
Dépôt de média et thèmes par FTP
31 mai 2013, parL’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...) -
Use, discuss, criticize
13 avril 2011, parTalk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
A discussion list is available for all exchanges between users. -
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 (...)
Sur d’autres sites (5857)
-
Covert opengl framebuffer into ffmpeg encoded mp4 c++ [closed]
14 mai 2022, par user19068953I want to make a program that takes an mp4 file as an input and draws something on top of it then gives the new video as an output. So far I have a program that takes a file name, have ffmpeg decode it and draw whatever i want with opengl (I have followed this tutorial that draws on top of the video separately : https://gist.github.com/hradec/a8b8ae0bf82891a5d853b06619839d9d) and have an opengl framebuffer. My question is how do put opengl's framebuffer on top of ffmpeg frames and generate a new video with it then give a new file as an output ? The framebuffer is allocated in fbo, so i want to encode it to ffmpeg, something like


av_write_frame(state->fmt_ctx, &fbo) 



is there a function like this that allows me to write frame data into a newly created video ?


Here is my encoder :


int VideoDecoder::write_frame()
{
 // Find a way to write OpenGL Frames here.
 av_packet_rescale_ts(&state->packet, VideoSt.Ctx->time_base, VideoSt.Stream->time_base);
 state->packet.stream_index = VideoSt.Stream->index;
 return av_interleaved_write_frame(state->fmt_ctx, &state->packet);
}


bool VideoDecoder::encode_video()
{

 // TODO: This is horrible fix this function.

 state->packet = { nullptr };
 av_init_packet(&state->packet);

 fflush(stdout);

 IMG_Buffer.SetNum(ColorBuffer.Num() * 4);
 uint8* DestPtr = nullptr;
 for (auto i = 0; i < ColorBuffer.Num(); i++)
 {
 DestPtr = &IMG_Buffer[i * 4];
 auto SrcPtr = ColorBuffer[i];
 *DestPtr++ = SrcPtr.R;
 *DestPtr++ = SrcPtr.G;
 *DestPtr++ = SrcPtr.B;
 *DestPtr++ = SrcPtr.A;
 }

 uint8* inData[1] = { IMG_Buffer.GetData() };


 sws_scale(SwsCtx, inData, InLineSize, 0, VideoSt.Ctx->height, VideoSt.Frame->data, VideoSt.Frame->linesize);

 VideoSt.Frame->pts = VideoSt.NextPts++;
 if (FFmpegEncode(VideoSt.Frame) < 0)
 return false;

 auto ret = WriteFrame();

 if (ret < 0)
 {
 auto errstr = FString(av_err2str(ret));
 }
 av_packet_unref(&state->packet);


 GotOutput = 0;
 auto ret = avcodec_send_frame(VideoSt.Ctx, frame);
 if (ret < 0 && ret != AVERROR_EOF) {
 auto errstr = FString(av_err2str(ret));
 return -1;
 }

 ret = avcodec_receive_packet(VideoSt.Ctx, &Pkt);
 if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
 return 0;

 if (ret < 0)
 {
 auto errstr = FString(av_make_error_string(ret).c_str());
 av_packet_unref(&Pkt);
 return -1;
 }

 GotOutput = 1;
 return 0;


 for (GotOutput = 1; GotOutput; count++)
 {
 fflush(stdout);

 FFmpegEncode(nullptr);

 if (GotOutput)
 {
 auto ret = WriteFrame(false);
 if (ret < 0)
 {
 auto errstr = FString(av_err2str(ret));
 }
 av_packet_unref(&Pkt);
 }
 }

 auto ret = av_write_trailer(FmtCtx);
 if (ret < 0)
 {
 auto errstr = FString(av_err2str(ret));
 }
}



and here is my simple frame buffer :


bool OpenGLRenderer::alloc_frame_buffer()
{
 unsigned int fbo;
 glGenFramebuffers(1, &fbo);

 if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) return false;

 glBindFramebuffer(GL_FRAMEBUFFER, fbo);

 unsigned int texture;
 glGenTextures(1, &texture);
 glBindTexture(GL_TEXTURE_2D, texture);

 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 800, 600, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);

 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);
}



-
Pack H264 frames into MPEG2-TS
13 décembre 2016, par DizI have a live stream distributing
raw H264
frames. The frames are encoded withx264
. I am able to play the stream with ffplay, so it is working fine. Now I’d like to retransmit (or at least save locally in aMPEG2-TS
file) this stream in aMPEG2-TS
format usingC/C++
code.What is the best way to achieve that ? I tried to investigate FFMPEG library and it looks like a complete hell for me. I also tried the code from this answer. I am able to write AVI file with that code, but if I replace "avi" with "mpeg" in the source code, the resulting video file cannot be played with a video player (VLC, mplayer) saying "MPEG : FATAL : EOF while searching for sequence header.".
Question : What library or a sample code can you suggest me for this task ? Thanks in advance.
Using LUbuntu 16.04.
-
MBP Retina Isight and FFmpeg
28 mars 2014, par ManuhozI try to reach the video stream from my brand new MacBook Pro Retina (Mavericks) to use it as an input in ffmpeg (and stream it again via RTMP).
I've tried different solutions in other stack overflow's topics but none seems to work :
wacaw -L doesn't list any device
Quicktime Broadcaster doesn't display any video (Audio only)
but the Isight does work in Photo Booth.
Any ideas ? Anyone working on the subject ?
Thanks