Recherche avancée
Médias (1)
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (17)
-
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...) -
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 (...) -
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)
Sur d’autres sites (5051)
-
cant install ffpmeg- php on centos 5.7 [closed]
13 avril 2012, par Hosseini have already installed ffmpeg on my centos 5.7, but whenever i try to install ffmpeg-php i fail to do it . everytime i get to the make section i get these errors :
/bin/sh /usr/src/ffmphp/ffmpeg-php-0.6.0/libtool --mode=compile cc -I. -I/usr/src/ffmphp/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/src/ffmphp/ffmpeg-php-0.6.0/include -I/usr/src/ffmphp/ffmpeg-php-0.6.0/main -I/usr/src/ffmphp/ffmpeg-php-0.6.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c -o ffmpeg_frame.lo
cc -I. -I/usr/src/ffmphp/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/src/ffmphp/ffmpeg-php-0.6.0/include -I/usr/src/ffmphp/ffmpeg-php-0.6.0/main -I/usr/src/ffmphp/ffmpeg-php-0.6.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c -fPIC -DPIC -o .libs/ffmpeg_frame.o
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:50:1: warning: "/*" within comment
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:73: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:74: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ffmpeg_frame_class_entry'
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:79: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ffmpeg_frame_class_methods'
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:102: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:127: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:145: error: expected ')' before '*' token
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:160: error: expected ')' before '*' token
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function 'register_ffmpeg_frame_class':
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:173: warning: implicit declaration of function 'TSRMLS_FETCH'
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:175: warning: implicit declaration of function 'zend_register_list_destructors_ex'
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:175: error: '_php_free_ffmpeg_frame' undeclared (first use in this function)
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:175: error: (Each undeclared identifier is reported only once
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:175: error: for each function it appears in.)
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:176: error: 'NULL' undeclared (first use in this function)
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:178: warning: implicit declaration of function 'INIT_CLASS_ENTRY'
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:178: error: 'ffmpeg_frame_class_entry' undeclared (first use in this function)
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:179: error: 'ffmpeg_frame_class_methods' undeclared (first use in this function)
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:182: error: 'ffmpeg_frame_class_entry_ptr' undeclared (first use in this function)
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:183: warning: implicit declaration of function 'zend_register_internal_class'
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:183: error: expected ')' before 'TSRMLS_CC'
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c: At top level:
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:190: error: expected ')' before '*' token
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:446: warning: return type defaults to 'int'
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function 'FFMPEG_PHP_METHOD':
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:447: error: 'ff_frame_context' undeclared (first use in this function)
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:447: error: 'ff_frame' undeclared (first use in this function)
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:449: warning: implicit declaration of function 'GET_FRAME_RESOURCE'
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:449: warning: implicit declaration of function 'getThis'
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:451: warning: implicit declaration of function 'RETURN_DOUBLE'
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:451: error: 'AV_TIME_BASE' undeclared (first use in this function)
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c: At top level:
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:459: warning: return type defaults to 'int'
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:459: error: redefinition of 'FFMPEG_PHP_METHOD'
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:446: error: previous definition of 'FFMPEG_PHP_METHOD' was here
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function 'FFMPEG_PHP_METHOD':
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:460: error: 'ff_frame_context' undeclared (first use in this function)
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:460: error: 'ff_frame' undeclared (first use in this function)
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:464: warning: implicit declaration of function 'RETURN_LONG'
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c: At top level:
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:472: warning: return type defaults to 'int'
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:472: error: redefinition of 'FFMPEG_PHP_METHOD'
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:446: error: previous definition of 'FFMPEG_PHP_METHOD' was here
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function 'FFMPEG_PHP_METHOD':
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:473: error: 'ff_frame_context' undeclared (first use in this function)
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:473: error: 'ff_frame' undeclared (first use in this function)
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c: At top level:
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:485: warning: return type defaults to 'int'
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:485: error: redefinition of 'FFMPEG_PHP_METHOD'
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:446: error: previous definition of 'FFMPEG_PHP_METHOD' was here
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function 'FFMPEG_PHP_METHOD':
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:486: error: 'ff_frame_context' undeclared (first use in this function)
/usr/src/ffmphp/ffmpeg-php-0.6.0/ffmpeg_frame.c:486: error: 'ff_frame' undeclared (first use in this function)
make: *** [ffmpeg_frame.lo] Error 1i read that if i get the
make: *** [ffmpeg_frame.lo] Error 1error , i replace all *PIX_FMT_RGBA32* with *PIX_FMT_RGB32* inside *ffmpeg_frame.c*. but when i search the file , there is no *PIX_FMT_RGBA32* . there are all PIX_FMT_RGB32 ! .
so i have no idea what is wrong with it .
can anyone please help me get this going ?
Thanks in advance
Edited :
Thanks to God , i finally found the cause of the problem .
when i was trying to replace PIX_FMT_RGBA32 with PIX_FMT_RGB32 inside ffmpeg_frame.c* using VI i mistakenly messed the source code (the ffmpeg_frame.c) and removed a comment sign (*/ ) and that messed just everything :)
i re extracted all files and then replaced all PIX_FMT_RGBA32 with PIX_FMT_RGB32 and everything compiles just fine :) -
Android : How to play MP3 files with ID3 tags using FFMPEG
16 juillet 2012, par Vipul PurohitI am trying to play various sound files using FFMPEG lib in android. I have managed to play most files but some file
Example : MP3 files with ID3 tagare not playing. I tried playing files by taking reference of various example but didn't get any success.Here is my native side code :
#include
#include
#include
#include <android></android>log.h>
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#define LOG_TAG "mylib"
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
#define AUDIO_INBUF_SIZE 20480
#define AUDIO_REFILL_THRESH 4096
void Java_ru_dzakhov_ffmpeg_test_MainActivity_createEngine(JNIEnv* env, jclass clazz)
{
avcodec_init();
av_register_all();
}
jstring Java_ru_dzakhov_ffmpeg_test_MainActivity_loadFile(JNIEnv* env, jobject obj,jstring file,jbyteArray array)
{
{
jboolean isfilenameCopy;
const char * filename = (*env)->GetStringUTFChars(env, file, &isfilenameCopy);
int audioStreamIndex;
AVCodec *codec;
AVCodecContext *c= NULL;
AVFormatContext * pFormatCtx;
AVCodecContext * aCodecCtx;
int out_size, len, audioStream=-1, i, err;
FILE *f, *outfile;
uint8_t *outbuf;
uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
AVPacket avpkt;
jclass cls = (*env)->GetObjectClass(env, obj);
jmethodID play = (*env)->GetMethodID(env, cls, "playSound", "([BI)V");//At the begining of your main function
LOGE("source file name is %s", filename);
avcodec_init();
av_register_all();
LOGE("Stage 1");
/* get format somthing of source file to AVFormatContext */
int lError;
if ((lError = av_open_input_file(&pFormatCtx, filename, NULL, 0, NULL)) !=0 ) {
LOGE("Error open source file: %d", lError);
exit(1);
}
if ((lError = av_find_stream_info(pFormatCtx)) < 0) {
LOGE("Error find stream information: %d", lError);
exit(1);
}
LOGE("Stage 1.5");
LOGE("audio format: %s", pFormatCtx->iformat->name);
LOGE("audio bitrate: %d", pFormatCtx->bit_rate);
audioStreamIndex = av_find_best_stream(pFormatCtx, AVMEDIA_TYPE_AUDIO, -1, -1, &codec, 0);
// audioStreamIndex=-1;
// LOGE("nb_stream %d", pFormatCtx->nb_streams);
// for(i=0; inb_streams; i++)
// {
// LOGE("nb_stream %d", pFormatCtx->nb_streams);
// if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_AUDIO)
// {
// audioStream=i;
// break;
// }
// }
//
// if(audioStream==-1)
// {
// LOGE("Cannot find audio");
// }
LOGE("audioStreamIndex %d", audioStreamIndex);
// if (audioStreamIndex == AVERROR_STREAM_NOT_FOUND) {
// LOGE(1, "cannot find a audio stream");
// exit(1);
// } else if (audioStreamIndex == AVERROR_DECODER_NOT_FOUND) {
// LOGE(1, "audio stream found, but no decoder is found!");
// exit(1);
// }
LOGE("audio codec: %s", codec->name);
/* get codec somthing of audio stream to AVCodecContext */
aCodecCtx = pFormatCtx->streams[audioStreamIndex]->codec;
if (avcodec_open(aCodecCtx, codec) < 0) {
LOGE("cannot open the audio codec!");
exit(1);
}
printf("Audio decoding\n");
LOGE("Stage 1.7");
LOGE("S");
codec = avcodec_find_decoder(aCodecCtx->codec_id);
LOGE("Stage 1.8");
if (!codec) {
LOGE("codec not found\n");
exit(1);
}
LOGE("Stage 2");
// c= avcodec_alloc_context();
LOGE("Stage 3");
/* open it */
if (avcodec_open(aCodecCtx, codec) < 0) {
LOGE("could upper");
fprintf(stderr, "could not open codec\n");
LOGE("could not open codec");
}
LOGE("Stage 4");
outbuf = malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);
f = fopen(filename, "rb");
if (!f) {
fprintf(stderr, "could not open %s\n", filename);
LOGE("could not open");
exit(1);
}
/* decode until eof */
avpkt.data = inbuf;
avpkt.size = fread(inbuf, 1, AUDIO_INBUF_SIZE, f);
LOGE("Stage 5");
while (avpkt.size > 0) {
// LOGE("Stage 6");
out_size = (AVCODEC_MAX_AUDIO_FRAME_SIZE/3)*2;
len = avcodec_decode_audio3(aCodecCtx, (int16_t *)outbuf, &out_size, &avpkt);
LOGE("data_size %d len %d", out_size, len);
if (len < 0) {
fprintf(stderr, "Error while decoding\n");
LOGE("DECODING ERROR");
LOGE("DECODING ERROR %d", len);
exit(1);
}
// LOGE("Stage 7");
if (out_size > 0) {
/* if a frame has been decoded, output it */
// LOGE("Stage 8");
jbyte *bytes = (*env)->GetByteArrayElements(env, array, NULL);
memcpy(bytes, outbuf, out_size); //
(*env)->ReleaseByteArrayElements(env, array, bytes, 0);
(*env)->CallVoidMethod(env, obj, play, array, out_size);
// LOGE("DECODING ERROR5");
}
LOGE("Stage 9");
avpkt.size -= len;
avpkt.data += len;
if (avpkt.size < AUDIO_REFILL_THRESH) {
/* Refill the input buffer, to avoid trying to decode
* incomplete frames. Instead of this, one could also use
* a parser, or use a proper container format through
* libavformat. */
memmove(inbuf, avpkt.data, avpkt.size);
avpkt.data = inbuf;
len = fread(avpkt.data + avpkt.size, 1,
AUDIO_INBUF_SIZE - avpkt.size, f);
if (len > 0)
avpkt.size += len;
}
}
LOGE("Stage 12");
fclose(f);
free(outbuf);
avcodec_close(c);
av_free(c);
}
}Sorry for a rough code but I am testing on this code.
I found the reason that the mp3 file has ID3 info, but I don't handle this, all the ID3 info data is decode as frame data, so the right frame header sign 0xFFE00000 can't be found and the method "avcodec_decode_audio3" return -1.
I found this in question mp3 decoding using ffmpeg API (Header missing)
If anyone can help me handle and play file with ID3 tags in MP3 and similar for other formats.
-
ARM inline asm secrets
Although I generally recommend against using GCC inline assembly, preferring instead pure assembly code in separate files, there are occasions where inline is the appropriate solution. Should one, at a time like this, turn to the GCC documentation for guidance, one must be prepared for a degree of disappointment. As it happens, much of the inline asm syntax is left entirely undocumented. This article attempts to fill in some of the blanks for the ARM target.
Constraints
Each operand of an inline asm block is described by a constraint string encoding the valid representations of the operand in the generated assembly. For example the “r” code denotes a general-purpose register. In addition to the standard constraints, ARM allows a number of special codes, only some of which are documented. The full list, including a brief description, is available in the constraints.md file in the GCC source tree. The following table is an extract from this file consisting of the codes which are meaningful in an inline asm block (a few are only useful in the machine description itself).
f Legacy FPA registers f0-f7. t The VFP registers s0-s31. v The Cirrus Maverick co-processor registers. w The VFP registers d0-d15, or d0-d31 for VFPv3. x The VFP registers d0-d7. y The Intel iWMMX co-processor registers. z The Intel iWMMX GR registers. l In Thumb state the core registers r0-r7. h In Thumb state the core registers r8-r15. j A constant suitable for a MOVW instruction. (ARM/Thumb-2) b Thumb only. The union of the low registers and the stack register. I In ARM/Thumb-2 state a constant that can be used as an immediate value in a Data Processing instruction. In Thumb-1 state a constant in the range 0 to 255. J In ARM/Thumb-2 state a constant in the range -4095 to 4095. In Thumb-1 state a constant in the range -255 to -1. K In ARM/Thumb-2 state a constant that satisfies the I constraint if inverted. In Thumb-1 state a constant that satisfies the I constraint multiplied by any power of 2. L In ARM/Thumb-2 state a constant that satisfies the I constraint if negated. In Thumb-1 state a constant in the range -7 to 7. M In Thumb-1 state a constant that is a multiple of 4 in the range 0 to 1020. N Thumb-1 state a constant in the range 0 to 31. O In Thumb-1 state a constant that is a multiple of 4 in the range -508 to 508. Pa In Thumb-1 state a constant in the range -510 to +510 Pb In Thumb-1 state a constant in the range -262 to +262 Ps In Thumb-2 state a constant in the range -255 to +255 Pt In Thumb-2 state a constant in the range -7 to +7 G In ARM/Thumb-2 state a valid FPA immediate constant. H In ARM/Thumb-2 state a valid FPA immediate constant when negated. Da In ARM/Thumb-2 state a const_int, const_double or const_vector that can be generated with two Data Processing insns. Db In ARM/Thumb-2 state a const_int, const_double or const_vector that can be generated with three Data Processing insns. Dc In ARM/Thumb-2 state a const_int, const_double or const_vector that can be generated with four Data Processing insns. This pattern is disabled if optimizing for space or when we have load-delay slots to fill. Dn In ARM/Thumb-2 state a const_vector which can be loaded with a Neon vmov immediate instruction. Dl In ARM/Thumb-2 state a const_vector which can be used with a Neon vorr or vbic instruction. DL In ARM/Thumb-2 state a const_vector which can be used with a Neon vorn or vand instruction. Dv In ARM/Thumb-2 state a const_double which can be used with a VFP fconsts instruction. Dy In ARM/Thumb-2 state a const_double which can be used with a VFP fconstd instruction. Ut In ARM/Thumb-2 state an address valid for loading/storing opaque structure types wider than TImode. Uv In ARM/Thumb-2 state a valid VFP load/store address. Uy In ARM/Thumb-2 state a valid iWMMX load/store address. Un In ARM/Thumb-2 state a valid address for Neon doubleword vector load/store instructions. Um In ARM/Thumb-2 state a valid address for Neon element and structure load/store instructions. Us In ARM/Thumb-2 state a valid address for non-offset loads/stores of quad-word values in four ARM registers. Uq In ARM state an address valid in ldrsb instructions. Q In ARM/Thumb-2 state an address that is a single base register. Operand codes
Within the text of an inline asm block, operands are referenced as %0, %1 etc. Register operands are printed as rN, memory operands as [rN, #offset], and so forth. In some situations, for example with operands occupying multiple registers, more detailed control of the output may be required, and once again, an undocumented feature comes to our rescue.
Special code letters inserted between the % and the operand number alter the output from the default for each type of operand. The table below lists the more useful ones.
c An integer or symbol address without a preceding # sign B Bitwise inverse of integer or symbol without a preceding # L The low 16 bits of an immediate constant m The base register of a memory operand M A register range suitable for LDM/STM H The highest-numbered register of a pair Q The least significant register of a pair R The most significant register of a pair P A double-precision VFP register p The high single-precision register of a VFP double-precision register q A NEON quad register e The low doubleword register of a NEON quad register f The high doubleword register of a NEON quad register h A range of VFP/NEON registers suitable for VLD1/VST1 A A memory operand for a VLD1/VST1 instruction y S register as indexed D register, e.g. s5 becomes d2[1]