
Recherche avancée
Autres articles (111)
-
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 (...) -
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 (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (13716)
-
libavutils : Add parse_r helper for MIPS
18 juillet 2020, par Jiaxun Yanglibavutils : Add parse_r helper for MIPS
That helper grab from kernel code can allow us to inline
newer instructions (not implemented by the assembler) in
a elegant manner.Signed-off-by : Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by : Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by : Michael Niedermayer <michael@niedermayer.cc> -
When using libva* (ffmpeg) encoded GIF images, an error is reported when compiling the demo
10 août 2023, par yangjinhui2936issuse : I need to use the GIF encoding feature in FFMPEG to encode argb images as gifs.Because the encoding effect of using GIF library is not as good as the effect of FFMPEG.
However, several libraries like avcodec were too bulky, so I did some cropping.I just want to keep the functionality of GIF encoding.
Below is my makefile for cropping ffmpeg :


#!/bin/sh
# ./configure --prefix=$(pwd)/output --arch=arm --target-os=linux --enable-cross-compile --disable-asm --cross-prefix=arm-linux-gnueabihf- 
./configure --prefix=$(pwd)/output --target-os=linux --disable-asm \
--disable-gpl --enable-nonfree --enable-error-resilience --enable-debug --enable-shared --enable-small --enable-zlib \
--disable-ffmpeg --disable-ffprobe --disable-ffplay --disable-programs --disable-symver\
 --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-decoder=h264 --enable-avformat \
 --disable-txtpages --enable-avcodec --enable-avutil \
 --disable-avresample --disable-avfilter --disable-avdevice --disable-postproc \
 --disable-swscale --enable-decoder=gif --enable-demuxer=gif --enable-muxer=gif --disable-iconv \
 --disable-v4l2-m2m --disable-indevs --disable-outdevs

make clean
make -j8

make install



Then link the compiled so to the gif demo.
Blew is gif demo code(He was automatically generated by chatgpt, and I want to verify it) :


#include 
// #include "output/include/imgutils.h"
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libavutil/avutil.h"

int main() {
 AVCodec *enc_codec;
 AVCodecContext *enc_ctx = NULL;
 AVStream *stream = NULL;
 int ret;

 AVFormatContext *fmt_ctx = avformat_alloc_context();
 if (!fmt_ctx) {
 fprintf(stderr, "Could not allocate format context\n");
 return 1;
 }
 
 AVInputFormat *input_fmt = av_find_input_format("image2");
 if ((ret = avformat_open_input(&fmt_ctx, "input.bmp", input_fmt, NULL)) < 0) {
 fprintf(stderr, "Could not open input file %d\n", ret);
 return ret;
 }

 AVCodec *dec_codec = avcodec_find_decoder(AV_CODEC_ID_BMP);
 if (!dec_codec) {
 fprintf(stderr, "Decoder not found\n");
 return 1;
 }
 
 AVCodecContext *dec_ctx = avcodec_alloc_context3(dec_codec);
 if (!dec_ctx) {
 fprintf(stderr, "Could not allocate decoder context\n");
 return 1;
 }

 if ((ret = avcodec_open2(dec_ctx, dec_codec, NULL)) < 0) {
 fprintf(stderr, "Could not open decoder\n");
 return 1;
 }

 AVOutputFormat *out_fmt = av_guess_format("gif", NULL, NULL);
 if (!out_fmt) {
 fprintf(stderr, "Could not find output format\n");
 return 1;
 }

 AVFormatContext *out_ctx = NULL;
 if ((ret = avformat_alloc_output_context2(&out_ctx, out_fmt, NULL, NULL)) < 0) {
 fprintf(stderr, "Could not allocate output context\n");
 return 1;
 }

 stream = avformat_new_stream(out_ctx, NULL);
 if (!stream) {
 fprintf(stderr, "Could not create new stream\n");
 return 1;
 }

 enc_codec = avcodec_find_encoder(AV_CODEC_ID_GIF);
 if (!enc_codec) {
 fprintf(stderr, "Encoder not found\n");
 return 1;
 }

 enc_ctx = avcodec_alloc_context3(enc_codec);
 if (!enc_ctx) {
 fprintf(stderr, "Could not allocate encoder context\n");
 return 1;
 }

 if ((ret = avcodec_parameters_from_context(stream->codecpar, dec_ctx)) < 0) {
 fprintf(stderr, "Could not copy decoder parameters\n");
 return 1;
 }

 if ((ret = avcodec_open2(enc_ctx, enc_codec, NULL)) < 0) {
 fprintf(stderr, "Could not open encoder\n");
 return 1;
 }
 
 enc_ctx->pix_fmt = AV_PIX_FMT_RGB8; 
 enc_ctx->width = dec_ctx->width; 
 enc_ctx->height = dec_ctx->height; 
 enc_ctx->time_base = (AVRational){1, 25}; 

 avformat_init_output(out_ctx, NULL);

 if (!(out_fmt->flags & AVFMT_NOFILE)) {
 if ((ret = avio_open(&out_ctx->pb, "output.gif", AVIO_FLAG_WRITE)) < 0) {
 fprintf(stderr, "Could not open output file\n");
 return ret;
 }
 }

 avformat_write_header(out_ctx, NULL);

 AVFrame *frame = av_frame_alloc();
 AVPacket pkt;
 int frame_count = 0;

 while (av_read_frame(fmt_ctx, &pkt) >= 0) {
 avcodec_send_packet(dec_ctx, &pkt);
 while (avcodec_receive_frame(dec_ctx, frame) == 0) {
 avcodec_send_frame(enc_ctx, frame);
 while (avcodec_receive_packet(enc_ctx, &pkt) == 0) {
 pkt.stream_index = stream->index;
 av_interleaved_write_frame(out_ctx, &pkt);
 av_packet_unref(&pkt);
 }

 frame_count++;
 printf("Encoded frame %d\n", frame_count);
 }
 av_packet_unref(&pkt);
 }

 av_write_trailer(out_ctx);

 avcodec_close(enc_ctx);
 avcodec_free_context(&enc_ctx);
 avcodec_close(dec_ctx);
 avcodec_free_context(&dec_ctx);
 av_frame_free(&frame);

 avformat_close_input(&fmt_ctx);
 avformat_free_context(fmt_ctx);
 avio_close(out_ctx->pb);
 avformat_free_context(out_ctx);

 return 0;
}




Belw is shell of compile script for gif :


#!/bin/sh
gcc -o x2gif x2gif.c -L ./output/lib/ -l:libavformat.a -l:libavcodec.a -l:libavutil.a -lz -I ./output/include/



Unfortunately, the compilation did not pass.
How can I troubleshoot and resolve this issue ?


./output/lib/libavutil.a(lfg.o): In function `av_bmg_get':
/data1/yang/tool/ffmpeg-3.4.4/libavutil/lfg.c:59: undefined reference to `log'
./output/lib/libavutil.a(hwcontext_cuda.o): In function `cuda_free_functions':
/data1/yang/tool/ffmpeg-3.4.4/./compat/cuda/dynlink_loader.h:175: undefined reference to `dlclose'
./output/lib/libavutil.a(hwcontext_cuda.o): In function `cuda_load_functions':
/data1/yang/tool/ffmpeg-3.4.4/./compat/cuda/dynlink_loader.h:192: undefined reference to `dlopen'
/data1/yang/tool/ffmpeg-3.4.4/./compat/cuda/dynlink_loader.h:194: undefined reference to `dlsym'
/data1/yang/tool/ffmpeg-3.4.4/./compat/cuda/dynlink_loader.h:195: undefined reference to `dlsym'
/data1/yang/tool/ffmpeg-3.4.4/./compat/cuda/dynlink_loader.h:196: undefined reference to `dlsym'
/data1/yang/tool/ffmpeg-3.4.4/./compat/cuda/dynlink_loader.h:197: undefined reference to `dlsym'
/data1/yang/tool/ffmpeg-3.4.4/./compat/cuda/dynlink_loader.h:198: undefined reference to `dlsym'
./output/lib/libavutil.a(hwcontext_cuda.o):/data1/yang/tool/ffmpeg-3.4.4/./compat/cuda/dynlink_loader.h:199: more undefined references to `dlsym' follow
./output/lib/libavutil.a(rational.o): In function `av_d2q':
/data1/yang/tool/ffmpeg-3.4.4/libavutil/rational.c:120: undefined reference to `floor'
./output/lib/libavutil.a(eval.o): In function `eval_expr':
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:184: undefined reference to `exp'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:185: undefined reference to `exp'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:189: undefined reference to `floor'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:190: undefined reference to `ceil'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:191: undefined reference to `trunc'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:192: undefined reference to `round'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:263: undefined reference to `pow'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:300: undefined reference to `floor'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:309: undefined reference to `pow'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:315: undefined reference to `hypot'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:316: undefined reference to `atan2'
./output/lib/libavutil.a(eval.o): In function `ff_exp10':
/data1/yang/tool/ffmpeg-3.4.4/libavutil/ffmath.h:44: undefined reference to `exp2'
./output/lib/libavutil.a(eval.o): In function `parse_primary':
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:417: undefined reference to `sinh'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:418: undefined reference to `cosh'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:419: undefined reference to `tanh'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:420: undefined reference to `sin'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:421: undefined reference to `cos'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:422: undefined reference to `tan'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:423: undefined reference to `atan'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:424: undefined reference to `asin'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:425: undefined reference to `acos'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:426: undefined reference to `exp'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:427: undefined reference to `log'
/data1/yang/tool/ffmpeg-3.4.4/libavutil/eval.c:428: undefined reference to `fabs'



-
Anomalie #4513 (Fermé) : Undefined au post d’un message de forum public
6 juillet 2021, par cedric -