
Recherche avancée
Autres articles (53)
-
MediaSPIP en mode privé (Intranet)
17 septembre 2013, parÀ partir de la version 0.3, un canal de MediaSPIP peut devenir privé, bloqué à toute personne non identifiée grâce au plugin "Intranet/extranet".
Le plugin Intranet/extranet, lorsqu’il est activé, permet de bloquer l’accès au canal à tout visiteur non identifié, l’empêchant d’accéder au contenu en le redirigeant systématiquement vers le formulaire d’identification.
Ce système peut être particulièrement utile pour certaines utilisations comme : Atelier de travail avec des enfants dont le contenu ne doit pas (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
Sur d’autres sites (4161)
-
RGB to YUV conversion with libav (ffmpeg) triplicates image
17 avril 2021, par José Tomás TocinoI'm building a small program to capture the screen (using X11 MIT-SHM extension) on video. It works well if I create individual PNG files of the captured frames, but now I'm trying to integrate libav (ffmpeg) to create the video and I'm getting... funny results.


The furthest I've been able to reach is this. The expected result (which is a PNG created directly from the RGB data of the XImage file) is this :




However, the result I'm getting is this :




As you can see the colors are funky and the image appears cropped three times. I have a loop where I capture the screen, and first I generate the individual PNG files (currently commented in the code below) and then I try to use libswscale to convert from RGB24 to YUV420 :


while (gRunning) {
 printf("Processing frame framecnt=%i \n", framecnt);

 if (!XShmGetImage(display, RootWindow(display, DefaultScreen(display)), img, 0, 0, AllPlanes)) {
 printf("\n Ooops.. Something is wrong.");
 break;
 }

 // PNG generation
 // snprintf(imageName, sizeof(imageName), "salida_%i.png", framecnt);
 // writePngForImage(img, width, height, imageName);

 unsigned long red_mask = img->red_mask;
 unsigned long green_mask = img->green_mask;
 unsigned long blue_mask = img->blue_mask;

 // Write image data
 for (int y = 0; y < height; y++) {
 for (int x = 0; x < width; x++) {
 unsigned long pixel = XGetPixel(img, x, y);

 unsigned char blue = pixel & blue_mask;
 unsigned char green = (pixel & green_mask) >> 8;
 unsigned char red = (pixel & red_mask) >> 16;

 pixel_rgb_data[y * width + x * 3] = red;
 pixel_rgb_data[y * width + x * 3 + 1] = green;
 pixel_rgb_data[y * width + x * 3 + 2] = blue;
 }
 }

 uint8_t* inData[1] = { pixel_rgb_data };
 int inLinesize[1] = { in_w };

 printf("Scaling frame... \n");
 int sliceHeight = sws_scale(sws_context, inData, inLinesize, 0, height, pFrame->data, pFrame->linesize);

 printf("Obtained slice height: %i \n", sliceHeight);
 pFrame->pts = framecnt * (pVideoStream->time_base.den) / ((pVideoStream->time_base.num) * 25);

 printf("Frame pts: %li \n", pFrame->pts);
 int got_picture = 0;

 printf("Encoding frame... \n");
 int ret = avcodec_encode_video2(pCodecCtx, &pkt, pFrame, &got_picture);

// int ret = avcodec_send_frame(pCodecCtx, pFrame);

 if (ret != 0) {
 printf("Failed to encode! Error: %i\n", ret);
 return -1;
 }

 printf("Succeed to encode frame: %5d - size: %5d\n", framecnt, pkt.size);

 framecnt++;

 pkt.stream_index = pVideoStream->index;
 ret = av_write_frame(pFormatCtx, &pkt);

 if (ret != 0) {
 printf("Error writing frame! Error: %framecnt \n", ret);
 return -1;
 }

 av_packet_unref(&pkt);
 }



I've placed the entire code at this gist. This question right here looks pretty similar to mine, but not quite, and the solution did not work for me, although I think this has something to do with the way the line stride is calculated.


-
How to start an FFmpeg process, create a pipe and write data from the parent process ?
3 mai 2021, par xlxsMy code is based on https://stackoverflow.com/a/32279430/5941827.


I run FFmpeg with the following params :


std::stringstream sstm;
sstm << "ffmpeg -loglevel error -y -f rawvideo -vcodec rawvideo -s " << std::to_string(width) << "x" << std::to_string(height) //
 << " -pix_fmt rgb24 -framerate " << std::to_string(fps) << " -i - -c:v libx264 -preset " << getPreset(encodeSpeed) << //
 " -crf " << std::to_string(crf) << " -shortest " << path;



(the variables are initialized in a class constructor correctly)


Then I open the pipe with
pPipe = popen(sstm.str().c_str(), "w")
.The problem is after Ifwrite
to it and callingfclose
, based on the contents I write sometimes less or more bytes reach FFmpeg, and I get

[rawvideo @ 000000000010c3df] Invalid buffer size, packet size 196606 < expected frame_size 196608
Error while decoding stream #0:0: Invalid argument



The saved output video usually has one frame more or less than the expected.
I have checked the array I'm sending trough the pipe with
fwrite
and it's size is correct.
It appears that based on the data I send some bytes don't get there, or more bytes than I send go through the pipe.

I have also tried two different FFmpeg versions, but with the same error message.


-
Legal issues regarding proprietary_codecs in chromium (bundled with electron)
4 juin 2021, par Manmohan SinghWe're in the process of building and deploying a desktop based app on electron v 12.0.7. It'll be a (free) commercial software deployed to 2-3M users worldwide.
Recently our legal team enquired about the proprietary codecs bundled with chromium and I thought the best way to confirm this would be to reach out here.


So, here're specific things that I need help with :


- 

-
Are we shipping chromium with proprietary codecs ? If yes, what are potentially contentious codecs that come by default in chromium bundled with electron v 12.0.7 ?


-
Is there any documentation around how the electron team builds chromium (with what flags) ?


-
Is the default libffmpeg.dylib/dll bundled with electron building ffmpeg with support for things like H.264 and MP3 codecs ?


-
I noticed there are libffmpeg binaries available with each electron build, e.g. https://github.com/electron/electron/releases/download/v12.0.7/ffmpeg-v12.0.7-darwin-arm64.zip . What's the purpose of this binary ?












Any help would be appreciated.


-