
Recherche avancée
Médias (1)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
Autres articles (41)
-
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 (...) -
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (4199)
-
Image classification in Video
31 mai 2015, par Tyrion LannisterI’m trying to apply some CovNets to a video. Can someone give some insight into a method for extracting still images into a zip file using Ruby ?
-
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.