
Recherche avancée
Médias (91)
-
Richard Stallman et le logiciel libre
19 octobre 2011, par
Mis à jour : Mai 2013
Langue : français
Type : Texte
-
Stereo master soundtrack
17 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
-
Elephants Dream - Cover of the soundtrack
17 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
#7 Ambience
16 octobre 2011, par
Mis à jour : Juin 2015
Langue : English
Type : Audio
-
#6 Teaser Music
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#5 End Title
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
Autres articles (62)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (8095)
-
Revision 96418 : Le plug est pour spip 3.0.1 mini, donc j’ajoute la borne mini à médias ...
3 avril 2016, par spip.franck@… — LogLe plug est pour spip 3.0.1 mini, donc j’ajoute la borne mini à médias en mettant 2.7.27 (version native à spip 3.0.1) http://zone.spip.org/trac/spip-zone/browser/_core_/tags/spip-3.0.1/plugins/medias/paquet.xml
L’unique intérêt de ce commit est de faire en sorte que les gens qui consultent le xml sur plugin.spip est une info fiable -
Qt WinRT App cannot access file permission denied
23 février 2016, par HarisI need to develop WinRT App using Qt and FFMPEG, I build the ffmpeg for WinRT based on the instruction here and I am able to link the library with my project. Now I need to open a video file using
avformat_open_input
but it always giving me the outputvideo decode error "Permission denied"
Below is the relevant part of the code,
int ret = avformat_open_input(&pFormatCtx, hls, NULL, NULL);
if(ret != 0)
{
char errbuf[128];
av_strerror(ret, errbuf, 128);
qDebug()<<"video decode error"<code>From the above error it seems some permission issue, do I need to add any additional permission on
AppxManifest.xml
currently I am using default manifest which is created by Qt creator. -
libavcodec/ffmpeg reports two channels when decoding, but segfaults when trying to access the second
1er décembre 2017, par AstrognomeI am attempting to decode an audio file into raw pcm data using FFMpeg’s libavcodec. I have the following code so far, but it segfaults when trying to access the second audio channel for some reason.
#include
#include
#include <ao></ao>ao.h>
#include
#include <libavutil></libavutil>opt.h>
#include <libavcodec></libavcodec>avcodec.h>
#include <libavformat></libavformat>avformat.h>
#include <libswresample></libswresample>swresample.h>
#define BUF_SIZE 4096
#define AUDIO_INBUF_SIZE 20480
#define AUDIO_REFILL_THRESH 4096
int decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, uint8_t* out_data, int* index) {
int i, ch;
int ret, data_size;
ret = avcodec_send_packet(dec_ctx, pkt);
if (ret < 0) {
fprintf(stderr, "Error submitting packet to decoder\n");
exit(1);
}
while (ret >= 0) {
ret = avcodec_receive_frame(dec_ctx, frame);
if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {
return 0;
}
else if (ret < 0) {
fprintf(stderr, "Error during decoding\n");
exit(1);
}
data_size = av_get_bytes_per_sample(dec_ctx->sample_fmt);
if (data_size < 0) {
fprintf(stderr, "Failed to calculate data size\n");
exit(1);
}
for (i = 0; i < frame->nb_samples; ++i)
for (ch = 0; ch < dec_ctx->channels; ++ch) {
//Things go wrong here...
memcpy(out_data + *index, frame->data[ch] + (data_size*i), data_size);
*index += data_size;
}
}
return 0;
}
int decode_audio_file(const char* path, uint8_t* out_data, int size) {
const AVCodec *codec;
AVCodecContext *c = NULL;
AVCodecParserContext *parser = NULL;
int len, ret;
FILE *f;
uint8_t inbuf[AUDIO_INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
uint8_t *data;
size_t data_size;
AVPacket *pkt;
AVFrame *decoded_frame = NULL;
avcodec_register_all();
pkt = av_packet_alloc();
codec = avcodec_find_decoder(AV_CODEC_ID_FLAC);
if (!codec) {
fprintf(stderr, "Codec not found!\n");
return -1;
}
parser = av_parser_init(codec->id);
if (!parser) {
fprintf(stderr, "Parser not found!\n");
return -1;
}
c = avcodec_alloc_context3(codec);
if (!c) {
fprintf(stderr, "Could not allocate audio context!\n");
return -1;
}
if(avcodec_open2(c, codec, NULL) < 0) {
fprintf(stderr, "Could not open codec\n");
exit(1);
}
f = fopen(path, "rb");
if(!f) {
fprintf(stderr, "Could not open %s\n", path);
exit(1);
}
data = inbuf;
data_size = fread(inbuf, 1, AUDIO_INBUF_SIZE, f);
int index = 0;
while (data_size > 0) {
if (!decoded_frame) {
if (!(decoded_frame = av_frame_alloc())) {
fprintf(stderr, "Could not allocate audio frame\n");
exit(1);
}
}
ret = av_parser_parse2(parser, c, &pkt->data, &pkt->size, data, data_size, AV_NOPTS_VALUE, AV_NOPTS_VALUE, 0);
if (ret < 0) {
fprintf(stderr, "Error while parsing\n");
exit(1);
}
data += ret;
data_size -= ret;
if (pkt->size)
decode(c, pkt, decoded_frame, out_data, &index);
if (data_size < AUDIO_REFILL_THRESH) {
memmove(inbuf, data, data_size);
data = inbuf;
len = fread(data + data_size, 1, AUDIO_INBUF_SIZE - data_size, f);
if (len > 0)
data_size += len;
}
}
avcodec_free_context(&c);
av_parser_close(parser);
av_frame_free(&decoded_frame);
av_packet_free(&pkt);
return 0;
}
int main(int argc, char **argv)
{
int bsize = 1024*1024*60;
uint8_t* audio_buffer = calloc(bsize, sizeof(uint8_t));
decode_audio_file("testsong.flac", audio_buffer, bsize);
}Here is the offending line :
memcpy(out_data + *index, frame->data[ch] + (data_size*i), data_size);
If you access
frame->data[0]
it’s fine, but if you attempt to accessframe->data[1]
it segfaults. The context reports two channels and the file contains two channels (tried with several different tracks).
But it gets even weirder. If I switch the offending line tomemcpy(out_data + *index, frame->data[0] + (data_size*i*2 + ch), data_size);
it will have the left channel with correct data and the right channel is white noise.
This tells me (and I could be wrong) that the first channel actually contains 2 channels of audio interleaved, the actual left channel, plus a junk channel of white noise.
I was wrong, I forgot to multiplech
bydata_size
. If the line ismemcpy(out_data + *index, frame->data[0] + (data_size*i*2 + ch*data_size), data_size);
things seem to work as expected. This all still seems very sketchy though so if anyone can thoroughly explain what’s happening here, that would be nice.I have been working off the decode_audio example available in the ffmpeg documentation here although modified slightly.
This ALSO happens if I use the vanilla example with the only change being setting the codec to FLAC, so I assume it’s a bug in the library. In that case, how can I work around it.