
Recherche avancée
Autres articles (28)
-
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
Use, discuss, criticize
13 avril 2011, parTalk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
A discussion list is available for all exchanges between users. -
Automated installation script of MediaSPIP
25 avril 2011, parTo overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
The documentation of the use of this installation script is available here.
The code of this (...)
Sur d’autres sites (6438)
-
Your guide to cookies, web analytics, and GDPR compliance
-
record rtsp stream to file(muxing)
11 avril 2014, par user3521863AVFormatContext *g_oc = NULL;
AVStream *g_in_audio_st, *g_in_video_st;
AVStream *g_out_audio_st, *g_out_video_st;
int audio_pts = 0, video_pts = 0, audio_dts = 0, video_dts = 0;
int last_video_pts = 0;
AVPacket outpkt, *av_pkt;
// initialize video codec
static void init_video_codec(AVFormatContext *context) {
LOGI(1, "enter init_video_codec");
AVFormatContext *in_format_ctx = NULL;
AVCodecContext *avcodec_ctx = NULL;
int fps = 0;
if(context->streams[1]->r_frame_rate.num != AV_NOPTS_VALUE &&
context->streams[1]->r_frame_rate.den != 0)
fps = context->streams[1]->r_frame_rate.num / context->streams[1]->r_frame_rate.den;
else
fps = 25;
g_out_video_st = avformat_new_stream(g_oc, context->streams[1]->codec->codec);
LOGI(1, "video avformat_new_stream");
if( g_out_video_st == NULL ) {
LOGE(1, "Fail to Allocate Output Video Stream");
return ;
}
else {
LOGI(1, "Allocated Video Stream");
if( avcodec_copy_context(g_out_video_st->codec, context->streams[1]->codec) != 0 ) {
LOGE(1, "Failed to video Copy Context");
return ;
}
else {
LOGI(1, "Success to video Copy Context");
// how to setting video stream parameter?
g_out_video_st->sample_aspect_ratio.den = g_in_video_st->codec->sample_aspect_ratio.den;
g_out_video_st->sample_aspect_ratio.num = g_in_video_st->codec->sample_aspect_ratio.num;
g_out_video_st->codec->codec_id = g_in_video_st->codec->codec->id;
g_out_video_st->codec->time_base.num = 1;
g_out_video_st->codec->time_base.den = fps * (g_in_video_st->codec->ticks_per_frame);
g_out_video_st->time_base.num = 1;
g_out_video_st->time_base.den = 1000;
g_out_video_st->r_frame_rate.num = fps;
g_out_video_st->r_frame_rate.den = 1;
g_out_video_st->avg_frame_rate.den = 1;
g_out_video_st->avg_frame_rate.num = fps;
g_out_video_st->codec->width = g_frame_width;
g_out_video_st->codec->height = g_frame_height;
g_out_video_st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
}
}
LOGI(1, "end video init");
}
// initialize audio codec
static void init_audio_codec(AVFormatContext *context) {
LOGI(1, "enter init_audio_codec");
AVFormatContext *in_format_ctx = NULL;
AVCodecContext *avcodec_ctx = NULL;
g_out_audio_st = avformat_new_stream(g_oc, context->streams[0]->codec->codec);
LOGI(1, "audio avformat_new_stream");
if( avcodec_copy_context(g_out_audio_st->codec, context->streams[0]->codec) != 0 ) {
LOGE(1, "Failed to Copy audio Context");
return ;
}
else {
LOGI(1, "Success to Copy audio Context");
// how to setting video stream parameter?
g_out_audio_st->codec->codec_id = g_in_audio_st->codec->codec_id;
g_out_audio_st->codec->codec_tag = 0;
g_out_audio_st->pts = g_in_audio_st->pts;
g_out_audio_st->time_base.num = g_in_audio_st->time_base.num;
g_out_audio_st->time_base.den = g_in_audio_st->time_base.den;
g_out_audio_st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
}
LOGI(1, "end init audio");
}
// write video stream
static void write_video_stream(AVPacket *pkt) {
av_pkt = NULL;
av_pkt = pkt;
if( pkt == NULL || sizeof(*pkt) == 0 )
return;
av_rescale_q(av_pkt->pts, g_in_video_st->time_base, g_in_video_st->codec->time_base);
av_rescale_q(av_pkt->dts, g_in_video_st->time_base, g_in_video_st->codec->time_base);
av_init_packet(&outpkt);
if( av_pkt->pts != AV_NOPTS_VALUE ) {
if( last_video_pts == video_pts ) {
video_pts++;
last_video_pts = video_pts;
}
outpkt.pts = video_pts;
}
else {
outpkt.pts = AV_NOPTS_VALUE;
}
if( av_pkt->dts == AV_NOPTS_VALUE )
outpkt.dts = AV_NOPTS_VALUE;
else
outpkt.dts = video_pts;
outpkt.data = av_pkt->data;
outpkt.size = av_pkt->size;
outpkt.stream_index = av_pkt->stream_index;
outpkt.flags |= AV_PKT_FLAG_KEY;
last_video_pts = video_pts;
if(av_interleaved_write_frame(g_oc, &outpkt) < 0) {
// if(av_write_frame(g_oc, &outpkt) < 0) {
LOGE(1, "Failed Video Write");
}
else {
g_out_video_st->codec->frame_number++;
}
if( !&outpkt || sizeof(outpkt) == 0 )
return;
if( !av_pkt || sizeof(*av_pkt) == 0 )
return;
av_free_packet(&outpkt);
}
// write audio stream
static void write_audio_stream(AVPacket *pkt) {
av_pkt = NULL;
av_pkt = pkt;
if( pkt == NULL || sizeof(*pkt) == 0 )
return;
av_rescale_q(av_pkt->pts, g_in_audio_st->time_base, g_in_audio_st->codec->time_base);
av_rescale_q(av_pkt->dts, g_in_audio_st->time_base, g_in_audio_st->codec->time_base);
av_init_packet(&outpkt);
if(av_pkt->pts != AV_NOPTS_VALUE)
outpkt.pts = audio_pts;
else
outpkt.pts = AV_NOPTS_VALUE;
if(av_pkt->dts == AV_NOPTS_VALUE)
outpkt.dts = AV_NOPTS_VALUE;
else {
outpkt.dts = audio_pts;
if( outpkt.pts >= outpkt.dts)
outpkt.dts = outpkt.pts;
if(outpkt.dts == audio_dts)
outpkt.dts++;
if(outpkt.pts < outpkt.dts) {
outpkt.pts = outpkt.dts;
audio_pts = outpkt.pts;
}
outpkt.data = av_pkt->data;
outpkt.size = av_pkt->size;
outpkt.stream_index = av_pkt->stream_index;
outpkt.flags |= AV_PKT_FLAG_KEY;
video_pts = audio_pts;
audio_pts++;
if( av_interleaved_write_frame(g_oc, &outpkt) < 0 ) {
// if( av_write_frame(g_oc, &outpkt) < 0 ) {
LOGE(1, "Failed Audio Write");
}
else {
g_out_audio_st->codec->frame_number++;
}
if( !&outpkt || sizeof(outpkt) == 0 )
return;
if( !av_pkt || sizeof(*av_pkt) == 0 )
return;
av_free_packet(&outpkt);
}
}here result : recorded file
here full source : player.cI want to record rtsp stream to file on playing
i try tested video and audio streams while changing the parameters
but this result file does not match sync between video and audio
i try search about ffmpeg but almost command run or video recording was only.
please advice me. -
FFmpeg -segment with a lot of time codes
24 février 2020, par GrenightI’m making program that splits videos for running parallel encodes.
My problem is that with putting all segments into command like i can hit a limit of maximum characters in windows console. Approximately 600, while 1-2 hour movie can easily be 1000-2000 scenes.
Is there a way to use .csv file for segment so i don’t need to put all time codes to command line ? Or is there another ways ?
Here is example of command line that is used in program :
timecodes is where all time codes passed.cmd = f'{self.FFMPEG} -i {video} -map_metadata 0 -an -f segment -segment_times {timecodes} -c copy -avoid_negative_ts 1 {self.temp_dir / "split" / "%04d.mkv"}