
Recherche avancée
Médias (33)
-
Stereo master soundtrack
17 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
-
#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
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
Autres articles (32)
-
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
Diogene : création de masques spécifiques de formulaires d’édition de contenus
26 octobre 2010, parDiogene est un des plugins ? SPIP activé par défaut (extension) lors de l’initialisation de MediaSPIP.
A quoi sert ce plugin
Création de masques de formulaires
Le plugin Diogène permet de créer des masques de formulaires spécifiques par secteur sur les trois objets spécifiques SPIP que sont : les articles ; les rubriques ; les sites
Il permet ainsi de définir en fonction d’un secteur particulier, un masque de formulaire par objet, ajoutant ou enlevant ainsi des champs afin de rendre le formulaire (...) -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)
Sur d’autres sites (4769)
-
Audio object type 3 is not supported
3 octobre 2013, par ArdoramorI am running into an issue with a custom-built ffmpeg. Basically, its a vanilla ffmpeg with x264 and fdk-aac libs enabled. I am feeding an SDP file through ffmpeg API and get the following error while passing the info to
avcodec_open2
:Audio object type 3 is not supported
My SDP file :
v=0
o=- 0 0 IN IP4 127.0.0.1
s=Unnamed
i=N/A
c=IN IP4 192.168.1.1
t=0 0
a=recvonly
m=audio 8204 RTP/AVP 96
a=rtpmap:96 mpeg4-generic/32000
a=fmtp:96 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=1a88; SizeLength=13; IndexLength=3; IndexDeltaLength=3;
a=control:trackID=0
m=video 8202 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=428028;sprop-parameter-sets=Z0KAKJWgKA9E,aM48gA==;
a=control:trackID=1
m=application 8206 RTP/AVP 96
a=rtpmap:96 smpte336m/10
a=control:trackID=2The following is the output I get from ffmpeg as I open the input, dump its format, and try to open input streams :
Format sdp probed with size=2048 and score=50
audio codec set to : aac
audio samplerate set to : 32000
audio channels set to : 1
video codec set to : h264
RTP Packetization Mode : 1
RTP Profile IDC : 42 Profile IOP : 80 Level : 28
Extradata set to 0xc8d3dc0 (size : 21) !
File position before avformat_find_stream_info() is 522
Audio object type 3 is not supported.
Could not find codec parameters for stream 1 (Video : h264) : unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
File position after avformat_find_stream_info() is 522
Dumping input AV format
Input #0, sdp, from 'conf/test.sdp' :Metadata :
title :Unnamed
comment :N/ADuration:N/A, bitrate:N/A
Stream #0:0, 0, 1/32000: Audio: aac, 32000 Hz, 1 channels, fltp
Stream #0:1, 0, 1/90000: Video: h264, 90k tbr, 90k tbn, 180k tbc
Stream #0:2, 0, 1/90000: Data: none, 0/1Audio object type 3 is not supported.
I also see the error reported for not finding codec parameters for stream 1 :
Could not find codec parameters for stream 1 (Video : h264) : unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' optionsHowever, I think that is due to me not running an actual rtp at the moment of the test.
In any case, what may be the reason for getting audio object type 3 not supported exception ?
UPDATE - Oct 02, 2013
Static ffmpeg build gives the following flags :
Static ffmpeg 2.0.1 build flag output :
ffmpeg version 2.0.1 Copyright (c) 2000-2013 the FFmpeg developers
built on Sep 30 2013 22:24:00 with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-54)
configuration: --enable-gpl --enable-nonfree --enable-shared
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --enable-runtime-cpudetect --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-avfilter --enable-pthreads --enable-x11grab --enable-vdpau --disable-avisynth --enable-libdc1394 --enable-libfaac --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libx264 --enable-libxavs --enable-libxvid --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --disable-strippingMy build is from ffmpeg 2.0.1 snapshot with the following flags :
--enable-static --disable-shared --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfaac --enable-libmp3lame --enable-libx264 --disable-symver --disable-doc --disable-ffplay --enable-ffmpeg --disable-ffprobe --disable-ffserver --disable-avdevice --disable-avfilter --disable-filters --disable-devices --disable-everything --enable-avformat --enable-avcodec --enable-muxers --enable-protocols --enable-parsers --enable-demuxers --enable-decoders --enable-encoders --enable-bsfs --enable-network --enable-swscale --disable-demuxer=sbg --disable-demuxer=dts --disable-parser=dca --disable-decoder=dca --enable-asm --enable-pthreads --enable-version3
The fdk-aac library version I'm using :
fdk-aac - 0.1.2
So it seems that the same .sdp file causes Audio object type 3 error with my build but not with static but I really do not see what causes it (granted I am not an expert with ffmpeg API and may simply miss important details).
Simplified code for opening .sdp file that doesn't include error checks and logic separation :
AVFormatContext *inputContext = NULL;
av_register_all();
avformat_network_init();
avformat_open_input(&inputContext, "test.sdp", NULL, NULL);
avformat_find_stream_info(inputContext, NULL);
int inAudioStreamIdx = av_find_best_stream(inputContext, AVMEDIA_TYPE_AUDIO, -1, -1, NULL, 0);
AVStream *st = inputContext->streams[inAudioStreamIdx];
AVCodecContext *dec_ctx = st->codec;
AVCodec *dec = avcodec_find_decoder(dec_ctx->codec_id);
avcodec_open2(dec_ctx, dec, NULL); // Fails here with Audio object type 3Am I opening the sdp input improperly ?
-
When using ffmpeg api, the encoded gif is output to the dynamically applied buffer
5 septembre 2023, par yangjinhui2936Purpose:I want to use ffmpeg to encode data from rbg8 to gif format.Currently can be encoded into file output.


But I don't know how to store the gif directly in the buffer instead of saving it in the file.


Below is the text of the code:
input_w560_h1280.rgb8


#include 
#include 
#include 
#include 
#include <libavcodec></libavcodec>avcodec.h>
#include <libavutil></libavutil>imgutils.h>
#include <libavformat></libavformat>avformat.h>
#include <libswscale></libswscale>swscale.h>
#include <libavdevice></libavdevice>avdevice.h>

#define CONFIG_FBDEV_OUTDEV 1
#define GET_DATA_TO_BUFF 0

int readFileToBuffer(uint8_t *dst, const char* filename, long* fileSize) {
 FILE* file = fopen(filename, "rb");
 if (!file || dst == NULL) {
 fprintf(stderr, "cannot open file: %s %p\n", filename, dst);
 return -1;
 }

 fseek(file, 0, SEEK_END);
 *fileSize = ftell(file);
 fseek(file, 0, SEEK_SET);

 uint8_t *buffer = NULL;
 buffer = dst;
 if (!buffer) {
 fprintf(stderr, "buffer error\n");
 fclose(file);
 return -1;
 }

 // fread file to buffer
 if (fread(buffer, 1, *fileSize, file) != *fileSize) {
 fprintf(stderr, "read file failed size %ld\n", *fileSize);
 fclose(file);
 free(buffer);
 return -1;
 }

 fclose(file);
 return 0;
}

int writeBufferToFile(const char* filename, uint8_t* buffer, long bufferSize) {
 FILE* file = fopen(filename, "wb");
 if (!file) {
 fprintf(stderr, "cannot open: %s\n", filename);
 return -1;
 }

 if (fwrite(buffer, 1, bufferSize, file) != bufferSize) {
 fprintf(stderr, "cannot fwrite\n");
 fclose(file);
 return -1;
 }

 fclose(file);
 return 0;
}

int main() {
 const char *output_filename = "output.gif";
 const char *input_filename = "input_w560_h1280.rgb8";
 int width = 560;
 int height = 1280;

 avcodec_register_all();
 avdevice_register_all();
 av_register_all();

 av_log_set_level(AV_LOG_MAX_OFFSET);

 AVCodec *codec = avcodec_find_encoder(AV_CODEC_ID_GIF);
 if (!codec) {
 printf("GIF encoder not found.\n");
 return 1;
 }
 
 AVCodecContext *codecContext = avcodec_alloc_context3(codec);
 if (!codecContext) {
 printf("Could not allocate codec codecContext.\n");
 return 1;
 }

 codecContext->width = width;
 codecContext->height = height;
 codecContext->pix_fmt = AV_PIX_FMT_RGB8;
 codecContext->time_base = (AVRational){1, 25};
 
 if (avcodec_open2(codecContext, codec, NULL) < 0) {
 printf("Could not open codec.\n");
 return 1;
 }

 AVFormatContext *outputFormatContext = NULL;
 if (avformat_alloc_output_context2(&outputFormatContext, NULL, NULL, output_filename) < 0) {
 printf("Could not allocate output format codecContext.\n");
 return 1;
 }

 AVStream *stream = avformat_new_stream(outputFormatContext, NULL);
 if (!stream) {
 printf("Could not create stream.\n");
 return 1;
 }

 AVCodecParameters *codec_params = stream->codecpar;
 avcodec_parameters_from_context(codec_params, codecContext);

 if (avio_open(&outputFormatContext->pb, output_filename, AVIO_FLAG_WRITE) < 0) {
 printf("Could not open output file.\n");
 return 1;
 }

 /* write header for output */
 if(avformat_write_header(outputFormatContext, NULL) < 0)
 {
 printf("avformat_write_header failed\n");
 }

 // creat and init frame
 AVFrame *frame = av_frame_alloc();
 frame->format = AV_PIX_FMT_RGB8;
 frame->width = width;
 frame->height = height;
 /* check frame buff */
 if (av_frame_get_buffer(frame, 0) < 0) {
 printf("Failed to allocate frame buffer.\n");
 return -1;
 }

 /* read rgb data to frame->data[0] */
 uint8_t *rgb8data = (uint8_t *)av_malloc(width * height * 3);
 long read_size = 0;
 int ret = readFileToBuffer(rgb8data, input_filename, &read_size);
 if (ret != 0 || read_size == 0)
 {
 printf("error argbData %p read_size %ld\n", rgb8data, read_size);
 }
 /* cp input data to frame */
 av_image_copy_plane(frame->data[0], frame->linesize[0], rgb8data, width, width, height);

 // Init IOcontext (try to get the gif stream)
 #if GET_DATA_TO_BUFF
 AVIOContext *outputIoContext = NULL;

 if (avio_open_dyn_buf(&outputIoContext) < 0) {
 printf("Failed to open output buffer.\n");
 return -1;
 }
 #endif
 // Encoding loop (simulated frames)
 AVPacket pkt;
 av_init_packet(&pkt);
 pkt.data = NULL;
 pkt.size = 0;
 avcodec_send_frame(codecContext, frame);

 while (avcodec_receive_packet(codecContext, &pkt) == 0) {
 pkt.stream_index = stream->index;
 #if GET_DATA_TO_BUFF // try to get the gif stream
 avio_write(outputIoContext, pkt.data, pkt.size);
 #endif
 av_write_frame(outputFormatContext, &pkt);
 av_packet_unref(&pkt);
 }
 /* write end */
 av_write_trailer(outputFormatContext);
 // try to get the gif stream
 #if GET_DATA_TO_BUFF
 uint8_t *outputBuffer;
 int outputBufferSize = avio_close_dyn_buf(outputIoContext, &outputBuffer);
 writeBufferToFile("bf_1.gif", outputBuffer, outputBufferSize);
 #endif
 /* free */
 avformat_close_input(&outputFormatContext);
 av_frame_free(&frame);
 avcodec_free_context(&codecContext);
 av_free(rgb8data);

 return 0;
}



MAKEFILE


CC = gcc
CFLAGS = -Wall -g
CFLAGS += -I ../output/include
CFLAGS += -L ../output/lib
LIBS = -l:libavdevice.a -l:libavformat.a -l:libavcodec.a -lavfilter -lswresample -lswscale -l:libavutil.a -lpthread -lz -lbz2 -lm -ldl

all: encode_to_gif

encode_to_gif: encode_to_gif.c
 $(CC) $(CFLAGS) -o $@ $< $(LIBS)



Tried The content in the macro definition is the relevant solution I found online. Unfortunately, the data I got is in original rgb8 format, not in gif format.ffmpeg writes data to file and Data dumped from buffer
The data dumped from the buffer seems to have no gif header


My expected result I want to output the encoded gif directly to the buffer,but i don't know what to do.




-
compile librtmp for android error : cannot find -ldl collect2 : error : ld returned 1 exit status
6 mai 2014, par hoseinI have problem on comple librtmp for android using :
https://github.com/OnlyInAmerica/FFmpeg-Android./build_librtmp_for_android.sh
/home/user/loc_app/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtbegin_so.o: No such file or directory
/home/user/loc_app/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtend_so.o: No such file or directory
/home/user/loc_app/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lssl
/home/user/loc_app/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lcrypto
/home/user/loc_app/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lz
/home/user/loc_app/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lc
/home/user/loc_app/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -ldl
collect2: error: ld returned 1 exit status
make: *** [librtmp.so.1] Error 1here is build_librtmp_for_android.sh :
#!/bin/bash
NDK=/home/user/loc_app/android-ndk-r9
#/home/user/loc_app/android-ndk-r9/platforms/android-19/arch-arm
SYSROOT=$NDK/platforms/android-18/arch-arm
#platforms/android-19/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64
#/home/user/loc_app/android-ndk-r9/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
OPENSSL_DIR=/home/user/libs/openssl-android-master/
# Note: Change the above variables for your system.
function build_one
{
set -e
make clean
ln -s ${SYSROOT}usr/lib/crtbegin_so.o
ln -s ${SYSROOT}usr/lib/crtend_so.o
export XLDFLAGS="$ADDI_LDFLAGS -L${OPENSSL_DIR}libs/armeabi -L${SYSROOT}usr/lib "
export CROSS_COMPILE=$TOOLCHAIN/bin/arm-linux-androideabi-
export XCFLAGS="${ADDI_CFLAGS} -I${OPENSSL_DIR}include -isysroot ${SYSROOT}"
export INC="-I${SYSROOT}"
make prefix=\"${PREFIX}\" OPT= install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"
build_oneOS : Fedora 64bit
EDIT 1 : that seems to Makefile so i added it here
VERSION=v2.4
prefix=/usr/local
incdir=$(prefix)/include/librtmp
bindir=$(prefix)/bin
libdir=$(prefix)/lib
mandir=$(prefix)/man
BINDIR=$(DESTDIR)$(bindir)
INCDIR=$(DESTDIR)$(incdir)
LIBDIR=$(DESTDIR)$(libdir)
MANDIR=$(DESTDIR)$(mandir)
CC=$(CROSS_COMPILE)gcc
LD=$(CROSS_COMPILE)ld
AR=$(CROSS_COMPILE)ar
SYS=posix
CRYPTO=OPENSSL
#CRYPTO=GNUTLS
DEF_POLARSSL=-DUSE_POLARSSL
DEF_OPENSSL=-DUSE_OPENSSL
DEF_GNUTLS=-DUSE_GNUTLS
DEF_=-DNO_CRYPTO
REQ_GNUTLS=gnutls,hogweed,nettle
REQ_OPENSSL=libssl,libcrypto
PUB_GNUTLS=-lgmp
LIBZ=-lz
LIBS_posix=
LIBS_darwin=
LIBS_mingw=-lws2_32 -lwinmm -lgdi32
LIB_GNUTLS=-lgnutls -lhogweed -lnettle -lgmp $(LIBZ)
LIB_OPENSSL=-lssl -lcrypto $(LIBZ)
LIB_POLARSSL=-lpolarssl $(LIBZ)
PRIVATE_LIBS=$(LIBS_$(SYS))
CRYPTO_LIB=$(LIB_$(CRYPTO)) $(PRIVATE_LIBS)
CRYPTO_REQ=$(REQ_$(CRYPTO))
CRYPTO_DEF=$(DEF_$(CRYPTO))
PUBLIC_LIBS=$(PUB_$(CRYPTO))
SO_VERSION=1
SOX_posix=so
SOX_darwin=dylib
SOX_mingw=dll
SOX=$(SOX_$(SYS))
SO_posix=.$(SOX).$(SO_VERSION)
SO_darwin=.$(SO_VERSION).$(SOX)
SO_mingw=-$(SO_VERSION).$(SOX)
SO_EXT=$(SO_$(SYS))
SODIR_posix=$(LIBDIR)
SODIR_darwin=$(LIBDIR)
SODIR_mingw=$(BINDIR)
SODIR=$(SODIR_$(SYS))
SO_LDFLAGS_posix=-shared -Wl,-soname,$@
SO_LDFLAGS_darwin=-dynamiclib -twolevel_namespace -undefined dynamic_lookup \
-fno-common -headerpad_max_install_names -install_name $(libdir)/$@
SO_LDFLAGS_mingw=-shared -Wl,--out-implib,librtmp.dll.a
SO_LDFLAGS=$(SO_LDFLAGS_$(SYS))
INSTALL_IMPLIB_posix=
INSTALL_IMPLIB_darwin=
INSTALL_IMPLIB_mingw=cp librtmp.dll.a $(LIBDIR)
INSTALL_IMPLIB=$(INSTALL_IMPLIB_$(SYS))
SHARED=yes
SODEF_yes=-fPIC
SOLIB_yes=librtmp$(SO_EXT)
SOINST_yes=install_so
SO_DEF=$(SODEF_$(SHARED))
SO_LIB=$(SOLIB_$(SHARED))
SO_INST=$(SOINST_$(SHARED))
DEF=-DRTMPDUMP_VERSION=\"$(VERSION)\" $(CRYPTO_DEF) $(XDEF)
OPT=-O2
CFLAGS=-Wall $(XCFLAGS) $(INC) $(DEF) $(OPT) $(SO_DEF)
LDFLAGS=$(XLDFLAGS)
OBJS=rtmp.o log.o amf.o hashswf.o parseurl.o
all: librtmp.a $(SO_LIB)
clean:
rm -f *.o *.a *.$(SOX) *$(SO_EXT) librtmp.pc
librtmp.a: $(OBJS)
$(AR) rs $@ $?
librtmp$(SO_EXT): $(OBJS)
$(CC) $(SO_LDFLAGS) $(LDFLAGS) -o $@ $^ $> $(CRYPTO_LIB)
ln -sf $@ librtmp.$(SOX)
log.o: log.c log.h Makefile
rtmp.o: rtmp.c rtmp.h rtmp_sys.h handshake.h dh.h log.h amf.h Makefile
amf.o: amf.c amf.h bytes.h log.h Makefile
hashswf.o: hashswf.c http.h rtmp.h rtmp_sys.h Makefile
parseurl.o: parseurl.c rtmp.h rtmp_sys.h log.h Makefile
librtmp.pc: librtmp.pc.in Makefile
sed -e "s;@prefix@;$(prefix);" -e "s;@libdir@;$(libdir);" \
-e "s;@VERSION@;$(VERSION);" \
-e "s;@CRYPTO_REQ@;$(CRYPTO_REQ);" \
-e "s;@PUBLIC_LIBS@;$(PUBLIC_LIBS);" \
-e "s;@PRIVATE_LIBS@;$(PRIVATE_LIBS);" librtmp.pc.in > $@
install: install_base $(SO_INST)
install_base: librtmp.a librtmp.pc
-mkdir -p $(INCDIR) $(LIBDIR)/pkgconfig $(MANDIR)/man3 $(SODIR)
cp amf.h http.h log.h rtmp.h $(INCDIR)
cp librtmp.a $(LIBDIR)
cp librtmp.pc $(LIBDIR)/pkgconfig
cp librtmp.3 $(MANDIR)/man3
install_so: librtmp$(SO_EXT)
cp librtmp$(SO_EXT) $(SODIR)
$(INSTALL_IMPLIB)
cd $(SODIR); ln -sf librtmp$(SO_EXT) librtmp.$(SOX)