
Recherche avancée
Médias (1)
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
Autres articles (46)
-
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 (...) -
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 (...) -
Demande de création d’un canal
12 mars 2010, parEn fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)
Sur d’autres sites (6543)
-
avfilter/vf_bwdif : Add neon for filter_intra
4 juillet 2023, par John Coxavfilter/vf_bwdif : Add neon for filter_intra
Adds an outline for aarch neon functions
Adds common macros and consts for aarch64 neon
Exports C filter_intra needed for tail fixup of neon code
Adds neon for filter_intraSigned-off-by : John Cox <jc@kynesim.co.uk>
Signed-off-by : Martin Storsjö <martin@martin.st> -
Decoding audio with FFMPEG
8 juillet 2012, par MarianoI am using FFMPEG to decode an audio file, but I am not able to do it.
AVFormatContext *pFormatCtx;
AVCodec *pCodec_audio;
AVCodecContext *aCodecCtx_audio = NULL;
AVPacket packet;
string outfilename = "salida.avi";
string filename = "john.wav";
int audioStream;
int out_size, len, size;
FILE *outfile;
int16_t *outbuf;
uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
avcodec_init();
/* register all the codecs */
av_register_all();
if(av_open_input_file(&pFormatCtx, filename.c_str(), NULL, 0, NULL) != 0) {
cerr << "Archivo no encontrado" << endl;
return -1; // Couldn't open file
}
if(av_find_stream_info(pFormatCtx) < 0) {
cerr << " No encontro el stream de info" << endl;
return -1;// Couldn't find stream information
}
dump_format(pFormatCtx, 0, filename.c_str(), 0);
for(unsigned int i=0; i < pFormatCtx->nb_streams; i++)
if(pFormatCtx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO)
audioStream = i;
aCodecCtx_audio = pFormatCtx->streams[audioStream]->codec;
pCodec_audio = avcodec_find_decoder(aCodecCtx_audio->codec_id);
if(pCodec_audio == NULL) {
cerr<< "Unsupported codec!" << endl;
return -1; // Codec not found
}
if(avcodec_open(aCodecCtx_audio, pCodec_audio) < 0) {
cerr << "No se pudo abrir el codec de audio" << endl;
return -1;
}
outbuf = (int16_t*) av_malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);
outfile = fopen(outfilename.c_str(), "wb");
if (!outfile) {
exit(1);
}
av_init_packet(&packet);
packet.data = inbuf;
while(av_read_frame(pFormatCtx, &packet) == 0) {
if(packet.stream_index == audioStream) {
size = packet.size;
if (size == 0) {
cerr << "Size = 0 " << endl;
break;
}
while(size > 0) {
out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
len = avcodec_decode_audio3(aCodecCtx_audio, outbuf, &out_size , &packet);
//av_free_packet(&packet);
cout << len << endl;
if(len == -1) {
cerr << "Error while decoding" << endl;
return 1;
}
if(out_size > 0) {
fwrite(outbuf, 1, out_size, outfile);
}
size -= len;
packet.data += len;
}
}
}
av_free_packet(&packet);
fclose(outfile);
free(outbuf);
cout << "END CODE" << endl;
avcodec_close(aCodecCtx_audio);
av_free(aCodecCtx_audio);In the code I am trying to decode an .wav file to a .avi file. The output file ("salida.avi") is created , but does not play.
-
How to create video using avcodec from jpeg images of type OpenCV::Mat ?
23 juillet 2015, par theateistI have colored jpeg images of
OpenCV::Mat
type and I create from them video usingavcodec
. The video that I get is upside-down, black & white and each row of each frame is shifted and I got diagonal line. What could be the reason for such output ?
Follow this link to watch the video I get using avcodec.
I’m usingacpicture_fill
function to createavFrame
fromcv::Mat
frame !P.S.
Each cv::Mat cvFrame has width=810, height=610, step=2432
I noticed that avFrame (that is filled by acpicture_fill) haslinesize[0]=2430
I tried manually settingavFrame->linesizep0]=2432
and not 2430 but it still didn’t helped.======== CODE =========================================================
AVCodec *encoder = avcodec_find_encoder(AV_CODEC_ID_H264);
AVStream *outStream = avformat_new_stream(outContainer, encoder);
avcodec_get_context_defaults3(outStream->codec, encoder);
outStream->codec->pix_fmt = AV_PIX_FMT_YUV420P;
outStream->codec->width = 810;
outStream->codec->height = 610;
//...
SwsContext *swsCtx = sws_getContext(outStream->codec->width, outStream->codec->height, PIX_FMT_RGB24,
outStream->codec->width, outStream->codec->height, outStream->codec->pix_fmt, SWS_BICUBIC, NULL, NULL, NULL);
for (uint i=0; i < frameNums; i++)
{
// get frame at location I using OpenCV
cv::Mat cvFrame;
myReader.getFrame(cvFrame, i);
cv::Size frameSize = cvFrame.size();
//Each cv::Mat cvFrame has width=810, height=610, step=2432
1. // create AVPicture from cv::Mat frame
2. avpicture_fill((AVPicture*)avFrame, cvFrame.data, PIX_FMT_RGB24, outStream->codec->width, outStream->codec->height);
3avFrame->width = frameSize.width;
4. avFrame->height = frameSize.height;
// rescale to outStream format
sws_scale(swsCtx, avFrame->data, avFrame->linesize, 0, outStream->codec->height, avFrameRescaledFrame->data, avFrameRescaledFrame ->linesize);
encoderRescaledFrame->pts=i;
avFrameRescaledFrame->width = frameSize.width;
avFrameRescaledFrame->height = frameSize.height;
av_init_packet(&avEncodedPacket);
avEncodedPacket.data = NULL;
avEncodedPacket.size = 0;
// encode rescaled frame
if(avcodec_encode_video2(outStream->codec, &avEncodedPacket, avFrameRescaledFrame, &got_frame) < 0) exit(1);
if(got_frame)
{
if (avEncodedPacket.pts != AV_NOPTS_VALUE)
avEncodedPacket.pts = av_rescale_q(avEncodedPacket.pts, outStream->codec->time_base, outStream->time_base);
if (avEncodedPacket.dts != AV_NOPTS_VALUE)
avEncodedPacket.dts = av_rescale_q(avEncodedPacket.dts, outStream->codec->time_base, outStream->time_base);
// outContainer is "mp4"
av_write_frame(outContainer, & avEncodedPacket);
av_free_packet(&encodedPacket);
}
}UPDATED
As @Alex suggested I changed the lines 1-4 with the code below
int width = frameSize.width, height = frameSize.height;
avpicture_alloc((AVPicture*)avFrame, AV_PIX_FMT_RGB24, outStream->codec->width, outStream->codec->height);
for (int h = 0; h < height; h++)
{
memcpy(&(avFrame->data[0][h*avFrame->linesize[0]]), &(cvFrame.data[h*cvFrame.step]), width*3);
}The video (here) I get now is almost perfect. It’s NOT upside-down, NOT black & white, BUT it seems that one of the RGB components is missing. Every brown/red colors became blue (in original images it should be vice-verse).
What could be the problem ? Could rescaling(sws_scale
) toAV_PIX_FMT_YUV420P
format causes this ?