
Recherche avancée
Autres articles (60)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)
Sur d’autres sites (7119)
-
ffmpeg library performance for decoding h.264 for embedded device
2 avril 2015, par pasifusI have some confuse when tried to compile and run decode h.264 on ARM and MIPS architecture.
I have two embedded devices. I tired to run simple code that read h264 format from file and decode it to h264 in loop in maximum speed (without sleep between frames)
I found that it too slow in there devices.
I tested HD video (720p/25fps)- MIPS32® 1004K (700MHz) it was 4 fps average.
- Raspberry Pi Model B (700MHz) it also was 4 fps average. (i know that raspberry have GPU to decoding/encoding)
A also check it on my virtual machine on ubuntu i686 (1300MHz) and it was 200 fps average.
The question : why it so different preference ? Somebody know how to increase decoding preference on MIPS32® 1004K architecture ?
#include
#include
#include
#include
#include <sys></sys>time.h>
#include
#include "libavcodec/avcodec.h"
#include "libavutil/mathematics.h"
#define INBUF_SIZE 80000
static long get_time_diff(struct timeval time_now) {
struct timeval time_now2;
gettimeofday(&time_now2,0);
return time_now2.tv_sec*1.e6 - time_now.tv_sec*1.e6 + time_now2.tv_usec - time_now.tv_usec;
}
int main(int argc, char **argv)
{
AVCodec *codec;
AVCodecContext *c= NULL;
AVCodecParserContext *parser = NULL;
int frame, got_picture, len2, len;
const char *filename;
FILE *f;
AVFrame *picture;
char *arghwtf = malloc(INBUF_SIZE);
uint64_t in_len;
int pts, dts;
struct timeval t,t2;
float inv_fps = 1e6/23.98;
AVPacket avpkt;
// register all the codecs
avcodec_register_all();
// log level
av_log_set_level(AV_LOG_PANIC|AV_LOG_FATAL|AV_LOG_ERROR|AV_LOG_WARNING);
filename = argv[1];
av_init_packet(&avpkt);
printf("Decoding file %s...\n", filename);
// find the H.264 video decoder
codec = avcodec_find_decoder(CODEC_ID_H264);
if (!codec)
{
fprintf(stderr, "codec not found\n");
exit(1);
}
c = avcodec_alloc_context3(codec);
picture = avcodec_alloc_frame();
// skiploopfilter=all
c->skip_loop_filter = 48;
AVDictionary* dictionary = NULL;
if (avcodec_open2(c, codec, &dictionary) < 0)
{
fprintf(stderr, "could not open codec\n");
exit(1);
}
// the codec gives us the frame size, in samples
parser = av_parser_init(c->codec_id);
parser->flags |= PARSER_FLAG_ONCE;
f = fopen(filename, "rb");
if (!f)
{
fprintf(stderr, "could not open %s\n", filename);
exit(1);
}
frame = 0;
gettimeofday(&t, 0);
if(fread(arghwtf, 1, INBUF_SIZE, f) == 0)
{
exit(1);
}
in_len = 80000;
gettimeofday(&t2, 0);
while (in_len > 0 && !feof(f))
{
len = av_parser_parse2(parser, c, &avpkt.data, &avpkt.size, arghwtf, in_len, pts, dts, AV_NOPTS_VALUE);
len2 = avcodec_decode_video2(c, picture, &got_picture, &avpkt);
if (len2 < 0) {
fprintf(stderr, "Error while decoding frame %d\n", frame);
exit(1);
}
if (got_picture)
{
fprintf(stderr, "\rDisplaying %c %dx%d :frame %3d (%02d:%03d)...", av_get_picture_type_char(picture->pict_type), c->width, c->height, frame, (int)(get_time_diff(t)/1000000), (int)((get_time_diff(t)/1000)%1000));
fflush(stderr);
frame++;
}
memcpy(arghwtf, arghwtf + len, 80000-len);
fread(arghwtf + 80000 - len, 1, len, f);
}
fclose(f);
avcodec_close(c);
av_free(c);
av_free(picture);
printf("\n");
printf("Avarage fps: %d\n", (int)(((double)frame)/(double)(get_time_diff(t)/1000)*1000));
return 0;
} -
Including ffmpeg in C program
20 mars 2015, par NickI’m using dranger’s ffmpeg tutorial :
http://dranger.com/ffmpeg/tutorial01.html
I’m stuck trying to compile the first tutorial. I downloaded ffmpeg using homebrew, but the compile command provided in the tutorial did not work :
gcc -o tutorial01 tutorial01.c -lavutil -lavformat -lavcodec -lz -lavutil -lm
Based on my experience with SDL, I made a separate file that simply included one of the ffmpeg headers, and changed the compile command to :
gcc main.c -I/usr/local/Cellar/ffmpeg/2.6.1/include
It was actually able to compile. But when I tried this with the tutorial file using this command :
gcc tutorial01.c -I/usr/local/Cellar/ffmpeg/2.6.1/include
I got these errors :
Undefined symbols for architecture x86_64:
"_av_dump_format", referenced from:
_main in tutorial01-9cd32b.o
"_av_frame_alloc", referenced from:
_main in tutorial01-9cd32b.o
"_av_frame_free", referenced from:
_main in tutorial01-9cd32b.o
"_av_free", referenced from:
_main in tutorial01-9cd32b.o
"_av_free_packet", referenced from:
_main in tutorial01-9cd32b.o
"_av_malloc", referenced from:
_main in tutorial01-9cd32b.o
"_av_read_frame", referenced from:
_main in tutorial01-9cd32b.o
"_av_register_all", referenced from:
_main in tutorial01-9cd32b.o
"_avcodec_alloc_context3", referenced from:
_main in tutorial01-9cd32b.o
"_avcodec_close", referenced from:
_main in tutorial01-9cd32b.o
"_avcodec_copy_context", referenced from:
_main in tutorial01-9cd32b.o
"_avcodec_decode_video2", referenced from:
_main in tutorial01-9cd32b.o
"_avcodec_find_decoder", referenced from:
_main in tutorial01-9cd32b.o
"_avcodec_open2", referenced from:
_main in tutorial01-9cd32b.o
"_avformat_close_input", referenced from:
_main in tutorial01-9cd32b.o
"_avformat_find_stream_info", referenced from:
_main in tutorial01-9cd32b.o
"_avformat_open_input", referenced from:
_main in tutorial01-9cd32b.o
"_avpicture_fill", referenced from:
_main in tutorial01-9cd32b.o
"_avpicture_get_size", referenced from:
_main in tutorial01-9cd32b.o
"_sws_getContext", referenced from:
_main in tutorial01-9cd32b.o
"_sws_scale", referenced from:
_main in tutorial01-9cd32b.oI figured I had to add the extra things from the tutorial, so I did
gcc tutorial01.c -I/usr/local/Cellar/ffmpeg/2.6.1/include -lavutil -lavformat -lavcodec -lz -lavutil -lm
But then I got this error
ld: library not found for -lavutil
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [all] Error 1I feel like the directory
/usr/local/Cellar/ffmpeg/2.6.1/lib
might be relevant, it includes the files :libavcodec.56.26.100.dylib libavresample.dylib
libavcodec.56.dylib libavutil.54.20.100.dylib
libavcodec.a libavutil.54.dylib
libavcodec.dylib libavutil.a
libavdevice.56.4.100.dylib libavutil.dylib
libavdevice.56.dylib libpostproc.53.3.100.dylib
libavdevice.a libpostproc.53.dylib
libavdevice.dylib libpostproc.a
libavfilter.5.11.102.dylib libpostproc.dylib
libavfilter.5.dylib libswresample.1.1.100.dylib
libavfilter.a libswresample.1.dylib
libavfilter.dylib libswresample.a
libavformat.56.25.101.dylib libswresample.dylib
libavformat.56.dylib libswscale.3.1.101.dylib
libavformat.a libswscale.3.dylib
libavformat.dylib libswscale.a
libavresample.2.1.0.dylib libswscale.dylib
libavresample.2.dylib pkgconfig
libavresample.aI’m often really lost trying to compile downloaded libraries (it took me a long time to get SDL to compile, and when I finally got it to work I still didn’t completely understand why).
If anyone could help me understand how these things work, and specifically help me compile this first tutorial, I would be extremely grateful.
Thank you for your time.
-
avcodec/vc1_mc : move median4() to mathops.h
14 février 2015, par zhaoxiu.zeng