
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 (97)
-
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. -
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
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 (...)
Sur d’autres sites (10673)
-
FFmpeg command to apply multiple filters and limit the final file size
16 mars 2016, par Konrad — ffmpegI’m using ffmpeg command below to convert video to a format of the defined scale and in order to hardcode the subtitles
Original syntax
ffmpeg -i "Original File.mov" -vf subtitles=Subtitles.srt -vf scale=1920:1080 \
-crf 12 "Final File".movProblem
I would like to expand this command further and :
- ensure that the produce file is under 2GB
- I would like to include additional parameters with advanced subtitle options, like setting the canvas size and fixing the potential delay
Side notes
I reckon that in case of predefining the file size the
-crf 12
paramater will be redundant ? -
H264 decoding using ffmpeg
14 juillet 2016, par KindermannI’m trying to decode a video stream with ffmpeg library, that’s how I do it basically :
void video_decode(const char *filename)
{
AVCodec *codec;
AVCodecContext *c= NULL;
int frame_count=0;
FILE *f;
AVFrame *frame;
uint8_t inbuf[INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
AVPacket avpkt;
av_init_packet(&avpkt);
memset(inbuf + INBUF_SIZE, 0, AV_INPUT_BUFFER_PADDING_SIZE);
printf("Decoding video file...\n");
/* find the h264 video decoder */
codec = avcodec_find_decoder(AV_CODEC_ID_H264);
c = avcodec_alloc_context3(codec);
c->bit_rate = 400000;
c->width = 1920;
c->height = 1080;
if (avcodec_open2(c, codec, NULL) < 0) {
fprintf(stderr, "Could not open codec\n");
exit(1);
}
frame = av_frame_alloc();
for (;;) {
avpkt.size = fread(inbuf, 1, INBUF_SIZE, f);
if (avpkt.size == 0)
break;
avpkt.data = inbuf;
while(avpkt.size > 0){
int len, got_frame;
len = avcodec_decode_video2(c, frame, &got_frame, &avpkt);
if (len < 0) {
fprintf(stderr, "Errr while decding frame %d\n", frame_count);
exit (1);
}
if (got_frame) {
//Print out frame information..
}
if (avpkt.data) {
avpkt.size -= len;
avpkt.data += len;
}
}
}
}But I got the following outputs :
Decoding video file...
[h264 @ 0x303c040] decode_slice_header error
[h264 @ 0x303c040] decode_slice_header error
[h264 @ 0x303c040] decode_slice_header error
[h264 @ 0x303c040] no frame!
Errr while decding frame 0Obviously the initiation of codec was incomplete. Do you have experience with h264 api ? Any help would be appreciated.
-
Libavcodec and QuickSync
15 février 2016, par FrancescoBLTI’m attempting to encode in h264 format using libavcodec with and without QuickSync hardware acceleration. If I don’t use the hw acceleration is quite simple :
ff_codec = avcodec_find_encoder(AV_CODEC_ID_H264) ;
ff_cdctx = avcodec_alloc_context3(ff_codec) ;
ff_cdctx->width = 1920;
ff_cdctx->height = 1080;
ff_cdctx->time_base.num = 1;
ff_cdctx->time_base.den = 25;
ff_cdctx->sample_aspect_ratio.num = 16;
ff_cdctx->sample_aspect_ratio.den = 9;
ff_cdctx->pix_fmt = AV_PIX_FMT_YUV420P;
av_dict_set(&param,"profile","main",0);
av_dict_set(&param,"preset","medium",0);
av_dict_set(&param,"tune","film",0)<0);
ff_cdctx->gop_size = 10;
ff_cdctx->max_b_frames = 1;
opres = avcodec_open2(ff_cdctx,ff_codec,&param);
ff_frame = av_frame_alloc();
ff_frame->format = ff_cdctx->pix_fmt;
ff_frame->width = ff_cdctx->width;
ff_frame->height = ff_cdctx->height;
opres = av_image_alloc(ff_frame->data, ff_frame->linesize,ff_cdctx->width,ff_cdctx->height,ff_cdctx->pix_fmt, 32);
ff_frame->linesize[0] = ff_cdctx->width;
ff_frame->linesize[1] = ff_frame->linesize[2] = ff_cdctx->width>>1;
ff_frame->sample_aspect_ratio.num = ff_cdctx->sample_aspect_ratio.num;
ff_frame->sample_aspect_ratio.den = ff_cdctx->sample_aspect_ratio.den;
av_init_packet(&pkt);
enc_err = avcodec_encode_video2(ff_cdctx,&pkt,ff_frame,&got_pkt); }And so on for all source frame. Problem arise when I attempt to use hardware
acceleration. In this case I use :ff_codec = avcodec_find_encoder_by_name("h264_qsv") ;
for gathering the codec. But when I attempt to open it, the result is "invalid parameter" :
opres = avcodec_open2(ff_cdctx,ff_codec,¶m) ;
if(opres<0)
if(av_strerror(opres,err_str,256)==0) OutputDebugStringA(err_str) ;
return -6 ;
Did anyone have attempted to use QuickSync from code ? In the examples there is only one file (qsvdec.c) and is for decoding, not for encoding.
regards