
Recherche avancée
Autres articles (69)
-
Pas question de marché, de cloud etc...
10 avril 2011Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
sur le web 2.0 et dans les entreprises qui en vivent.
Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...) -
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 (...) -
Le plugin : Gestion de la mutualisation
2 mars 2010, parLe plugin de Gestion de mutualisation permet de gérer les différents canaux de mediaspip depuis un site maître. Il a pour but de fournir une solution pure SPIP afin de remplacer cette ancienne solution.
Installation basique
On installe les fichiers de SPIP sur le serveur.
On ajoute ensuite le plugin "mutualisation" à la racine du site comme décrit ici.
On customise le fichier mes_options.php central comme on le souhaite. Voilà pour l’exemple celui de la plateforme mediaspip.net :
< ?php (...)
Sur d’autres sites (5382)
-
Can't generate libx264.dll. MinGW : not c Compiler found
20 avril 2015, par Sandie CIt’s my first post in a forum ever (and in english...) Any suggestion is welcomed.
So let’s started !
My global goal is to recorder/transcoding and dispay an IP Camera stream from a .bat whitch calling vlc.
I want an asf container containing h264 and aac.
.bat :
cd C :\Program Files (x86)\VideoLAN\VLC
vlc rtsp ://root:root@ip_adresse/media.amp —sout "#transcode vcodec=x264, vb=112 , acodec==aac, fps=25:duplicatedst=display,dst=standardaccess=file,mux = asf,dst=flux.asf" -v
when I first execute this, VLC told me that H264 encoder was not found, so I decided to compile x264.
I followed this link
http://www.ayobamiadewole.com/Blog/How-to-build-x264-or-libx264.dll-in-Windows
I succeed to make the .exe but and when I got to
./configure —disable-cli —enable-shared —extra-ldflags=-Wl,—output-def=libx264.def
minGW shell indicates : not working c compiler found
I tried to find some answer, but i didn’t found a good one.
Does anyone have an idea of what i’m doing wrong ?
-
Exoplayer with FFmpeg module and filtering crash with aac and alac audio formats
25 juin 2020, par Aleksej OtjanHave a code to play audio with exoplayer and ffmpeg decoder. It works. Then I was needed to add equalizer functionality. I did it with ffmpeg avfilters. But now, it crash at some audio formats(if dont use avfilters it works with this formats).


Decode func :


int decodePacket(AVCodecContext *context, AVPacket *packet,
 uint8_t *outputBuffer, int outputSize) {
 int result = 0;
 // Queue input data.
 result = avcodec_send_packet(context, packet);
 if (result) {
 logError("avcodec_send_packet", result);
 return result == AVERROR_INVALIDDATA ? DECODER_ERROR_INVALID_DATA
 : DECODER_ERROR_OTHER;
 }

 // Dequeue output data until it runs out.
 int outSize = 0;
 if (EQUALIZER != nullptr) {
 LOGE("INIT FILTER GRAPH");
 init_filter_graph(context, EQUALIZER);
 }

 while (true) {
 AVFrame *frame = av_frame_alloc();
 if (!frame) {
 LOGE("Failed to allocate output frame.");
 return -1;
 }
 result = avcodec_receive_frame(context, frame);
 if (result) {
 av_frame_free(&frame);
 if (result == AVERROR(EAGAIN)) {
 break;
 }
 logError("avcodec_receive_frame", result);
 return result;
 }

 // Resample output.
 AVSampleFormat sampleFormat = context->sample_fmt;
 int channelCount = context->channels;
 int channelLayout = context->channel_layout;
 int sampleRate = context->sample_rate;
 int sampleCount = frame->nb_samples;
 int dataSize = av_samples_get_buffer_size(NULL, channelCount, sampleCount,
 sampleFormat, 1);
 SwrContext *resampleContext;
 if (context->opaque) {
 resampleContext = (SwrContext *) context->opaque;
 } else {
 resampleContext = swr_alloc();
 av_opt_set_int(resampleContext, "in_channel_layout", channelLayout, 0);
 av_opt_set_int(resampleContext, "out_channel_layout", channelLayout, 0);
 av_opt_set_int(resampleContext, "in_sample_rate", sampleRate, 0);
 av_opt_set_int(resampleContext, "out_sample_rate", sampleRate, 0);
 av_opt_set_int(resampleContext, "in_sample_fmt", sampleFormat, 0);
 // The output format is always the requested format.
 av_opt_set_int(resampleContext, "out_sample_fmt",
 context->request_sample_fmt, 0);
 result = swr_init(resampleContext);
 if (result < 0) {
 logError("swr_init", result);
 av_frame_free(&frame);
 return -1;
 }
 context->opaque = resampleContext;
 }
 int inSampleSize = av_get_bytes_per_sample(sampleFormat);
 int outSampleSize = av_get_bytes_per_sample(context->request_sample_fmt);
 int outSamples = swr_get_out_samples(resampleContext, sampleCount);
 int bufferOutSize = outSampleSize * channelCount * outSamples;
 if (outSize + bufferOutSize > outputSize) {
 LOGE("Output buffer size (%d) too small for output data (%d).",
 outputSize, outSize + bufferOutSize);
 av_frame_free(&frame);
 return -1;
 }
 if (EQUALIZER != nullptr && graph != nullptr) {
 result = av_buffersrc_add_frame_flags(src, frame,AV_BUFFERSRC_FLAG_KEEP_REF);
 if (result < 0) {
 av_frame_unref(frame);
 LOGE("Error submitting the frame to the filtergraph:");
 return -1;
 }
 // Get all the filtered output that is available.
 result = av_buffersink_get_frame(sink, frame);
 LOGE("ERROR SWR %s", av_err2str(result));
 if (result == AVERROR(EAGAIN) || result == AVERROR_EOF) {
 av_frame_unref(frame);
 break;
 }
 if (result < 0) {
 av_frame_unref(frame);
 return -1;
 }
 result = swr_convert(resampleContext, &outputBuffer, bufferOutSize,
 (const uint8_t **) frame->data, frame->nb_samples);
 }else{
 result = swr_convert(resampleContext, &outputBuffer, bufferOutSize,
 (const uint8_t **) frame->data, frame->nb_samples);
 }

 av_frame_free(&frame);
 if (result < 0) {
 logError("swr_convert", result);
 return result;
 }
 int available = swr_get_out_samples(resampleContext, 0);
 if (available != 0) {
 LOGE("Expected no samples remaining after resampling, but found %d.",
 available);
 return -1;
 }
 outputBuffer += bufferOutSize;
 outSize += bufferOutSize;
 }
 avfilter_graph_free(&graph);
 return outSize;
}



Init graph func :


int init_filter_graph(AVCodecContext *dec_ctx, const char *eq) {
 char args[512];
 int ret = 0;
 graph = avfilter_graph_alloc();
 const AVFilter *abuffersrc = avfilter_get_by_name("abuffer");
 const AVFilter *abuffersink = avfilter_get_by_name("abuffersink");
 AVFilterInOut *outputs = avfilter_inout_alloc();
 AVFilterInOut *inputs = avfilter_inout_alloc();
 static const enum AVSampleFormat out_sample_fmts[] = {dec_ctx->request_sample_fmt,
 static_cast<const avsampleformat="avsampleformat">(-1)};
 static const int64_t out_channel_layouts[] = {static_cast(dec_ctx->channel_layout),
 -1};
 static const int out_sample_rates[] = {dec_ctx->sample_rate, -1};
 const AVFilterLink *outlink;
 AVRational time_base = dec_ctx->time_base;

 if (!outputs || !inputs || !graph) {
 ret = AVERROR(ENOMEM);
 goto end;
 }

 /* buffer audio source: the decoded frames from the decoder will be inserted here. */
 if (!dec_ctx->channel_layout)
 dec_ctx->channel_layout = av_get_default_channel_layout(dec_ctx->channels);
 snprintf(args, sizeof(args),
 "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=0x%" PRIx64,
 1, dec_ctx->sample_rate, dec_ctx->sample_rate,
 av_get_sample_fmt_name(dec_ctx->sample_fmt), dec_ctx->channel_layout);
 ret = avfilter_graph_create_filter(&src, abuffersrc, "in",
 args, NULL, graph);

 if (ret < 0) {
 LOGE("Cannot create audio buffer source\n");
 goto end;
 }

 /* buffer audio sink: to terminate the filter chain. */
 ret = avfilter_graph_create_filter(&sink, abuffersink, "out",
 NULL, NULL, graph);
 if (ret < 0) {
 LOGE("Cannot create audio buffer sink\n");
 goto end;
 }

 ret = av_opt_set_int_list(sink, "sample_fmts", out_sample_fmts, -1,
 AV_OPT_SEARCH_CHILDREN);
 if (ret < 0) {
 LOGE("Cannot set output sample format\n");
 goto end;
 }

 ret = av_opt_set_int_list(sink, "channel_layouts", out_channel_layouts, -1,
 AV_OPT_SEARCH_CHILDREN);
 if (ret < 0) {
 LOGE("Cannot set output channel layout\n");
 goto end;
 }

 ret = av_opt_set_int_list(sink, "sample_rates", out_sample_rates, -1,
 AV_OPT_SEARCH_CHILDREN);
 if (ret < 0) {
 LOGE("Cannot set output sample rate\n");
 goto end;
 }

 /*
 * Set the endpoints for the filter graph. The graph will
 * be linked to the graph described by filters_descr.
 */

 /*
 * The buffer source output must be connected to the input pad of
 * the first filter described by filters_descr; since the first
 * filter input label is not specified, it is set to "in" by
 * default.
 */
 outputs->name = av_strdup("in");
 outputs->filter_ctx = src;
 outputs->pad_idx = 0;
 outputs->next = NULL;

 /*
 * The buffer sink input must be connected to the output pad of
 * the last filter described by filters_descr; since the last
 * filter output label is not specified, it is set to "out" by
 * default.
 */
 inputs->name = av_strdup("out");
 inputs->filter_ctx = sink;
 inputs->pad_idx = 0;
 inputs->next = NULL;

 if ((ret = avfilter_graph_parse_ptr(graph, eq,
 &inputs, &outputs, NULL)) < 0) {
 goto end;
 }

 if ((ret = avfilter_graph_config(graph, NULL)) < 0)
 goto end;

 /* Print summary of the sink buffer
 * Note: args buffer is reused to store channel layout string */
 outlink = sink->inputs[0];
 av_get_channel_layout_string(args, sizeof(args), -1, outlink->channel_layout);
 LOGE("Output: srate:%dHz chlayout:%s\n",
 (int) outlink->sample_rate,
 args);
 end:
 avfilter_inout_free(&inputs);
 avfilter_inout_free(&outputs);
 return ret;
}
</const>


Crash when try to play aac, alac audio at this line :


result = swr_convert(resampleContext, &outputBuffer, bufferOutSize,(const uint8_t **) frame->data, frame->nb_samples);



with


Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 



but work fine when play mp3, flac. What is wrong ? Thx for help.


-
sh : ffmpeg : command not found when run command through php
9 avril 2015, par AshokI have installed successfully installed FFMpeg on root of my Centos 6 machine (https://trac.ffmpeg.org/wiki/CompilationGuide/Centos).
My workplace of apache/php is /var/www/html
Now I’m running below command successfully on /var/www/html directory to capture frame from the video file. It’s capturing a frame.
[root@localhost html]# ffmpeg -i video.mpg -an -ss 30 -t 00:00:01 -r 1 -y -vcodec mjpeg -f mjpeg -s 160x100 frame8 2>&1
I want to run this command through php and using shell_exec() or exec() php functions. My php code for running the command is :
$cmd = "/root/bin/ffmpeg -i /project/app/webroot/videos/video.mpg -ss 00:00:14.435 -f image2 -vframes 1 /project/app/webroot/videothumbnails/example-thumb.jpg";
$locale = 'en_IN.UTF-8';
setlocale(LC_ALL, $locale);
putenv('LC_ALL='.$locale);
echo shell_exec($cmd);When I’m trying to run command through above php code, I’m getting below error :
sh: ffmpeg: command not found
Please help me to solve out this problem.