
Recherche avancée
Autres articles (55)
-
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...) -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...)
Sur d’autres sites (8715)
-
Green screen writing FLV file libavformat
5 mai 2013, par YYZI've written a piece of C++ code that can capture webcam video frame, decode them, convert them to YUV420P, encode them and then write them to a file. If I use the mpeg2 codec and write to a .mpg file, everything works perfectly. But, if I use flv, then the output produced is just a green screen. I'm not sure if there are different encoder settings I need to set for encoding flv video ? Here's my code(the relevant parts) :
Encoder settings :
c->codec_id = codec_id;
c->bit_rate = 400000;
// Resolution must be a multiple of two.
c->width = 352;
c->height = 288;
c->time_base.den = STREAM_FRAME_RATE;
c->time_base.num = 1;
//emit one intra frame every twelve frames at most
c->gop_size = 12;
c->pix_fmt = STREAM_PIX_FMT;Write the frames
int ret;
uint8_t *buffer = NULL;
static struct SwsContext *sws_ctx;
//Setup the codec context, and set its width and height to be equal to the input video width and height
AVCodecContext *c = st->codec;
c->width = pCodecCtx->width;
c->height = pCodecCtx->height;
av_init_packet(&packet);
frameYUV = avcodec_alloc_frame();
//Determine how big the buffer will need to be to store the captured frame
numBytes = avpicture_get_size(STREAM_PIX_FMT,pCodecCtx->width,pCodecCtx->height);
//Allocate the needed buffer size
buffer = new uint8_t[numBytes];
sws_ctx = sws_getContext(pCodecCtx->width,pCodecCtx->height,pCodecCtx->pix_fmt,
pCodecCtx->width,pCodecCtx->height,
STREAM_PIX_FMT,SWS_BICUBIC,NULL,NULL,NULL);
//Fill the output frame
avpicture_fill((AVPicture *)frameYUV,buffer,STREAM_PIX_FMT,pCodecCtx->width,pCodecCtx->height);
//Read a video frame in
av_read_frame(pFormatCtx,&packet);
//Decode the contents of packet into pFrame
avcodec_decode_video2(pCodecCtx,pFrame,&frameFinished,&packet);
//Scale pFrame into frameYUV, and convert to PIXFMTYUV420P
sws_scale
(
sws_ctx,
(uint8_t const * const *)pFrame->data,
pFrame->linesize,
0,
pCodecCtx->height,
frameYUV->data,
frameYUV->linesize
);
av_init_packet(&samsPacket);
//Encode frameYUV
avcodec_encode_video2(c, &samsPacket, frameYUV, &gotSamsPacket);
AVPacket pkt = { 0 };
int got_packet;
av_init_packet(&pkt);
// encode the image
ret = avcodec_encode_video2(c, &pkt, frame, &got_packet);
if (ret < 0){
debugLogStreamSave->debug("Error encoding video frame");
exit(1);
}
if (!ret && got_packet && pkt.size){
pkt.stream_index = st->index;
// Write the compressed frame to our output
ret = av_interleaved_write_frame(oc, &pkt);Any help would be appreciated !
-
C Code Using FFmpeg libraries - Compilation Error
17 août 2013, par ArdatrI've been recently trying to compile C code that uses the FFmpeg libraries ; however, the compilation fails due to a reason that I cannot determine.
The code that I've been trying to compile is the filtering_audio.c file on the Doxygen Documentation website for FFmpeg (I'll provide the link, since the code is too long to quote here) : http://ffmpeg.org/doxygen/trunk/doc_2examples_2filtering_audio_8c-example.html
I use gcc to compile the code :
gcc filter.c -lavformat -lavcodec -lavfilter -lavutil
And I get the following undefined reference errors :
/tmp/cc90K2S5.o: In function `init_filters':
filter.c:(.text+0x3e5): undefined reference to `av_int_list_length_for_size'
filter.c:(.text+0x407): undefined reference to `av_int_list_length_for_size'
filter.c:(.text+0x42d): undefined reference to `av_opt_set_bin'
filter.c:(.text+0x482): undefined reference to `av_int_list_length_for_size'
filter.c:(.text+0x4a4): undefined reference to `av_int_list_length_for_size'
filter.c:(.text+0x4ca): undefined reference to `av_opt_set_bin'
filter.c:(.text+0x51f): undefined reference to `av_int_list_length_for_size'
filter.c:(.text+0x541): undefined reference to `av_int_list_length_for_size'
filter.c:(.text+0x567): undefined reference to `av_opt_set_bin'
/tmp/cc90K2S5.o: In function `print_frame':
filter.c:(.text+0x76b): undefined reference to `av_frame_get_channel_layout'
/tmp/cc90K2S5.o: In function `main':
filter.c:(.text+0x831): undefined reference to `av_frame_alloc'
filter.c:(.text+0x83d): undefined reference to `av_frame_alloc'
filter.c:(.text+0x9de): undefined reference to `av_buffersrc_add_frame_flags'
filter.c:(.text+0xa16): undefined reference to `av_buffersink_get_frame'
filter.c:(.text+0xa58): undefined reference to `av_frame_unref'
filter.c:(.text+0xab6): undefined reference to `av_frame_free'
filter.c:(.text+0xac5): undefined reference to `av_frame_free'
collect2: error: ld returned 1 exit statusI understand that the undefined reference error indicates that it wasn't able to find the functions referenced from filtering_audio.c, but this doesn't make sense, since these functions should exist in the FFmpeg libraries.
Any help is appreciated, thank you !
-
Detect the type of an AVFrame instance
23 octobre 2017, par stefk0Given a pointer
pFrame
to a structure of typeAVFrame
, is there a proper way to determine the type of the structure, i.e. either audio or video ?One way might be to check whether
pFrame->nb_samples == 0
or not, but this doesn’t look right.