
Recherche avancée
Autres articles (103)
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
Sur d’autres sites (16001)
-
Download Partial Video via HTTP (for Remote Thumbnailing)
13 février 2012, par HuntedCI have videos hosted on Amazon S3. I encode them with Zencoder and store a thumbnail for the video then using Zencoder. However, I need a way to generate thumbnails at certain points in the video (i.e. 00:00:03, 00:10:32, 01:40:18) and store them either on S3 or my server.
ffmpeg allows remote thumbnailing, however it takes a very long time (sometimes several minutes) to get a thumbnail from the middle of a file—I believe this is because it downloads the entire file up to that point to get the thumbnail.
My plan is to somehow download the header of the video file via HTTP byte-range request, guesstimate the byte range where I should be looking for the thumbnail, download about a second of video from that part of the file via HTTP byte-range request, then save the header and tiny video locally. I pull the thumbnail from that using ffmpeg and delete the temporary video.
I have no idea on how exactly this would work (I believe the H.264 MP4 files I'm working with have a dynamic length header, for another issue). Any suggestions or better ideas ?
Edit : To clarify, Zencoder thumbnailing is great, but they only allow thumbnail creation in combination with transcoding. I don't want to transcode my video every time I create a new thumbnail, so I need to do this on my own without Zencoder.
-
How to save video data in a vector using ffmpeg ? (C++)
25 octobre 2022, par noklaI'm new to ffmpeg and I am trying to write a program for video editing.


I want to import a video file and save it somehow in a vector so I could edit its frames later.
When I saved all the decoded AVFrames in a vector I saw it takes a lot of memory and that I need to find a better way to do so.


The function I used for reading a video :


** the function is in a class that representing video,
source
type isstd::vector<avframe></avframe>


void VideoSource::ReadSource(std::string path)
{
 // Open the file using libavformat
 AVFormatContext* av_format_ctx = avformat_alloc_context();
 if (!av_format_ctx) {
 printf("Couldn't create AVFormatContext\n");
 return; 
 }
 if (avformat_open_input(&av_format_ctx, path.c_str(), NULL, NULL) != 0) {
 printf("Couldn't open video file\n");
 return;
 }

 // Find the first valid video stream inside the file
 int video_stream_index = -1;
 AVCodecParameters* av_codec_params = NULL;
 const AVCodec* av_codec = NULL;
 for (int i = 0; i < av_format_ctx->nb_streams; i)
 {
 av_codec_params = av_format_ctx->streams[i]->codecpar;
 av_codec = avcodec_find_decoder(av_codec_params->codec_id);

 if (!av_codec) {
 continue;
 }
 if (av_codec_params->codec_type == AVMEDIA_TYPE_VIDEO) {
 video_stream_index = i;
 break;
 }
 }

 if (video_stream_index == -1) {
 printf("Couldn't find valid video stream inside file\n");
 return;
 }

 // Set up a codec context for the decoder
 AVCodecContext* av_codec_ctx = avcodec_alloc_context3(av_codec);
 if (!av_codec_ctx) {
 printf("Couldn't create AVCpdecContext\n");
 return;
 }

 if (avcodec_parameters_to_context(av_codec_ctx, av_codec_params) < 0)
 {
 printf("Couldn't initialize AVCodecContext\n");
 return;
 }
 if (avcodec_open2(av_codec_ctx, av_codec, NULL) < 0) {
 printf("Couldn't open codec\n");
 return;
 }

 AVFrame* av_frame = av_frame_alloc();
 if (!av_frame) {
 printf("Couldn't allocate AVFrame\n");
 return;
 }
 AVPacket* av_packet = av_packet_alloc();
 if (!av_packet) {
 printf("Couldn't allocate AVPacket\n");
 return;
 }
 int response;

 while (av_read_frame(av_format_ctx, av_packet) >= 0) {
 if (av_packet->stream_index != video_stream_index) {
 av_packet_unref(av_packet);
 continue;
 }
 response = avcodec_send_packet(av_codec_ctx, av_packet);
 if (response < 0) {
 printf("Failed to decode packet: %s\n", av_err2str(response));
 return;
 }
 response = avcodec_receive_frame(av_codec_ctx, av_frame);
 if (response == AVERROR(EAGAIN) || response == AVERROR_EOF) {
 av_packet_unref(av_packet);
 continue;
 }
 else if (response < 0) {
 printf("Failed to decode frame: %s\n", av_err2str(response));
 return;
 }
 av_packet_unref(av_packet);

 av_packet = av_packet_alloc();

 // response = avcodec_send_frame(av_codec_ctx, av_frame);

 source.push_back(*new AVFrame);
 source.back() = *av_frame_clone(av_frame);

 av_frame_unref(av_frame);
 }
 

 avformat_close_input(&av_format_ctx);
 avformat_free_context(av_format_ctx);
 av_frame_free(&av_frame);
 av_packet_free(&av_packet);
 avcodec_free_context(&av_codec_ctx);
}



I thought maybe I should save it as a vector of encoded AVFrames or as a vector of encoded packet that contains some frames in it.


When I tried to encode a single AVFrame, I added this line

response = avcodec_send_frame(av_codec_ctx, av_frame);
before pushing the frame into the vector (You can see it marked as a comment in the code above).

It returned invalid argument (-22) and I am not sure why.

Questions :


- 

- Why did I get that error (-22) ?
- How to save an encoded packet with multiple AVFrame in it ?
- Is there a better way of working on a video that won't take as much memory ?








-
Evolution #4766 : Passer le menu d’ajouts rapides dans un sous-menu
4 mai 2021, par RastaPopoulos ♥Cédric commentait :
c’est un bandeau d’accès rapide à l’écriture de contenus : c’est pas pour planquer les trucs dans un sous menu, donc ça me parait une mauvaise idée en terme d’interface même si ça semble plus simple pour les devs
Ce sur quoi je ne suis pas d’accord :)
C’est un bandeau d’accès rapide essentiellement pour créer un nouveau contenu, au final jamais personne n’y a mis autre chose que de la création. Donc pas pour n’importe quels accès rapides : que de la création, c’est super cohérent.
Ce menu permet donc de créer sans quitter la page actuelle, c’est-à-dire sans naviguer sur plusieurs pages + devoir chercher et trouver un autre lien sur ces autres pages (exemple, aller dans Édition (ou autre) => Patates puis ensuite trouver un lien).
Le fait que ce soit une entrée unique qui se déroule n’est pas planqué du tout :
1) c’est plus facilement identifiable, car UN bouton à connaitre quand on veut accéder à une création sans quitter la page : réduction de la charge mentale, ya pas plein de choses affichées, sans label en plus, mais un seul : plus facile à former, et plus facile à mémoriser ensuite quand on l’a utilisé une fois
2) à l’intérieur du sous-menu, on a désormais des labels pour chaque entrée, donc là aussi, bien plus facilement accessible à tout le monde, il n’y a pas à se souvenir des icones, ni a les compter comme RealET (cliquez sur la 3ème icones etc : super BAD pour la formation justement, le fait qu’il n’y ait pas de label), là une fois le menu ouvert, tout le monde sera capable de s’y retrouver sans l’aide de la formatriceBref, c’est mieux. :)