
Recherche avancée
Médias (1)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
Autres articles (106)
-
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
-
Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs
12 avril 2011, parLa manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras. -
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...)
Sur d’autres sites (6852)
-
libx264 encoded video lags by few seconds in comparison to audio
18 septembre 2017, par Herdesh VermaBelow is the code i am using for reading a .3gp file encoding it using libx264 and writing it to .mp4 container. Code is working but when i play .mp4 file then video is not in sync with audio. Video is few second slow in comparison to audio.
// Read all packet from context
while( av_read_frame( fmt_ctx , pAVPacket ) >= 0 )
{
int decoded = pAVPacket->size;
if(pAVPacket->stream_index == video_stream_idx)
{
//decode packet
value = avcodec_decode_video2(video_dec_ctx , pAVFrame ,
&frameFinished , pAVPacket );
if( value < 0)
{
av_free_packet(pAVPacket);
return -1;
}
if(frameFinished)// Frame successfully decoded :)
{
sws_scale(swsCtx_, (const uint8_t *const *) pAVFrame->data,
pAVFrame->linesize, 0, video_dec_ctx->height, outFrame->data,
outFrame->linesize);
av_init_packet(&outPacket);
outPacket.data = NULL; // packet data will be allocated by
the encoder
outPacket.size = 0;
outFrame->pts=z;
//encode frame
avcodec_encode_video2(outAVCodecContext , &outPacket ,outFrame ,
&got_picture);
if(got_picture)
{
if(outPacket.pts != AV_NOPTS_VALUE)
outPacket.pts = av_rescale_q(outPacket.pts, video_st-
>codec->time_base, video_st->time_base);
if(outPacket.dts != AV_NOPTS_VALUE)
outPacket.dts = av_rescale_q(outPacket.dts, video_st-
>codec->time_base, video_st->time_base);
//Write encoded packet to file.
if(av_write_frame(outAVFormatContext , &outPacket) != 0)
{
av_free_packet(pAVPacket);
av_free_packet(&outPacket);
return -1;
}
z++;
av_free_packet(&outPacket);
} // got_picture
} // got_picture
}
// If packet is from audio stream
else if (pAVPacket->stream_index == audio_stream_idx)
{
//Write to file without decoding and encoding it
if(av_write_frame(outAVFormatContext , pAVPacket) != 0)
{
}
}
av_free_packet(pAVPacket);
//z++;
}// End of while-loop
value = av_write_trailer(outAVFormatContext);
if( value < 0)
{
return -1;
}I am using below settings :
outAVCodecContext->codec_id = AV_CODEC_ID_H264;// AV_CODEC_ID_MPEG4; // AV_CODEC_ID_H264 // AV_CODEC_ID_MPEG1VIDEO
outAVCodecContext->bit_rate_tolerance = BIT_RATE_TOLERANT;
outAVCodecContext->rc_max_rate = RC_MAX_RATE;
outAVCodecContext->rc_buffer_size = RC_BUFFER_SIZE;
outAVCodecContext->gop_size = GOP_SIZE;
outAVCodecContext->b_frame_strategy = B_FRAME_STRATEGY;
outAVCodecContext->coder_type = CODER_TYPE;
outAVCodecContext->me_cmp = ME_CMP;
outAVCodecContext->me_range = ME_RANGE; //16
outAVCodecContext->qmin = QMIN; //10
outAVCodecContext->qmax = QMAX; //51
outAVCodecContext->scenechange_threshold = SCENECHANGE_THRESHOLD; //40
outAVCodecContext->flags |= CODEC_FLAG_LOOP_FILTER;
outAVCodecContext->me_method = ME_METHOD;
outAVCodecContext->me_subpel_quality = ME_SUBPEL_QUALITY;
outAVCodecContext->i_quant_factor = I_QUANT_FACTOR; //0.71
outAVCodecContext->qcompress = QCOMPRESS;
outAVCodecContext->max_qdiff = MAX_QDIFF;
av_dict_set( &codec_options, "preset", "superfast", 0 );And values are defined as below :
#define VAVLON_VALUES_H
#define BIT_RATE_TOLERANT 0;
#define RC_MAX_RATE 0;
#define RC_BUFFER_SIZE 0;
#define GOP_SIZE 40;
#define B_FRAME_STRATEGY 0;
#define CODER_TYPE 1;
#define ME_CMP 1;
#define ME_RANGE 16; //16
#define QMIN 30; //37
#define QMAX 40; //70
#define SCENECHANGE_THRESHOLD 40; //40
#define ME_METHOD ME_HEX;
#define ME_SUBPEL_QUALITY 40;
#define I_QUANT_FACTOR 0.71;
#define QCOMPRESS 0.3;
#define MAX_QDIFF 4;
#define BIT_RATE 500000;
#define CODEC_TYPE AVMEDIA_TYPE_VIDEO;
#define PIX_FMT AV_PIX_FMT_YUV420P;
#define MAX_B_FRAMES 0;
#define NUM 1;
#define DEN 30;Above code works as expected when i am encoding .mp4 file but i notice lag in video when i try to encode .3gp file.
Can you please help in finding out what i am doing wrong ? -
Catching ffmpeg stream in C# interrupts after a few seconds
15 septembre 2017, par ChrisI want to catch an ip-cam stream with ffmpeg in c# and send it with asp.net mvc web api to a client.
As a client I use also ffmpeg to test the api call.In my api controller I call the ffmpeg.exe with the proper arguments.
string argumentString = $"-i rtsp://{_user}:{_password}@{_ipAddress}/12 -nostdin -vcodec copy -f h264 pipe:1";
ProcessStartInfo startinfo = new ProcessStartInfo(HostingEnvironment.MapPath("~/App_Data/ffmpeg.exe"), argumentString);As you can see I am ignoring the standard input (
-nostdin
) and use the standard output to output the data (pipe:1
).But the client is always closing the connection after a few seconds (12-14).
Here the error message on the server (ASP.NET) :
And here the error message on the client (ffmpeg)
I tried several ways to catch the ip-cam stream.
Via the event
OutputDataReceived
:public HttpResponseMessage Get()
{
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new PushStreamContent((stream, content, context) =>
{
Process ffmpeg = new Process();
string argumentString = $"-i rtsp://{_user}:{_password}@{_ipAddress}/12 -nostdin -vcodec copy -f h264 pipe:1";
ProcessStartInfo startinfo = new ProcessStartInfo(HostingEnvironment.MapPath("~/App_Data/ffmpeg.exe"), argumentString);
startinfo.RedirectStandardError = true;
startinfo.RedirectStandardOutput = true;
startinfo.RedirectStandardInput = true;
startinfo.UseShellExecute = false;
startinfo.CreateNoWindow = true;
ffmpeg.StartInfo = startinfo;
ffmpeg.ErrorDataReceived += (s, e) =>
{
Debug.WriteLine(e.Data);
};
StreamWriter writer = new StreamWriter(stream);
ffmpeg.OutputDataReceived += (s, e) =>
{
writer.Write(e.Data);
};
ffmpeg.Start();
ffmpeg.BeginOutputReadLine();
ffmpeg.BeginErrorReadLine();
ffmpeg.WaitForExit();
}, new MediaTypeHeaderValue("video/mp4")),
};
return result;
}I also tried to do it without a StreamWriter, with every possible Encoding :
ffmpeg.OutputDataReceived += (s, e) =>
{
byte[] toBytes = Encoding.BigEndianUnicode.GetBytes(e.Data);
stream.Write(toBytes, 0, toBytes.Length);
stream.Flush();
};Via the underlying stream from StandardOutput :
public HttpResponseMessage Get()
{
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new PushStreamContent((stream, content, context) =>
{
Process ffmpeg = new Process();
string argumentString = $"-i rtsp://{_user}:{_password}@{_ipAddress}/12 -nostdin -vcodec copy -f h264 pipe:1";
ProcessStartInfo startinfo = new ProcessStartInfo(HostingEnvironment.MapPath("~/App_Data/ffmpeg.exe"), argumentString);
startinfo.RedirectStandardError = true;
startinfo.RedirectStandardOutput = true;
startinfo.RedirectStandardInput = true;
startinfo.UseShellExecute = false;
startinfo.CreateNoWindow = true;
ffmpeg.StartInfo = startinfo;
ffmpeg.Start();
byte[] buffer = new byte[512];
int length = 0;
while ((length = ffmpeg.StandardOutput.BaseStream.Read(buffer, 0, buffer.Length)) > 0)
{
stream.Write(buffer, 0, length);
stream.Flush();
}
}, new MediaTypeHeaderValue("video/mp4")),
};
return result;
}But the result is always the same.
When I do not send the data to the client it is working fine :
public HttpResponseMessage Get()
{
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new PushStreamContent((stream, content, context) =>
{
Process ffmpeg = new Process();
string argumentString = $"-i rtsp://{_user}:{_password}@{_ipAddress}/12 -nostdin -vcodec copy -f h264 pipe:1";
ProcessStartInfo startinfo = new ProcessStartInfo(HostingEnvironment.MapPath("~/App_Data/ffmpeg.exe"), argumentString);
startinfo.RedirectStandardError = true;
startinfo.RedirectStandardOutput = true;
startinfo.RedirectStandardInput = true;
startinfo.UseShellExecute = false;
startinfo.CreateNoWindow = true;
ffmpeg.StartInfo = startinfo;
ffmpeg.Start();
byte[] buffer = new byte[512];
int length = 0;
while ((length = ffmpeg.StandardOutput.BaseStream.Read(buffer, 0, buffer.Length)) > 0)
{
//stream.Write(buffer, 0, length);
//stream.Flush();
}
}, new MediaTypeHeaderValue("video/mp4")),
};
return result;
}So what is wrong with my code ?
-
ffmpeg - Remove first few seconds from one of the audio streams
7 novembre 2024, par David DavóI have a
.mkv
file with multiple audio and subtitle streams.

One of these streams has unsynchronized audio, and I want to move it 10 seconds, how can I do it ?