
Recherche avancée
Médias (1)
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (96)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
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 (6588)
-
Is it possible to encrypt mpeg-dash clear content in ffmpeg ?
22 novembre 2017, par diSIs it possible to encrypt mpeg-dash clear content in ffmpeg ? or do we need to additional code to handle the encryption ?
From ffmpeg dashenc.c code it appears that dash code does not encrypt the content.
Can we reuse the mp4 muxer for encrypting and dash for segmenting ? -
How to generate multi rate mpeg-dash stream by ffmpeg
11 mars 2020, par pesehr -
Why does the official LibAV 12 video example not work properly ?
11 avril 2021, par TheNeuronalCoderI would say the title is quite self-explanatory, but I nearly completely copied the example given by LibAV right here and yet the output video it produced was not playable. Why is it not playable ? Am I using the wrong file extension ? I do not understand what I could have possibly done wrong here and there's little to no documentation I could find for how to encode mp4 video in C++.


#include 
#include 
#include 
#include "libavcodec/avcodec.h"
#include "libavutil/frame.h"
#include "libavutil/imgutils.h"

static void encode(AVCodecContext *enc_ctx, AVFrame *frame, AVPacket *pkt, FILE *outfile) {
 int ret;
 ret = avcodec_send_frame(enc_ctx, frame);
 if (ret < 0) {
 fprintf(stderr, "error sending a frame for encoding\n");
 exit(1);
 }
 while (ret >= 0) {
 ret = avcodec_receive_packet(enc_ctx, pkt);
 if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
 return;
 else if (ret < 0) {
 fprintf(stderr, "error during encoding\n");
 exit(1);
 }
 printf("encoded frame %3"PRId64" (size=%5d)\n", pkt->pts, pkt->size);
 fwrite(pkt->data, 1, pkt->size, outfile);
 av_packet_unref(pkt);
 }
}

int main() {
 const char *filename = "animation.mp4";
 const AVCodec *codec;
 AVCodecContext *c = NULL;
 int i, ret, x, y;
 FILE *f;
 AVFrame *picture;
 AVPacket *pkt;
 uint8_t endcode[] = { 0, 0, 1, 0xb7 };
 if (argc <= 1) {
 fprintf(stderr, "Usage: %s <output file="file">\n", argv[0]);
 exit(0);
 }
 avcodec_register_all();
 codec = avcodec_find_encoder(AV_CODEC_ID_MPEG1VIDEO);
 if (!codec) {
 fprintf(stderr, "codec not found\n");
 exit(1);
 }
 c = avcodec_alloc_context3(codec);
 picture = av_frame_alloc();
 pkt = av_packet_alloc();
 if (!pkt)
 exit(1);
 c->bit_rate = 400000;
 c->width = 352;
 c->height = 288;
 c->time_base = (AVRational){1, 25};
 c->framerate = (AVRational){25, 1};
 c->gop_size = 10;
 c->max_b_frames=1;
 c->pix_fmt = AV_PIX_FMT_YUV420P;
 if (avcodec_open2(c, codec, NULL) < 0) {
 fprintf(stderr, "could not open codec\n");
 exit(1);
 }
 f = fopen(filename, "wb");
 if (!f) {
 fprintf(stderr, "could not open %s\n", filename);
 exit(1);
 }
 picture->format = c->pix_fmt;
 picture->width = c->width;
 picture->height = c->height;
 ret = av_frame_get_buffer(picture, 32);
 if (ret < 0) {
 fprintf(stderr, "could not alloc the frame data\n");
 exit(1);
 }

 for(i=0;i<25;i++) {
 fflush(stdout);
 ret = av_frame_make_writable(picture);
 if (ret < 0)
 exit(1);

 for(y=0;yheight;y++) {
 for(x=0;xwidth;x++) {
 picture->data[0][y * picture->linesize[0] + x] = x + y + i * 3;
 }
 }

 for(y=0;yheight/2;y++) {
 for(x=0;xwidth/2;x++) {
 picture->data[1][y * picture->linesize[1] + x] = 128 + y + i * 2;
 picture->data[2][y * picture->linesize[2] + x] = 64 + x + i * 5;
 }
 }

 picture->pts = i;
 encode(c, picture, pkt, f);
 }

 encode(c, NULL, pkt, f);

 fwrite(endcode, 1, sizeof(endcode), f);
 fclose(f);
 avcodec_free_context(&c);
 av_frame_free(&picture);
 av_packet_free(&pkt);
 return 0;
}
</output>