
Recherche avancée
Médias (91)
-
GetID3 - Boutons supplémentaires
9 avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
-
Core Media Video
4 avril 2013, par
Mis à jour : Juin 2013
Langue : français
Type : Video
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
-
Exemple de boutons d’action pour une collection collaborative
27 février 2013, par
Mis à jour : Mars 2013
Langue : français
Type : Image
-
Exemple de boutons d’action pour une collection personnelle
27 février 2013, par
Mis à jour : Février 2013
Langue : English
Type : Image
Autres articles (83)
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...) -
Le plugin : Podcasts.
14 juillet 2010, parLe problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
Types de fichiers supportés dans les flux
Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)
Sur d’autres sites (7270)
-
While working with ffmpeg : Created function in C file and after compilation with NDK accessing from android activity, getting signal 11 error
30 mai 2016, par Dayanand LandeAfter successfully fire command
ndk-build
I got .so file in my libs folder, then after some changes in gradle file I got native_libs.xml .idea/libraries folder.Now I am accessing c function from my java code/ android activity. I am getting
signal 11
errorMy code is
C file
#include
#include <android></android>log.h>
#include
#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__)
//JNIEXPORT jint JNICALL Java_com_xxx_xxx_activities_SplashActivity_logFileInfo(JNIEnv * env, jobject this, jstring filename);
jint Java_com_xxx_xxx_activities_TutorialsActivity_logFileInfo(JNIEnv * env, jobject this, jstring filename)
{
av_register_all();
AVFormatContext *pFormatCtx;
const jbyte *str;
str = (*env)->GetStringUTFChars(env, filename, NULL);
if(avformat_open_input(&pFormatCtx, str, NULL, NULL)!=0)
{
LOGE("Can't open file '%s'\n", str);
return 1;
}
else
{
LOGI("File was opened\n");
LOGI("File '%s', Codec %s",
pFormatCtx->filename,
pFormatCtx->iformat->name
);
}
return 0;
}Loading and try to access method in java code is
private static native int logFileInfo(String filename);
static {
System.loadLibrary("framegrabber");
}In OnCreate of activity
logFileInfo(file.getAbsolutePath());
Finally error at point
logFileInfo(file.getAbsolutePath());
isA/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x106e in tid 8905 (Thread-20972)
Please replay if you have any solution, Thanking in advance.
-
How to set FFmpeg to send a signal to java code when it's done with its job ?
23 juin 2016, par ElahehI have a java servlet which waits for an httprequest, when it arrives, it calls the FFmpeg to do mixing two videos. Java code needs to send the mixed video back to the requester when the FFmpeg finished its job.
How can I set the FFmpeg to inform the java servlet when the mixed video is ready ?
My code in current shape, starts sending the video while FFmpeg is not completely done.I can use thread.sleep() or similar methods, but since we need to measure the processing time for a research work, I cannot use that.
I appreciate if you can help me on this.
this is part of the code :String videoId=req.getParameter("id");
String ad= "/var/Videos/ads/angrybirds-adv.mp4";
String url="http://"+RequesterIP+"/"+videoId;
System.out.println("url: "+url);
String output= new SimpleDateFormat("yyyyMMddhhmm'.mp4'").format(new Date());
String videoPath = "/var/Videos/"+output;
List<string> cmds = new ArrayList<>();
cmds.add("ffmpeg");
cmds.add("-i");
cmds.add(url);
cmds.add("-i");
cmds.add(ad);
cmds.add("-filter_complex");
cmds.add("[0:v][1:v] overlay");
cmds.add(videoPath);
ProcessBuilder pb = new ProcessBuilder(cmds);
Process p = pb.start();
/** Terminal **/
final InputStream inStream = p.getErrorStream();
new Thread(new Runnable() {
public void run() {
InputStreamReader reader = new InputStreamReader(inStream);
Scanner scan = new Scanner(reader);
while (scan.hasNextLine()) {
System.out.println(scan.nextLine());
}
}
}).start();
// send the mixed video to the requester
File downloadFile = new File(videoPath);
...
</string>More details :
the ad video is the overlay video located in the same machine as FFmpeg, the original video is located on a public folder in the requester machine, and is accessible using this url : http://requester-IP/videoId -
Duplicate a signal with FFmpeg library [on hold]
22 septembre 2016, par MeugiwaraI’m using the FFmpeg library to develop a program in C/C++. At this time, my aim is to duplicate the signal when I open an audio file. My scheme is the next : read an audio file, transform the stereo signal in mono signal and duplicate this mono signal to get two mono signal exactly the same.
I watched in the Doxygen documentation on the official website, but I don’t find something interesting. Do someone know a good way to do this ?
Here’s what I have so far :
#include
#include
#include
#define __STDC_CONSTANT_MACROS
#ifdef _WIN32
extern "C" /* Windows */
{
#include "libswresample/swresample.h"
#include "libavformat/avformat.h"
#include "libavcodec/avcodec.h"
#include "SDL2/SDL.h"
};
#else
#ifdef __cplusplus
extern "C" /* Linux */
{
#endif /* __cplusplus */
#include <libswresample></libswresample>swresample.h>
#include <libavformat></libavformat>avformat.h>
#include <libavcodec></libavcodec>avcodec.h>
#include <sdl2></sdl2>SDL.H>
#ifdef __cplusplus
};
#endif /* __cplusplus */
#endif /* _WIN32 */
#define MAX_AUDIO_FRAME_SIZE 192000 /* 1 second of 48 kHz 32 bits audio*/
#define OUTPUT_PCM 1 /* Output PCM */
#define USE_SDL 1 /* Use SDL */
/* Les incrémentations */
static Uint32 audio_len;
static Uint8 *audio_chunk;
static Uint8 *audio_pos;
void fill_audio(void *udata, Uint8 *stream, int len)
{
SDL_memset(stream, 0, len); /* SDL 2.0 */
if (audio_len == 0)
return;
len = (len > audio_len ? audio_len : len);
SDL_MixAudio(stream, audio_pos, len, SDL_MIX_MAXVOLUME);
audio_pos = audio_pos + len;
audio_len = audio_len - len;
}
int reading_sound(char *str)
{
SDL_AudioSpec wanted_spec;
AVFormatContext *pFormatCtx;
AVCodecContext *pCodecCtx;
AVSampleFormat out_sample_fmt;
AVPacket *packet;
AVFrame *pFrame;
AVCodec *pCodec;
uint64_t out_channel_layout;
uint8_t *out_buffer;
int64_t in_channel_layout;
struct SwrContext *au_convert_ctx;
int out_sample_rate;
int out_buffer_size;
int out_nb_samples;
int out_channels;
int audioStream;
int got_picture;
int index = 0;
int ret;
int i;
FILE *pFile = NULL;
/*
//char *sound = "WavinFlag.aac";
*/
av_register_all();
avformat_network_init();
pFormatCtx = avformat_alloc_context();
if (avformat_open_input(&pFormatCtx, str, NULL, NULL) != 0) /* Ouverture du fichier */
{
fprintf(stderr, "%s\n", "Couldn't open input stream");
return (-1);
}
if (avformat_find_stream_info(pFormatCtx, NULL) < 0) /* Récupérer les informations */
{
fprintf(stderr, "Couldn't find stream information\n");
return (-1);
}
av_dump_format(pFormatCtx, 0, str, false); /* Envoyer les informations utiles sur la sortie d'erreur */
audioStream = -1;
for (i = 0; i < pFormatCtx->nb_streams; i++) /* Trouver le début du son */
if (pFormatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
{
audioStream = i;
break;
}
if (audioStream == -1)
{
fprintf(stderr, "%s\n", "Didn't find an audio stream");
return (-1);
}
pCodecCtx = pFormatCtx->streams[audioStream]->codec;
pCodec = avcodec_find_decoder(pCodecCtx->codec_id); /* Trouver le décodeur du fichier (.aac, .mp3, ...) */
if (pCodec == NULL)
{
fprintf(stderr, "%s\n", "Codec not found");
return (-1);
}
if (avcodec_open2(pCodecCtx, pCodec, NULL) < 0) /* Ouvrir le décodeur du fichier */
{
fprintf(stderr, "%s\n", "Couldn't open codec");
return (-1);
}
#if OUTPUT_PCM
pFile = fopen("output.pcm", "wb"); /* Créer et écrire tout ce qui se passe dans ce fichier */
#endif /* OUTPUT_PCM */
packet = (AVPacket *)av_malloc(sizeof(AVPacket)); /* Allouer taille */
av_init_packet(packet);
out_channel_layout = AV_CH_LAYOUT_MONO; /* Canaux de sortie */
out_nb_samples = pCodecCtx->frame_size; /* L'échantillonnage - Le nombre de samples*/
out_sample_fmt = AV_SAMPLE_FMT_S16; /* Format */
out_sample_rate = 44100; /* Fréquence */
out_channels = av_get_channel_layout_nb_channels(out_channel_layout); /* Récupérer le nombre de canaux */
/*
// printf("%d\n", out_channels);
// system("PAUSE");
*/
out_buffer_size = av_samples_get_buffer_size(NULL, out_channels, out_nb_samples, out_sample_fmt, 1); /* Taille du buffer */
out_buffer = (uint8_t *)av_malloc(MAX_AUDIO_FRAME_SIZE * 2); /* Allouer taille */
pFrame = av_frame_alloc(); /* Allouer taille */
#if USE_SDL
if (SDL_Init(SDL_INIT_VIDEO |SDL_INIT_AUDIO | SDL_INIT_TIMER)) /* Initialiser SDL */
{
fprintf(stderr, "%s - %s\n", "Couldn't initialize SDL", SDL_GetError());
return (-1);
}
/*
// Attribution des valeurs avec les variables au-dessus
*/
wanted_spec.freq = out_sample_rate;
wanted_spec.format = AUDIO_S16SYS;
wanted_spec.channels = out_channels;
wanted_spec.silence = 0;
wanted_spec.samples = out_nb_samples;
wanted_spec.callback = fill_audio;
wanted_spec.userdata = pCodecCtx;
if (SDL_OpenAudio(&wanted_spec, NULL) < 0)
{
fprintf(stderr, "%s\n", "Can't open audio");
return (-1);
}
#endif /* USE_SDL */
in_channel_layout = av_get_default_channel_layout(pCodecCtx->channels);
au_convert_ctx = swr_alloc();
au_convert_ctx = swr_alloc_set_opts(au_convert_ctx, out_channel_layout, out_sample_fmt, out_sample_rate,
in_channel_layout, pCodecCtx->sample_fmt, pCodecCtx->sample_rate, 0, NULL);
swr_init(au_convert_ctx);
while (av_read_frame(pFormatCtx, packet) >= 0) /* Lecture du fichier */
{
if (packet->stream_index == audioStream)
{
ret = avcodec_decode_audio4(pCodecCtx, pFrame, &got_picture, packet); /* Décoder les packets */
if (ret < 0)
{
fprintf(stderr, "%s\n", "Error in decoding audio frame");
return (-1);
}
if (got_picture > 0)
{
swr_convert(au_convert_ctx, &out_buffer, MAX_AUDIO_FRAME_SIZE, (const uint8_t **)pFrame->data, pFrame->nb_samples);
#if 1
printf("Index : %5d\t Points : %lld\t Packet size : %d\n", index, packet->pts, packet->size); /* Affichage des informations sur la console */
#endif /* 1 */
#if OUTPUT_PCM
fwrite(out_buffer, 1, out_buffer_size, pFile); /* Faire l'écriture dans le fichier */
#endif /* OUTPUT_PCM */
index = index + 1;
}
#if USE_SDL
while (audio_len > 0)
SDL_Delay(1);
audio_chunk = (Uint8 *)out_buffer;
audio_len = out_buffer_size;
audio_pos = audio_chunk;
SDL_PauseAudio(0);
#endif /* USE_SDL */
}
av_free_packet(packet); /* Libérer les packets */
}
swr_free(&au_convert_ctx); /* Libérer la taille de conversion */
#if USE_SDL
SDL_CloseAudio(); /* Arrêter le son dans SDL */
SDL_Quit(); /* Quitter SDL */
#endif /* USE_SDL */
#if OUTPUT_PCM
fclose(pFile); /* Fermer le fichier d'écriture */
#endif /* OUTPUT_PCM */
av_free(out_buffer);
avcodec_close(pCodecCtx); /* Fermer le décodeur */
avformat_close_input(&pFormatCtx); /* Fermer le fichier lu */
return (0);
}
int main(int argc, char **argv)
{
if (argc != 2)
{
fprintf(stderr, "%s\n", "Usage : ./BASELFI [File]");
system("PAUSE");
return (-1);
}
else
{
reading_sound(argv[1]);
return (0);
}
return (0);
}