
Recherche avancée
Médias (1)
-
Somos millones 1
21 juillet 2014, par
Mis à jour : Juin 2015
Langue : français
Type : Video
Autres articles (65)
-
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 (...) -
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)
Sur d’autres sites (8739)
-
FFMPEG Undefined Reference to 'avcodoec_open2' in C++
12 avril 2012, par ALM865I have an error when compiling one of my C++ programs after updating the FFMPEG library from 0.8 to 'ffmpeg version git-2012-04-12-277f20c'
The error I get when I make my program is as follows :
-------- begin --------
Linking: Analysing_Server
./source/Encoding_Thread.o: In function `CEncoding_Thread::do_work()':
/home/Analyser/source/Encoding_Thread.cpp:155: undefined reference to `avcodec_open2'
collect2: ld returned 1 exit status
make: *** [Analysing_Server] Error 1The relevant lines of my Make file is similar to running g++ as below :
g++ test2.cpp -lavformat -lavcodec -lavutil -D__STDC_CONSTANT_MACROS
A stripped down version of my relevant CPP code that throws the error is :
#include
#include
#define LOG_OUT_STREAM_BUFF_SIZE 200000
extern "C" {
/* The ffmpeg library is completely written in C, so we need to tell the C++ compiler that so it links correctly. */
#include "stdint.h"
#include "libavcodec/avcodec.h"
#include "libavutil/mathematics.h"
#include "libswscale/swscale.h"
#include "libavfilter/avfilter.h"
int avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options);
int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr);
}
uint8_t m_outbuf[2][LOG_OUT_STREAM_BUFF_SIZE];
unsigned int m_out_size[2];
unsigned int m_OutBuffer_ID[2];
unsigned int m_Buffer_ID; /* This is just a uniqueish stamp we give to each buffer so we can tell when they change.. */
AVCodecContext * m_CodecContex;
AVCodec * m_codec;
struct SwsContext *m_img_convert_ctx;
unsigned char* m_DataBuff;
int Output_Width, Output_Height;
int Output_Bitrate;
int main(void) {
//New version of FFMPEG calls this in avcodec_register_all
//avcodec_init();
/* register all the codecs */
avcodec_register_all();
/* Initalise the encoder */
m_codec = avcodec_find_encoder(CODEC_ID_MP2);
if (!m_codec) {
printf("Encoding codec not found\n");
}
/* init the pointers.. */
m_CodecContex = NULL;
/* Default values.. */
Output_Width = 1600;
Output_Height = 1200;
Output_Bitrate = 600000;
/* Create/setup the Codec details.. */
//Changed to work with new FFMPEG
m_CodecContex = avcodec_alloc_context3(m_codec);
avcodec_get_context_defaults3(m_CodecContex, m_codec);
/* put sample parameters */
m_CodecContex->bit_rate = Output_Bitrate;
/* resolution must be a multiple of two */
m_CodecContex->width = Output_Width;
m_CodecContex->height = Output_Height;
/* frames per second */
m_CodecContex->time_base= (AVRational){1,25};
m_CodecContex->gop_size = 10; /* emit one intra frame every ten frames */
m_CodecContex->max_b_frames=1;
m_CodecContex->pix_fmt = PIX_FMT_YUV420P; /* must be YUV for encoding.. */
AVDictionary * RetunedAVDic;
/* open it */
//Changed to work with new FFMPEG
if (avcodec_open2(m_CodecContex, m_codec, &RetunedAVDic) < 0) {
printf("could not open codec");
}
}Unfortunately the example under 'doc/examples/decoding_encoding.c' that comes with FFMPEG no longer works because all the functions that it uses are now depreciated. My code is based on the example code and worked fine with FFMPEG 0.8 but does not compile with the newest version of FFMPEG. I have changed some of the depreciated functions to their newer versions but it still doesn't compile.
Does anyone know why I am getting this error ? or does anyone have a link to an example like 'doc/examples/decoding_encoding.c' using the newest version of FFMPEG ?
-
Saving an audio blob into the backend or Azure as an mp3 file using ffmpeg
2 juin 2021, par AnneI have an asp.net webforms, and I am using javascript and navigator.mediaDevices.getUserMedia to record an audio message.
This message has to be loaded into Azure once recorded.


So far, I have :
2 buttons, start and stop to record the audio blob


At the end of the process, I am trying to use ffmpeg to record the blob into a folder in my application, I can then load the file into Azure (I have the code ready for this one).
Or ideally, save directly to Azure.


I have installed ffmpeg in my application using nuget packages (I tried Xabe ffmpeg downloader and Accord video ffmpeg), however ffmpeg is not recognised when I run the function SendData() and I get this error :
Uncaught Error : Module name "ffmpeg" has not been loaded yet for context : _. Use require([])


My questions are :


- 

- How can I install ffmpeg in an asp.net wbeform and register it on the page ?
- Is there another way to save an audio blob to Azure ?
- Is it possible to save the audio chunks into a memory stream that I can later upload into Azure ?








Thank you for your help




<code class="echappe-js"><script>&#xA; navigator.mediaDevices.getUserMedia({ audio: true }).then(stream => { handlerFunction(stream) })&#xA;&#xA; record.onclick = e => {&#xA; record.disabled = true;&#xA; stopRecord.disabled = false;&#xA; audioChunks = [];&#xA; rec.start();&#xA; }&#xA;&#xA; stopRecord.onclick = e => {&#xA; record.disabled = false;&#xA; stop.disabled = true;&#xA; rec.stop();&#xA; }&#xA;&#xA;&#xA; function handlerFunction(stream) {&#xA; rec = new MediaRecorder(stream);&#xA; rec.ondataavailable = e => {audioChunks.push(e.data);&#xA; if (rec.state == "inactive") {&#xA; let blob = new Blob(audioChunks, { type: &#x27;audio/mpeg-3&#x27; });&#xA; recordedAudio.src = URL.createObjectURL(blob);&#xA; recordedAudio.controls = true;&#xA; sendData(blob)&#xA; }&#xA; }&#xA; }&#xA;&#xA; function sendData(data) {&#xA; var ffmepg = require("ffmpeg");&#xA; try {&#xA; var Path = data;&#xA; var process = new ffmepg("Path");&#xA; process.then(function (audio) {audio.fnExtractSoundToMP3("~//AppData//Audio//test.mp3", function (error, file) {&#xA; if (!error)&#xA; console.log("Audio file: " &#x2B; file);&#xA; });&#xA; }, function (err) {&#xA; console.log("Error: " &#x2B; err);&#xA; });&#xA; }&#xA; catch (e) {&#xA; console.log("Catch e.code" &#x2B; e.code);&#xA; console.log("Catch e.msg" &#x2B; e.msg);&#xA; }&#xA; }&#xA; </script>


<script src="https://code.jquery.com/jquery-2.2.0.min.js"></script>

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>





 
 
 
 
 <code class="echappe-js"><script src='http://stackoverflow.com/Scripts/require.js'></script>




Record











 











-
FFMPEG passthrough recording RTSP/H264 to MP4 container bad encoding
16 janvier 2019, par Cédric VerstraetenHello I’m using the ffmpeg 3.4.2 to record a RTSP h264 steam from an IP camera. I have a working example however at the beginning I see some corrupted images, after a couple of seconds the video is shown properly. I was wondering if this is a timing issue.
The source code which illustrates opening and reading a RTSP stream, and writing it into an MP4 container.
#include
#include
#include
#include <iostream>
#include <fstream>
#include <sstream>
#include <sys></sys>time.h>
extern "C" {
#include <libavcodec></libavcodec>avcodec.h>
#include <libavutil></libavutil>opt.h>
#include <libavutil></libavutil>imgutils.h>
#include <libavformat></libavformat>avformat.h>
#include <libavformat></libavformat>avio.h>
#include <libswscale></libswscale>swscale.h>
}
time_t get_time()
{
struct timeval tv;
gettimeofday( &tv, NULL );
return tv.tv_sec;
}
int main(int argc, char **argv)
{
const char *filename, *codec_name;
const AVCodec *codec;
AVCodecContext *c= NULL;
int i, ret, x, y;
// Open the initial context variables that are needed
AVFormatContext* format_ctx = avformat_alloc_context();
int video_stream_index;
// Register everything
av_register_all();
avformat_network_init();
//open RTSP
AVDictionary *ifmtdict;
av_dict_set(&ifmtdict, "rtsp_transport", "tcp", 0);
if (avformat_open_input(&format_ctx, "rtsp://192.168.0.84/user=admin_password=_channel=1_stream=0.sdp",
NULL, &ifmtdict) != 0) {
return EXIT_FAILURE;
}
if (avformat_find_stream_info(format_ctx, NULL) < 0) {
return EXIT_FAILURE;
}
//search video stream
for (int i = 0; i < format_ctx->nb_streams; i++) {
if (format_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
video_stream_index = i;
}
AVPacket packet;
av_init_packet(&packet);
AVStream* stream = NULL;
int cnt = 0;
//start reading packets from stream and write them to file
av_read_play(format_ctx); //play RTSP
// Get the codec
codec = avcodec_find_decoder(AV_CODEC_ID_H264);
if (!codec) {
exit(1);
}
// Prepare the output
AVFormatContext* oc = avformat_alloc_context();
oc->oformat = av_guess_format(NULL, "video.mp4", NULL);
avio_open2(&oc->pb, "video.mp4", AVIO_FLAG_WRITE, NULL, NULL);
// Write header
stream = avformat_new_stream(oc, (AVCodec*) format_ctx->streams[video_stream_index]->codec->codec);
avcodec_parameters_copy(stream->codecpar, format_ctx->streams[video_stream_index]->codecpar);
stream->sample_aspect_ratio = format_ctx->streams[video_stream_index]->codec->sample_aspect_ratio;
stream->codecpar->codec_tag = 0;
stream->time_base = format_ctx->streams[video_stream_index]->time_base;
avformat_write_header(oc, NULL);
time_t timenow, timestart;
timestart = timenow = get_time();
bool got_key_frame = 0;
while (av_read_frame(format_ctx, &packet) >= 0 && cnt < 200000) { //read ~ 200000 frames
if (packet.stream_index == video_stream_index) { //packet is video
// Make sure we start on a key frame
if ( !got_key_frame && timestart == timenow && ! ( packet.flags & AV_PKT_FLAG_KEY ) ) {
timestart = timenow = get_time();
continue;
}
got_key_frame = 1;
std::cout << cnt << std::endl;
av_interleaved_write_frame( oc, &packet );
cnt++;
}
av_free_packet(&packet);
av_init_packet(&packet);
timenow = get_time();
}
av_write_trailer(oc);
avcodec_close(stream->codec);
avio_close(oc->pb);
avformat_free_context(oc);
av_read_pause(format_ctx);
avcodec_free_context(&c);
avformat_network_deinit();
return 0;
}
</sstream></fstream></iostream>