Re: [FFmpeg-devel] [PATCH] ffmpeg: Copy extradata if it has been initialized later from the encoder
On Sat, Sep 06, 2014 at 04:42:48AM +0200, Michael Niedermayer wrote: > Fixes Ticket3909 > > Signed-off-by: Michael Niedermayer > --- > ffmpeg.c |8 > 1 file changed, 8 insertions(+) applied [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Breaking DRM is a little like attempting to break through a door even though the window is wide open and the only thing in the house is a bunch of things you dont want and which you would get tomorrow for free anyway signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] ffplay: Dont autoexeit by default on single images
Signed-off-by: Michael Niedermayer --- ffplay.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ffplay.c b/ffplay.c index 06bccce..64ec058 100644 --- a/ffplay.c +++ b/ffplay.c @@ -185,6 +185,7 @@ typedef struct VideoState { int realtime; int audio_finished; int video_finished; +int video_frames; Clock audclk; Clock vidclk; @@ -311,7 +312,7 @@ static int fast = 0; static int genpts = 0; static int lowres = 0; static int decoder_reorder_pts = -1; -static int autoexit = 1; +static int autoexit = -1; static int exit_on_keydown; static int exit_on_mousedown; static int loop = 1; @@ -1701,6 +1702,8 @@ static int get_video_frame(VideoState *is, AVFrame *frame, AVPacket *pkt, int *s int ret = 1; double dpts = NAN; +is->video_frames ++; + if (decoder_reorder_pts == -1) { frame->pts = av_frame_get_best_effort_timestamp(frame); } else if (decoder_reorder_pts) { @@ -2995,7 +2998,7 @@ static int read_thread(void *arg) (!is->video_st || (is->video_finished == is->videoq.serial && pictq_nb_remaining(is) == 0))) { if (loop != 1 && (!loop || --loop)) { stream_seek(is, start_time != AV_NOPTS_VALUE ? start_time : 0, 0, 0); -} else if (autoexit) { +} else if (autoexit == 1 || (autoexit == -1 && is->video_frames != 1)) { ret = AVERROR_EOF; goto fail; } -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/swfdec: Do not change the pixel format
On Tue, Sep 02, 2014 at 04:51:27PM +0200, Michael Niedermayer wrote: > This is currently not supported > Fixes part of Ticket 3539 > > Signed-off-by: Michael Niedermayer applied [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Republics decline into democracies and democracies degenerate into despotisms. -- Aristotle signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/3] libswresample: move condition to start of loop.
On Sat, Sep 06, 2014 at 09:25:51PM +0200, Reimar Döffinger wrote: > This avoids several issue like calculating sum/maxcoef > incorrectly due to adding up matrix entries that will > be overwritten, as well as out-of-range writes to > s->matrix if the maximum allowed number of channels is used. > > Signed-off-by: Reimar Döffinger LGTM [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Breaking DRM is a little like attempting to break through a door even though the window is wide open and the only thing in the house is a bunch of things you dont want and which you would get tomorrow for free anyway signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] fix two spelling errors
On 06.09.2014 13:45, Reimar Döffinger wrote: On Sat, Sep 06, 2014 at 12:13:30PM +0200, Andreas Cadhalpun wrote: -Effectively this allows to add padding with zeros from the left. +Effectively this allows one to add padding with zeros from the left. Huh? I don't think the second is more correct, and it sure sounds worse. What is this trying to say anyway? The 'allows to' phrase is detected as spelling mistake by lintian. But I agree, that it doesn't sound much better with the 'one' added. Does it mean to say "This will pad with zeros from the left"? The words "+Effectively" and "allows" to me seem to be just useless and confusing fillers and should go, most uses of such filler words is misplaced in documentation. I'm wondering whether it will only pad, or also truncate the output, if it is too long? (I think it won't.) Reading the whole paragraph again, I noticed that some articles are missing, as well. Attached is a patch trying to improve the wording of this paragraph. Best regards, Andreas >From be0713f01537927ff4f87ec7f6ecb114beed2fc6 Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun Date: Sat, 6 Sep 2014 23:49:43 +0200 Subject: [PATCH] doc/filters.texi: improve the wording of the expr_int_format documentation --- doc/filters.texi | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index 627f112..bb486ea 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -4083,11 +4083,11 @@ value. @item expr_int_format, eif Evaluate the expression's value and output as formatted integer. -First argument is expression to be evaluated, same as for @var{expr} function. -Second argument specifies output format. Allowed values are 'x', 'X', 'd' and -'u', they are treated exactly as in printf function. -Third parameter is optional and sets the number of positions taken by output. -Effectively this allows to add padding with zeros from the left. +The first argument is the expression to be evaluated, just as for the @var{expr} function. +The second argument specifies the output format. Allowed values are 'x', 'X', 'd' and +'u'. They are treated exactly as in the printf function. +The third parameter is optional and sets the number of positions taken by the output. +It can be used to add padding with zeros from the left. @item gmtime The time at which the filter is running, expressed in UTC. -- 2.1.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/3] libswresample: Avoid needlessly large on-stack array.
On Sat, Sep 06, 2014 at 09:25:49PM +0200, Reimar Döffinger wrote: > We only actually need to use a tiny part of it. > Unfortunately we seem to have no real test coverage on > the code, so this is a bit risky. > > Signed-off-by: Reimar Döffinger > --- > libswresample/rematrix.c | 14 +- > 1 file changed, 9 insertions(+), 5 deletions(-) should be ok [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I have never wished to cater to the crowd; for what I know they do not approve, and what they approve I do not know. -- Epicurus signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/3] Remove pointless if.
On Sat, Sep 06, 2014 at 09:25:50PM +0200, Reimar Döffinger wrote: > A branch to avoid some calculation seems unlikely to have any benefits. > > Signed-off-by: Reimar Döffinger > --- > libswresample/rematrix.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) LGTM [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Observe your enemies, for they first find out your faults. -- Antisthenes signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] huffyuvdec: avoid large stack use.
On Wed, Sep 03, 2014 at 10:49:38PM +0200, Michael Niedermayer wrote: > On Wed, Sep 03, 2014 at 09:40:56PM +0200, Reimar Döffinger wrote: > > Signed-off-by: Reimar Döffinger > > --- > > libavcodec/huffyuvdec.c | 19 +-- > > 1 file changed, 13 insertions(+), 6 deletions(-) > > LGTM Pushed. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavf/segment: add segment_format_options option
On Sat, Sep 06, 2014 at 03:46:03PM +0200, Stefano Sabatini wrote: > TODO: bump micro > --- > doc/muxers.texi | 5 + > libavformat/segment.c | 25 +++-- > 2 files changed, 28 insertions(+), 2 deletions(-) > > diff --git a/doc/muxers.texi b/doc/muxers.texi > index d7833a6..6f3ac1d 100644 > --- a/doc/muxers.texi > +++ b/doc/muxers.texi > @@ -804,6 +804,11 @@ reference stream. The default value is @code{auto}. > Override the inner container format, by default it is guessed by the filename > extension. > > +@item segment_format_options @var{options_list} > +Set output format options using a :-separated list of key=value > +parameters. Values containing @code{:} special characters must be > +escaped. > + > @item segment_list @var{name} > Generate also a listfile named @var{name}. If not specified no > listfile is generated. please add a example, i think users will have no clue how to use it otherwise patch LGTM otherwise [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The bravest are surely those who have the clearest vision of what is before them, glory and danger alike, and yet notwithstanding go out to meet it. -- Thucydides signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/hevc_ps: Always initialize backup in decode_vui()
On Sat, Sep 06, 2014 at 01:28:41PM +0200, Christophe Gisquet wrote: > 2014-09-06 12:40 GMT+02:00 Michael Niedermayer : > > -// Backup context in case an alternate header is detected > > -if( get_bits_left(gb) >= 66) > > -memcpy(&backup, gb, sizeof(backup)); > > +memcpy(&backup, gb, sizeof(backup)); > > I know people consider obvious comments to waste screen space, but I'd > prefer more than fewer comments on this. > > What about leaving it? ok > > Otherwise, ok, and sorry for the original buggy code. applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB What does censorship reveal? It reveals fear. -- Julian Assange signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 3/3] libswresample: move condition to start of loop.
This avoids several issue like calculating sum/maxcoef incorrectly due to adding up matrix entries that will be overwritten, as well as out-of-range writes to s->matrix if the maximum allowed number of channels is used. Signed-off-by: Reimar Döffinger --- libswresample/rematrix.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c index 5da3056..6552a2f 100644 --- a/libswresample/rematrix.c +++ b/libswresample/rematrix.c @@ -299,18 +299,20 @@ av_cold static int auto_matrix(SwrContext *s) for(out_i=i=0; i<64; i++){ double sum=0; int in_i=0; +if((out_ch_layout & (1ULLmatrix[out_i][in_i]= i == j && (in_ch_layout & out_ch_layout & (1ULL rematrix_volume; -- 2.1.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/3] libswresample: Avoid needlessly large on-stack array.
We only actually need to use a tiny part of it. Unfortunately we seem to have no real test coverage on the code, so this is a bit risky. Signed-off-by: Reimar Döffinger --- libswresample/rematrix.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c index bf2abcf..62662f8 100644 --- a/libswresample/rematrix.c +++ b/libswresample/rematrix.c @@ -56,6 +56,7 @@ #define TOP_BACK_LEFT 15 #define TOP_BACK_CENTER16 #define TOP_BACK_RIGHT 17 +#define NUM_NAMED_CHANNELS 18 int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride) { @@ -112,7 +113,7 @@ static int sane_layout(int64_t layout){ av_cold static int auto_matrix(SwrContext *s) { int i, j, out_i; -double matrix[64][64]={{0}}; +double matrix[NUM_NAMED_CHANNELS][NUM_NAMED_CHANNELS]={{0}}; int64_t unaccounted, in_ch_layout, out_ch_layout; double maxcoef=0; char buf[128]; @@ -145,7 +146,7 @@ av_cold static int auto_matrix(SwrContext *s) } memset(s->matrix, 0, sizeof(s->matrix)); -for(i=0; i<64; i++){ +for(i=0; imatrix[out_i][in_i]= matrix[i][j]; -if(matrix[i][j]){ -sum += fabs(matrix[i][j]); +if (i < FF_ARRAY_ELEMS(matrix) && j < FF_ARRAY_ELEMS(matrix[0])) +s->matrix[out_i][in_i]= matrix[i][j]; +else +s->matrix[out_i][in_i]= i == j && (in_ch_layout & out_ch_layout & (1ULLmatrix[out_i][in_i]); } if(in_ch_layout & (1ULL
[FFmpeg-devel] [PATCH 2/3] Remove pointless if.
A branch to avoid some calculation seems unlikely to have any benefits. Signed-off-by: Reimar Döffinger --- libswresample/rematrix.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c index 62662f8..5da3056 100644 --- a/libswresample/rematrix.c +++ b/libswresample/rematrix.c @@ -304,9 +304,7 @@ av_cold static int auto_matrix(SwrContext *s) s->matrix[out_i][in_i]= matrix[i][j]; else s->matrix[out_i][in_i]= i == j && (in_ch_layout & out_ch_layout & (1ULLmatrix[out_i][in_i]); -} +sum += fabs(s->matrix[out_i][in_i]); if(in_ch_layout & (1ULL
Re: [FFmpeg-devel] [PATCH 1/2] libswresample: Avoid needlessly large on-stack array.
On Wed, Sep 03, 2014 at 10:48:38PM +0200, Michael Niedermayer wrote: > On Wed, Sep 03, 2014 at 09:40:55PM +0200, Reimar Döffinger wrote: > > We only actually need to use a tiny part of it. > > Unfortunately we seem to have no real test coverage on > > the code, so this is a bit risky. > > > > Signed-off-by: Reimar Döffinger > > --- > > libswresample/rematrix.c | 23 +-- > > 1 file changed, 17 insertions(+), 6 deletions(-) > [...] > > @@ -295,10 +296,10 @@ av_cold static int auto_matrix(SwrContext *s) > > av_assert0(0); > > } > > > > -for(out_i=i=0; i<64; i++){ > > +for(out_i=i=0; i > double sum=0; > > -int in_i=0; > > -for(j=0; j<64; j++){ > > +in_i=0; > > +for(j=0; j > s->matrix[out_i][in_i]= matrix[i][j]; > > if(matrix[i][j]){ > > sum += fabs(matrix[i][j]); > > @@ -310,6 +311,16 @@ av_cold static int auto_matrix(SwrContext *s) > > if(out_ch_layout & (1ULL< > out_i++; > > } > > +for (; i < 64; i++) { > > +if (in_ch_layout & out_ch_layout & (1ULL< > +s->matrix[out_i][in_i] = 1.0; > > +maxcoef = FFMAX(maxcoef, 1.0); > > +} > > +if (in_ch_layout & (1ULL< > +in_i++; > > +if (out_ch_layout & (1ULL< > +out_i++; > > +} > > if(s->rematrix_volume < 0) > > maxcoef = -s->rematrix_volume; > > if (i and j are small enough) > s->matrix[out_i][in_i]= matrix[i][j]; > else > s->matrix[out_i][in_i]= 0 > sum += fabs(s->matrix[out_i][in_i]); > > in the first loop should be simpler than a seperate loop I am a bit undecided on whether the resulting code is really simpler, but at least the diff is simpler. I'll send a new patch. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] fix two spelling errors
On Sat, Sep 06, 2014 at 12:13:30PM +0200, Andreas Cadhalpun wrote: > Hi, > > attached patch fixes two spelling errors that crept in: > allows to -> allows one to > syncronization -> synchronization > > Please apply it before 2.4 gets released. > > Best regards, > Andreas [...] > --- a/libavformat/mpegts.c > +++ b/libavformat/mpegts.c > @@ -156,7 +156,7 @@ struct MpegTSContext { > }; > > #define MPEGTS_OPTIONS \ > -{ "resync_size", "Size limit for looking up a new syncronization.", > offsetof(MpegTSContext, resync_size), AV_OPT_TYPE_INT, { .i64 = > MAX_RESYNC_SIZE}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM } > +{ "resync_size", "Size limit for looking up a new synchronization.", > offsetof(MpegTSContext, resync_size), AV_OPT_TYPE_INT, { .i64 = > MAX_RESYNC_SIZE}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM } applied thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The misfortune of the wise is better than the prosperity of the fool. -- Epicurus signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/3] web/documentation: Simplify Components Documentation links
On Sat, Sep 06, 2014 at 09:12:47AM -0800, Lou Logan wrote: > On Sat, Sep 6, 2014, at 04:37 AM, db0company wrote: > > --- > > src/documentation | 18 +- > > 1 files changed, 9 insertions(+), 9 deletions(-) > > I don't have a strong opinion about this patch but there are two things > I want to bikeshed: > > 1. One nice thing about the current format is that the link names > (ffmpeg-*) are the same as the man page name for each component, such as > "man ffmpeg-filters", but I'm unsure if many users make that connection. > I doubt most users realize that by looking at the page. They can find the appropriate man-page by doing man ffm in the shell. Currently, the page index is really cluttered for no purpose, and I often see users ending up in "libavfilter" section instead of "filters", probably because the library section is easier to read, and the components just looks like a "FFmpeg words soup". > 2. It is more consistent with the "Command Line Tools Documentation" > section if the ffmpeg-* are preserved. > Maybe we should change that one as well. Something like: • ffmpeg (full help) • ffplay (full help) • ffprobe (full help) • ffserver (full help, sample configuration file) > I agree that the "FFmpeg" is redundant and could go. I'm fine with the > patch if anyone else wants to give the LGTM. -- Clément B. pgpOC7NU7jFYu.pgp Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/3] web: In the nav, Developers links to developer.html + new Contribute link
On Sat, Sep 6, 2014, at 04:37 AM, db0company wrote: > --- > src/template_head2 |3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) LGTM, thanks. I can apply, but I'll be unable to until Monday. Anyone else can feel free to beat me to it. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/3] web/documentation: Simplify Components Documentation links
On Sat, Sep 6, 2014, at 04:37 AM, db0company wrote: > --- > src/documentation | 18 +- > 1 files changed, 9 insertions(+), 9 deletions(-) I don't have a strong opinion about this patch but there are two things I want to bikeshed: 1. One nice thing about the current format is that the link names (ffmpeg-*) are the same as the man page name for each component, such as "man ffmpeg-filters", but I'm unsure if many users make that connection. 2. It is more consistent with the "Command Line Tools Documentation" section if the ffmpeg-* are preserved. I agree that the "FFmpeg" is redundant and could go. I'm fine with the patch if anyone else wants to give the LGTM. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avfilter/af_silenceremove: remove dead code
On 9/6/14, Michael Niedermayer wrote: > Fixes CID1237284 > > Signed-off-by: Michael Niedermayer > --- > libavfilter/af_silenceremove.c |7 ++- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/libavfilter/af_silenceremove.c > b/libavfilter/af_silenceremove.c > index 3f6cb7a..02b64ce 100644 > --- a/libavfilter/af_silenceremove.c > +++ b/libavfilter/af_silenceremove.c > @@ -335,13 +335,10 @@ silence_copy: > flush(out, outlink, &nb_samples_written, > &ret); > goto silence_trim; > } > -} else { > -s->mode = SILENCE_COPY_FLUSH; > -flush(out, outlink, &nb_samples_written, > &ret); > -goto silence_copy_flush; > } > +s->mode = SILENCE_COPY_FLUSH; > flush(out, outlink, &nb_samples_written, &ret); > -break; > +goto silence_copy_flush; > } > } > } > -- > 1.7.9.5 > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > ok ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] lavf/segment: add segment_format_options option
TODO: bump micro --- doc/muxers.texi | 5 + libavformat/segment.c | 25 +++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/doc/muxers.texi b/doc/muxers.texi index d7833a6..6f3ac1d 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -804,6 +804,11 @@ reference stream. The default value is @code{auto}. Override the inner container format, by default it is guessed by the filename extension. +@item segment_format_options @var{options_list} +Set output format options using a :-separated list of key=value +parameters. Values containing @code{:} special characters must be +escaped. + @item segment_list @var{name} Generate also a listfile named @var{name}. If not specified no listfile is generated. diff --git a/libavformat/segment.c b/libavformat/segment.c index 3ee7d7d..00e5881 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -72,7 +72,9 @@ typedef struct { int segment_count; ///< number of segment files already written AVOutputFormat *oformat; AVFormatContext *avf; -char *format; ///< format to use for output segment files +char *format; ///< format to use for output segment files +char *format_options_str; ///< format options to use for output segment files +AVDictionary *format_options; char *list;///< filename for the segment list file int list_flags; ///< flags affecting list generation int list_size; ///< number of entries for the segment list file @@ -563,6 +565,7 @@ static int seg_write_header(AVFormatContext *s) { SegmentContext *seg = s->priv_data; AVFormatContext *oc = NULL; +AVDictionary *options = NULL; int ret; seg->segment_count = 0; @@ -594,6 +597,15 @@ static int seg_write_header(AVFormatContext *s) } } +if (seg->format_options_str) { +ret = av_dict_parse_string(&seg->format_options, seg->format_options_str, "=", ":", 0); +if (ret < 0) { +av_log(s, AV_LOG_ERROR, "Could not parse format options list '%s'\n", + seg->format_options_str); +goto fail; +} +} + if (seg->list) { if (seg->list_type == LIST_TYPE_UNDEFINED) { if (av_match_ext(seg->list, "csv" )) seg->list_type = LIST_TYPE_CSV; @@ -645,7 +657,14 @@ static int seg_write_header(AVFormatContext *s) goto fail; } -if ((ret = avformat_write_header(oc, NULL)) < 0) { +av_dict_copy(&options, seg->format_options, 0); +ret = avformat_write_header(oc, &options); +if (av_dict_count(options)) { +av_log(s, AV_LOG_ERROR, + "Some of the provided format options in '%s' are not recognized\n", seg->format_options_str); +} +av_dict_free(&options); +if (ret < 0) { avio_close(oc->pb); goto fail; } @@ -799,6 +818,7 @@ fail: if (seg->list) avio_close(seg->list_pb); +av_dict_free(&seg->format_options); av_opt_free(seg); av_freep(&seg->times); av_freep(&seg->frames); @@ -820,6 +840,7 @@ fail: static const AVOption options[] = { { "reference_stream", "set reference stream", OFFSET(reference_stream_specifier), AV_OPT_TYPE_STRING, {.str = "auto"}, CHAR_MIN, CHAR_MAX, E }, { "segment_format","set container format used for the segments", OFFSET(format), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E }, +{ "segment_format_options", "set list of options for the container format used for the segments", OFFSET(format_options_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E }, { "segment_list", "set the segment list filename", OFFSET(list),AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E }, { "segment_list_flags","set flags affecting segment list generation", OFFSET(list_flags), AV_OPT_TYPE_FLAGS, {.i64 = SEGMENT_LIST_FLAG_CACHE }, 0, UINT_MAX, E, "list_flags"}, -- 1.8.3.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/3] web: In the nav, Developers links to developer.html + new Contribute link
--- src/template_head2 |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/template_head2 b/src/template_head2 index a818fe2..2e61b30 100644 --- a/src/template_head2 +++ b/src/template_head2 @@ -30,9 +30,10 @@ http://trac.ffmpeg.org";>Wiki - Developers + Developers Source Code + Contribute http://fate.ffmpeg.org";>FATE http://coverage.ffmpeg.org";>Code Coverage -- 1.7.0.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 3/3] web/documentation: Simplify Components Documentation links
--- src/documentation | 18 +- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/documentation b/src/documentation index a17725f..05408fd 100644 --- a/src/documentation +++ b/src/documentation @@ -29,15 +29,15 @@ Components Documentation -ffmpeg-utils: FFmpeg utilities -ffmpeg-scaler: FFmpeg video scaling and pixel format converter -ffmpeg-resampler: FFmpeg audio resampler -ffmpeg-codecs: FFmpeg encoders and decoders (codecs) -ffmpeg-bitstream-filters: FFmpeg bitstream filters -ffmpeg-formats: FFmpeg muxers and demuxers (formats) -ffmpeg-protocols: FFmpeg protocols -ffmpeg-devices: FFmpeg input and output devices -ffmpeg-filters: FFmpeg filters +Utilities +Video scaling and pixel format converter +Audio resampler +Encoders and decoders (codecs) +Bitstream filters +Muxers and demuxers (formats) +Protocols +Input and output devices +Filters -- 1.7.0.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/3] web: In README, CSS generated for ffmpeg repo not merged anymore due to copyright requirements
--- README |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README b/README index ca70560..5076719 100644 --- a/README +++ b/README @@ -18,8 +18,9 @@ GENERATE THE DOCUMENTATION To generate the documentation pages, just `./generate-doc.sh `. In case of a major CSS update, please also update the `style.min.css` file in -the main FFmpeg repo: - $ cat /path/to/ffmpeg-web/src/css_credit /path/to/ffmpeg-web/htdocs/css/{bootstrap.min.css,style.min.css} > /path/to/ffmpeg/doc/style.min.css +the main FFmpeg repo + $ cp htdocs/css/{bootstrap.min.css,style.min.css} /path/to/ffmpeg/doc/ + WEBSITE DEVELOPERS INSTRUCTIONS -- 1.7.0.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/2] ffplay: use frame queue to determine last used pos
Signed-off-by: Marton Balint --- ffplay.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/ffplay.c b/ffplay.c index c59065f..54f4584 100644 --- a/ffplay.c +++ b/ffplay.c @@ -263,7 +263,6 @@ typedef struct VideoState { int video_stream; AVStream *video_st; PacketQueue videoq; -int64_t video_current_pos; // current displayed file pos double max_frame_duration; // maximum duration of a frame - above this, we consider the jump a timestamp discontinuity #if !CONFIG_AVFILTER struct SwsContext *img_convert_ctx; @@ -637,6 +636,16 @@ static int frame_queue_nb_remaining(FrameQueue *f) return f->size - f->rindex_shown; } +/* return last shown position */ +static int64_t frame_queue_last_pos(FrameQueue *f) +{ +Frame *fp = &f->queue[f->rindex]; +if (f->rindex_shown && fp->serial == f->pktq->serial) +return fp->pos; +else +return -1; +} + static inline void fill_rectangle(SDL_Surface *screen, int x, int y, int w, int h, int color, int update) { @@ -1432,7 +1441,6 @@ static void update_video_pts(VideoState *is, double pts, int64_t pos, int serial /* update current video pts */ set_clock(&is->vidclk, pts, serial); sync_clock_to_slave(&is->extclk, &is->vidclk); -is->video_current_pos = pos; } /* called to display each frame */ @@ -1472,7 +1480,6 @@ retry: if (vp->serial != is->videoq.serial) { frame_queue_next(&is->pictq); -is->video_current_pos = -1; redisplay = 0; goto retry; } @@ -3385,11 +3392,12 @@ static void event_loop(VideoState *cur_stream) incr = -60.0; do_seek: if (seek_by_bytes) { -if (cur_stream->video_stream >= 0 && cur_stream->video_current_pos >= 0) { -pos = cur_stream->video_current_pos; -} else if (cur_stream->audio_stream >= 0 && cur_stream->audio_pkt.pos >= 0) { +pos = -1; +if (pos < 0 && cur_stream->video_stream >= 0) +pos = frame_queue_last_pos(&cur_stream->pictq); +if (pos < 0 && cur_stream->audio_stream >= 0) pos = cur_stream->audio_pkt.pos; -} else +if (pos < 0) pos = avio_tell(cur_stream->ic->pb); if (cur_stream->ic->bit_rate) incr *= cur_stream->ic->bit_rate / 8.0; -- 1.8.4.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/2] ffplay: factorize frame queue operations
Create a generic frame and a frame queue struct to handle video picture queues and subtitle picture queues with common code. Also add the possibility to queue AVFrames, however at the moment we only use SDL_Overlay buffers for video and AVSubtitles for subtitles. Signed-off-by: Marton Balint --- ffplay.c | 357 +++ 1 file changed, 199 insertions(+), 158 deletions(-) diff --git a/ffplay.c b/ffplay.c index 833b5b1..c59065f 100644 --- a/ffplay.c +++ b/ffplay.c @@ -121,25 +121,7 @@ typedef struct PacketQueue { #define VIDEO_PICTURE_QUEUE_SIZE 3 #define SUBPICTURE_QUEUE_SIZE 16 - -typedef struct VideoPicture { -double pts; // presentation timestamp for this picture -double duration;// estimated duration based on frame rate -int64_t pos;// byte position in file -SDL_Overlay *bmp; -int width, height; /* source height & width */ -int allocated; -int reallocate; -int serial; - -AVRational sar; -} VideoPicture; - -typedef struct SubPicture { -double pts; /* presentation time stamp for this picture */ -AVSubtitle sub; -int serial; -} SubPicture; +#define FRAME_QUEUE_SIZE FFMAX(VIDEO_PICTURE_QUEUE_SIZE, SUBPICTURE_QUEUE_SIZE) typedef struct AudioParams { int freq; @@ -160,6 +142,35 @@ typedef struct Clock { int *queue_serial;/* pointer to the current packet queue serial, used for obsolete clock detection */ } Clock; +/* Common struct for handling all types of decoded data and allocated render buffers. */ +typedef struct Frame { +AVFrame *frame; +AVSubtitle sub; +int serial; +double pts; /* presentation timestamp for the frame */ +double duration; /* estimated duration of the frame */ +int64_t pos; /* byte position of the frame in the input file */ +SDL_Overlay *bmp; +int allocated; +int reallocate; +int width; +int height; +AVRational sar; +} Frame; + +typedef struct FrameQueue { +Frame queue[FRAME_QUEUE_SIZE]; +int rindex; +int windex; +int size; +int max_size; +int keep_last; +int rindex_shown; +SDL_mutex *mutex; +SDL_cond *cond; +PacketQueue *pktq; +} FrameQueue; + enum { AV_SYNC_AUDIO_MASTER, /* default choice */ AV_SYNC_VIDEO_MASTER, @@ -190,6 +201,9 @@ typedef struct VideoState { Clock vidclk; Clock extclk; +FrameQueue pictq; +FrameQueue subpq; + int audio_stream; int av_sync_type; @@ -242,10 +256,6 @@ typedef struct VideoState { int subtitle_stream; AVStream *subtitle_st; PacketQueue subtitleq; -SubPicture subpq[SUBPICTURE_QUEUE_SIZE]; -int subpq_size, subpq_rindex, subpq_windex; -SDL_mutex *subpq_mutex; -SDL_cond *subpq_cond; double frame_timer; double frame_last_returned_time; @@ -255,10 +265,6 @@ typedef struct VideoState { PacketQueue videoq; int64_t video_current_pos; // current displayed file pos double max_frame_duration; // maximum duration of a frame - above this, we consider the jump a timestamp discontinuity -VideoPicture pictq[VIDEO_PICTURE_QUEUE_SIZE]; -int pictq_size, pictq_rindex, pictq_windex, pictq_rindex_shown; -SDL_mutex *pictq_mutex; -SDL_cond *pictq_cond; #if !CONFIG_AVFILTER struct SwsContext *img_convert_ctx; #endif @@ -371,6 +377,8 @@ int64_t get_valid_channel_layout(int64_t channel_layout, int channels) return 0; } +static void free_picture(Frame *vp); + static int packet_queue_put_private(PacketQueue *q, AVPacket *pkt) { MyAVPacketList *pkt1; @@ -517,6 +525,118 @@ static int packet_queue_get(PacketQueue *q, AVPacket *pkt, int block, int *seria return ret; } +static void frame_queue_unref_item(Frame *vp) +{ +av_frame_unref(vp->frame); +avsubtitle_free(&vp->sub); +} + +static int frame_queue_init(FrameQueue *f, PacketQueue *pktq, int max_size, int keep_last) +{ +int i; +memset(f, 0, sizeof(FrameQueue)); +if (!(f->mutex = SDL_CreateMutex())) +return AVERROR(ENOMEM); +if (!(f->cond = SDL_CreateCond())) +return AVERROR(ENOMEM); +f->pktq = pktq; +f->max_size = FFMIN(max_size, FRAME_QUEUE_SIZE); +f->keep_last = !!keep_last; +for (i = 0; i < f->max_size; i++) +if (!(f->queue[i].frame = av_frame_alloc())) +return AVERROR(ENOMEM); +return 0; +} + +static void frame_queue_destory(FrameQueue *f) +{ +int i; +for (i = 0; i < f->max_size; i++) { +Frame *vp = &f->queue[i]; +frame_queue_unref_item(vp); +av_frame_free(&vp->frame); +free_picture(vp); +} +SDL_DestroyMutex(f->mutex); +SDL_DestroyCond(f->cond); +} + +static void frame_queue_signal(FrameQueue *f) +{ +SDL_LockMutex(f->mutex); +SDL_CondSignal(f->cond); +SDL_UnlockMutex(f->mutex); +} + +static Frame *frame_queue_peek(FrameQueue *f) +{ +return &f->queue[(f->rind
Re: [FFmpeg-devel] [PATCH] fix two spelling errors
On Sat, Sep 06, 2014 at 12:13:30PM +0200, Andreas Cadhalpun wrote: > -Effectively this allows to add padding with zeros from the left. > +Effectively this allows one to add padding with zeros from the left. Huh? I don't think the second is more correct, and it sure sounds worse. What is this trying to say anyway? Does it mean to say "This will pad with zeros from the left"? The words "+Effectively" and "allows" to me seem to be just useless and confusing fillers and should go, most uses of such filler words is misplaced in documentation. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/hevc_ps: Always initialize backup in decode_vui()
2014-09-06 12:40 GMT+02:00 Michael Niedermayer : > -// Backup context in case an alternate header is detected > -if( get_bits_left(gb) >= 66) > -memcpy(&backup, gb, sizeof(backup)); > +memcpy(&backup, gb, sizeof(backup)); I know people consider obvious comments to waste screen space, but I'd prefer more than fewer comments on this. What about leaving it? Otherwise, ok, and sorry for the original buggy code. -- Christophe ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avfilter/af_silenceremove: remove dead code
Fixes CID1237284 Signed-off-by: Michael Niedermayer --- libavfilter/af_silenceremove.c |7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libavfilter/af_silenceremove.c b/libavfilter/af_silenceremove.c index 3f6cb7a..02b64ce 100644 --- a/libavfilter/af_silenceremove.c +++ b/libavfilter/af_silenceremove.c @@ -335,13 +335,10 @@ silence_copy: flush(out, outlink, &nb_samples_written, &ret); goto silence_trim; } -} else { -s->mode = SILENCE_COPY_FLUSH; -flush(out, outlink, &nb_samples_written, &ret); -goto silence_copy_flush; } +s->mode = SILENCE_COPY_FLUSH; flush(out, outlink, &nb_samples_written, &ret); -break; +goto silence_copy_flush; } } } -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avcodec/hevc_ps: Always initialize backup in decode_vui()
Fixes CID1237283 Signed-off-by: Michael Niedermayer --- libavcodec/hevc_ps.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c index 365652c..219af2f 100644 --- a/libavcodec/hevc_ps.c +++ b/libavcodec/hevc_ps.c @@ -526,9 +526,7 @@ static void decode_vui(HEVCContext *s, HEVCSPS *sps) vui->frame_field_info_present_flag = get_bits1(gb); vui->default_display_window_flag = get_bits1(gb); -// Backup context in case an alternate header is detected -if( get_bits_left(gb) >= 66) -memcpy(&backup, gb, sizeof(backup)); +memcpy(&backup, gb, sizeof(backup)); if (vui->default_display_window_flag) { //TODO: * 2 is only valid for 420 -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2 6/6] avformat/subtitles: guess UTF-16 if no BOM present
On Sat, Sep 06, 2014 at 08:24:10AM +0200, Reimar Döffinger wrote: > On 06.09.2014, at 00:23, wm4 wrote: > > On Sat, 6 Sep 2014 00:00:10 +0200 > > Michael Niedermayer wrote: > > > >> On Thu, Sep 04, 2014 at 10:40:27PM +0200, wm4 wrote: > >>> --- > >>> Follows reimar's suggestion for detecting UTF-16. If the detection goes > >>> wrong, probing the format won't succeed, so this should not break > >>> anything. > >>> > >> > >>> I didn't use ffio_ensure_seekback), because this apparently reallocates > >>> the buffer - which we certainly don't want, because the probe API > >>> doesn't allow this. > >> > >> the format probe API doesnt provide a AVIOContext, and if one is > >> provided, it could use a allocated and reallocatable buffer > >> or do i misunderstand ? > >> > >> [...] > > > > I'm ffio_init_context() to initialize an AVIOContext on a buffer (the > > probe buffer) > > I do not know the actual behaviour for sure, but for a context based on a > buffer, seekback should never ever be possible to fail... > So if we can detect that case, I think the ensure function should behave like > a NOP. ffio_ensure_seekback() could check if AVIOContext.read_packet is set and return success if its not [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Democracy is the form of government in which you can choose your dictator signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] fix two spelling errors
Hi, attached patch fixes two spelling errors that crept in: allows to -> allows one to syncronization -> synchronization Please apply it before 2.4 gets released. Best regards, Andreas >From 8c4c7e6f7c1f6043156838cd9041beba91025060 Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun Date: Sat, 6 Sep 2014 12:06:39 +0200 Subject: [PATCH] fix two spelling errors --- doc/filters.texi | 2 +- libavformat/mpegts.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index 627f112..b3eba7c 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -4087,7 +4087,7 @@ First argument is expression to be evaluated, same as for @var{expr} function. Second argument specifies output format. Allowed values are 'x', 'X', 'd' and 'u', they are treated exactly as in printf function. Third parameter is optional and sets the number of positions taken by output. -Effectively this allows to add padding with zeros from the left. +Effectively this allows one to add padding with zeros from the left. @item gmtime The time at which the filter is running, expressed in UTC. diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 20a2d30..c7e8bb5 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -156,7 +156,7 @@ struct MpegTSContext { }; #define MPEGTS_OPTIONS \ -{ "resync_size", "Size limit for looking up a new syncronization.", offsetof(MpegTSContext, resync_size), AV_OPT_TYPE_INT, { .i64 = MAX_RESYNC_SIZE}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM } +{ "resync_size", "Size limit for looking up a new synchronization.", offsetof(MpegTSContext, resync_size), AV_OPT_TYPE_INT, { .i64 = MAX_RESYNC_SIZE}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM } static const AVOption options[] = { MPEGTS_OPTIONS, -- 2.1.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel