
Recherche avancée
Médias (91)
-
Head down (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Echoplex (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Discipline (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Letting you (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
1 000 000 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
999 999 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
Autres articles (18)
-
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 (...) -
Submit enhancements and plugins
13 avril 2011If you have developed a new extension to add one or more useful features to MediaSPIP, let us know and its integration into the core MedisSPIP functionality will be considered.
You can use the development discussion list to request for help with creating a plugin. As MediaSPIP is based on SPIP - or you can use the SPIP discussion list SPIP-Zone. -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...)
Sur d’autres sites (3636)
-
FFmpeg - Delay Only Video Stream Of Audio Linked dshow Input
15 avril 2018, par NimbleI’m having a slight issue trying to sync my audio and video up with an acceptable margin of error. Here is my command :
ffmpeg -y -thread_queue_size 9999 -indexmem 9999 -guess_layout_max 0 -f dshow -video_size 3440x1440 -rtbufsize 2147.48M ^
-framerate 100 -pixel_format nv12 -i video="Video (00 Pro Capture HDMI 4K+)":audio="SPDIF/ADAT (1+2) (RME Fireface UC)" ^
-map 0:0,0:1 -map 0:1 -flags +cgop -force_key_frames expr:gte(t,n_forced*2) -c:v h264_nvenc -preset: llhp -pix_fmt nv12 ^
-b:v 250M -minrate 250M -maxrate 250M -bufsize 250M -c:a aac -ar 44100 -b:a 384k -ac 2 -r 100 -af "aresample=async=250" ^
-vsync 1 -max_muxing_queue_size 9999 -f segment -segment_time 600 -segment_wrap 9 -reset_timestamps 1 ^
C:\Users\djcim\Videos\PC\PC\PC%02d.tsMy problem is the video comes in slightly ahead of the audio, I can use -itsoffset but then I have to call the video and audio as separate inputs as -itsoffset offsets both audio and video. While this may seem the obvious solution it causes inconsistent audio synchronization if the audio isn’t called with the video. Basically if both audio and video aren’t called at the same time the video can now be ahead or behind with a 2-3 frame margin. When I call them at the same time the video consistently comes in 2 frames ahead of the audio, every time. I just need a way to delay only the video stream without delaying the audio while keeping both audio and video linked from the beginning. I’ve tried this with no luck :
ffmpeg -y -thread_queue_size 9999 -indexmem 9999 -guess_layout_max 0 -f dshow -video_size 3440x1440 -rtbufsize 2147.48M ^
-framerate 200 -pixel_format nv12 -i video="Video (00 Pro Capture HDMI 4K+)":audio="SPDIF/ADAT (1+2) (RME Fireface UC)" ^
-flags +cgop -force_key_frames expr:gte(t,n_forced*2) -c:v h264_nvenc -preset: llhp -pix_fmt nv12 -b:v 250M ^
-minrate 250M -maxrate 250M -bufsize 250M -c:a aac -ar 44100 -b:a 384k -ac 2 -r 100 ^
-filter_complex "[0:v] setpts=PTS-STARTPTS+.032/TB [v]; [0:a] asetpts=PTS-STARTPTS, aresample=async=250 [a]" -map [v] ^
-map [a] -vsync 1 -max_muxing_queue_size 9999 -f segment -segment_time 600 -segment_wrap 9 -reset_timestamps 1 ^
C:\Users\djcim\Videos\PC\PC\PC%02d.tsJust like -itsoffset both video and audio are being delayed. You can delay solely audio with adelay, but there doesn’t seem to be a video delaying equivalent.
Any help or advice would be greatly appreciated.
-
avcodec/options_table : Add SMPTE ST428-1 colour primaries (CIE 1931 XYZ) to command...
1er septembre 2015, par Kevin Wheatleyavcodec/options_table : Add SMPTE ST428-1 colour primaries (CIE 1931 XYZ) to command line options
Signed-off-by : Kevin Wheatley <kevin.j.wheatley@gmail.com>
Reviewed-by : Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by : Michael Niedermayer <michael@niedermayer.cc> -
How to use ffmpeg api to make a filter overlay water mark ?
6 septembre 2022, par Leon LeeOS : Ubuntu 20.04


FFmpeg : 4.4.0


Test video :


Input #0, hevc, from './videos/akiyo_352x288p25.265' :
Duration : N/A, bitrate : N/A
Stream #0:0 : Video : hevc (Main), yuv420p(tv), 352x288, 25 fps, 25 tbr, 1200k tbn, 25 tbc


Test watermark :


200*200.png


I copy ffmpeg official example.


Compiler no error, run no error , but i can't see add watermark


Here is my code


#include <libavcodec></libavcodec>avcodec.h>
#include <libavformat></libavformat>avformat.h>
#include <libavutil></libavutil>opt.h>
#include <libavfilter></libavfilter>buffersink.h>
#include <libavfilter></libavfilter>buffersrc.h>
int open_input_file(AVFormatContext *fmt, AVCodecContext **codecctx, AVCodec *codec, const char *filename, int index)
{
 int ret = 0;
 char msg[500];
 *codecctx = avcodec_alloc_context3(codec);
 ret = avcodec_parameters_to_context(*codecctx, fmt->streams[index]->codecpar);
 if (ret < 0)
 {
 printf("avcodec_parameters_to_context error,ret:%d\n", ret);
 
 return -1;
 }

 // open 解码器
 ret = avcodec_open2(*codecctx, codec, NULL);
 if (ret < 0)
 {
 printf("avcodec_open2 error,ret:%d\n", ret);
 
 return -2;
 }
 printf("pix:%d\n", (*codecctx)->pix_fmt);
 return ret;
}

int init_filter(AVFilterContext **buffersrc_ctx, AVFilterContext **buffersink_ctx, AVFilterGraph **filter_graph, AVStream *stream, AVCodecContext *codecctx, const char *filter_desc)
{
 int ret = -1;
 char args[512];
 char msg[500];
 const AVFilter *buffersrc = avfilter_get_by_name("buffer");
 const AVFilter *buffersink = avfilter_get_by_name("buffersink");

 AVFilterInOut *input = avfilter_inout_alloc();
 AVFilterInOut *output = avfilter_inout_alloc();

 AVRational time_base = stream->time_base;
 enum AVPixelFormat pix_fmts[] = {AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE};

 if (!output || !input || !filter_graph)
 {
 ret = -1;
 printf("avfilter_graph_alloc/avfilter_inout_alloc error,ret:%d\n", ret);
 
 goto end;
 }
 snprintf(args, sizeof(args), "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d", codecctx->width, codecctx->height, codecctx->pix_fmt, stream->time_base.num, stream->time_base.den, codecctx->sample_aspect_ratio.num, codecctx->sample_aspect_ratio.den);
 ret = avfilter_graph_create_filter(buffersrc_ctx, buffersrc, "in", args, NULL, *filter_graph);
 if (ret < 0)
 {
 printf("avfilter_graph_create_filter buffersrc error,ret:%d\n", ret);
 
 goto end;
 }

 ret = avfilter_graph_create_filter(buffersink_ctx, buffersink, "out", NULL, NULL, *filter_graph);
 if (ret < 0)
 {
 printf("avfilter_graph_create_filter buffersink error,ret:%d\n", ret);
 
 goto end;
 }
 ret = av_opt_set_int_list(*buffersink_ctx, "pix_fmts", pix_fmts, AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN);
 if (ret < 0)
 {
 printf("av_opt_set_int_list error,ret:%d\n", ret);
 
 goto end;
 }
 /*
 * 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.
 */
 output->name = av_strdup("in");
 output->filter_ctx = *buffersrc_ctx;
 output->pad_idx = 0;
 output->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.
 */
 input->name = av_strdup("out");
 input->filter_ctx = *buffersink_ctx;
 input->pad_idx = 0;
 input->next = NULL;

 if ((ret = avfilter_graph_parse_ptr(*filter_graph, filter_desc, &input, &output, NULL)) < 0)
 {
 printf("avfilter_graph_parse_ptr error,ret:%d\n", ret);
 
 goto end;
 }

 if ((ret = avfilter_graph_config(*filter_graph, NULL)) < 0)
 {
 printf("avfilter_graph_config error,ret:%d\n", ret);
 
 goto end;
 }
 end:
 avfilter_inout_free(&input);
 avfilter_inout_free(&output);
 return ret;
}

int main(int argc, char **argv)
{
 int ret;
 char msg[500];
 const char *filter_descr = "drawbox=x=100:y=100:w=100:h=100:color=pink@0.5"; // OK
 //const char *filter_descr = "movie=200.png[wm];[in][wm]overlay=10:10[out]"; //Test
 // const char *filter_descr = "scale=640:360,transpose=cclock";
 AVFormatContext *pFormatCtx = NULL;
 AVCodecContext *pCodecCtx;
 AVFilterContext *buffersink_ctx;
 AVFilterContext *buffersrc_ctx;
 AVFilterGraph *filter_graph;
 AVCodec *codec;
 int video_stream_index = -1;

 AVPacket packet;
 AVFrame *pFrame;
 AVFrame *pFrame_out;
 filter_graph = avfilter_graph_alloc();
 FILE *fp_yuv = fopen("test.yuv", "wb+");
 ret = avformat_open_input(&pFormatCtx, argv[1], NULL, NULL);
 if (ret < 0)
 {
 printf("avformat_open_input error,ret:%d\n", ret);
 
 return -1;
 }

 ret = avformat_find_stream_info(pFormatCtx, NULL);
 if (ret < 0)
 {
 printf("avformat_find_stream_info error,ret:%d\n", ret);
 
 return -2;
 }

 ret = av_find_best_stream(pFormatCtx, AVMEDIA_TYPE_VIDEO, -1, -1, &codec, 0);
 if (ret < 0)
 {
 printf("av_find_best_stream error,ret:%d\n", ret);
 
 return -3;
 }
 // 获取到视频流索引
 video_stream_index = ret;

 av_dump_format(pFormatCtx, 0, argv[1], 0);
 if ((ret = open_input_file(pFormatCtx, &pCodecCtx, codec, argv[1], video_stream_index)) < 0)
 {
 ret = -1;
 printf("open_input_file error,ret:%d\n", ret);
 
 goto end;
 }

 if ((ret = init_filter(&buffersrc_ctx, &buffersink_ctx, &filter_graph, pFormatCtx->streams[video_stream_index], pCodecCtx, filter_descr)) < 0)
 {
 ret = -2;
 printf("init_filter error,ret:%d\n", ret);
 
 goto end;
 }
 pFrame = av_frame_alloc();
 pFrame_out = av_frame_alloc();
 while (1)
 {
 if ((ret = av_read_frame(pFormatCtx, &packet)) < 0)
 break;

 if (packet.stream_index == video_stream_index)
 {
 ret = avcodec_send_packet(pCodecCtx, &packet);
 if (ret < 0)
 {
 printf("avcodec_send_packet error,ret:%d\n", ret);
 
 break;
 }

 while (ret >= 0)
 {
 ret = avcodec_receive_frame(pCodecCtx, pFrame);
 if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
 {
 break;
 }
 else if (ret < 0)
 {
 printf("avcodec_receive_frame error,ret:%d\n", ret);
 
 goto end;
 }

 pFrame->pts = pFrame->best_effort_timestamp;

 /* push the decoded frame into the filtergraph */
 ret = av_buffersrc_add_frame_flags(buffersrc_ctx, pFrame, AV_BUFFERSRC_FLAG_KEEP_REF);
 if (ret < 0)
 {
 printf("av_buffersrc_add_frame_flags error,ret:%d\n", ret);
 
 break;
 }

 /* pull filtered frames from the filtergraph */
 while (1)
 {
 ret = av_buffersink_get_frame(buffersink_ctx, pFrame_out);
 if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
 break;
 if (ret < 0)
 goto end;
 if (pFrame_out->format == AV_PIX_FMT_YUV420P)
 {
 //Y, U, V
 for (int i = 0; i < pFrame_out->height; i++)
 {
 fwrite(pFrame_out->data[0] + pFrame_out->linesize[0] * i, 1, pFrame_out->width, fp_yuv);
 }
 for (int i = 0; i < pFrame_out->height / 2; i++)
 {
 fwrite(pFrame_out->data[1] + pFrame_out->linesize[1] * i, 1, pFrame_out->width / 2, fp_yuv);
 }
 for (int i = 0; i < pFrame_out->height / 2; i++)
 {
 fwrite(pFrame_out->data[2] + pFrame_out->linesize[2] * i, 1, pFrame_out->width / 2, fp_yuv);
 }
 }
 av_frame_unref(pFrame_out);
 }
 av_frame_unref(pFrame);
 }
 }
 av_packet_unref(&packet);
 }
 end:
 avcodec_free_context(&pCodecCtx);
 fclose(fp_yuv);
}