Re: [FFmpeg-devel] [PATCH]Read aspect ratio from mxf

2014-11-18 Thread Carl Eugen Hoyos
Carl Eugen Hoyos  ag.or.at> writes:

> > I suggest you add a documented as private/internal
> > display_aspect_ratio to AVStream instead of metadata
> > also av_reduce can be replaced by av_mul_q which is 
> probably simpler
> 
> New patch attached.

The patch was merged.

Thank you, Carl Eugen

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] web/style.less: Separate out .table-bordered from .table

2014-11-18 Thread Michael Niedermayer
On Sat, Nov 15, 2014 at 09:23:39PM -0800, Timothy Gu wrote:
> The only instance of .table in the web source is the download page for the
> Git repos. I did not change that page because an unbordered table there is
> prettier IMO.
> 
> I retained the .table-bordered style in case anyone want to use it in the
> future.

do you have screenshots from before/after for the new variant ?

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavf/ffmenc: fix memleak in ffm_write_header

2014-11-18 Thread Michael Niedermayer
On Tue, Nov 18, 2014 at 03:16:19AM -0300, James Almer wrote:
> Regression since 745730c9c208c40f800d5d71ffa39aceab6ce044.
> The dynamic buffer was not being used or freed.
> 
> Signed-off-by: James Almer 

LGTM

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavf/concatdec: add timestamp log

2014-11-18 Thread Stefano Sabatini
Help debugging timestamp conversion issues.
---
 libavformat/concatdec.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index 2089883..f275bac 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -23,6 +23,7 @@
 #include "libavutil/intreadwrite.h"
 #include "libavutil/opt.h"
 #include "libavutil/parseutils.h"
+#include "libavutil/timestamp.h"
 #include "avformat.h"
 #include "internal.h"
 #include "url.h"
@@ -479,6 +480,7 @@ static int concat_read_packet(AVFormatContext *avf, 
AVPacket *pkt)
 int ret;
 int64_t delta;
 ConcatStream *cs;
+AVStream *st;
 
 while (1) {
 ret = av_read_frame(cat->avf, pkt);
@@ -504,6 +506,12 @@ static int concat_read_packet(AVFormatContext *avf, 
AVPacket *pkt)
 if ((ret = filter_packet(avf, cs, pkt)))
 return ret;
 
+st = cat->avf->streams[pkt->stream_index];
+av_log(avf, AV_LOG_DEBUG, "file:%li stream:%d pts:%s pts_time:%s dts:%s 
dts_time:%s",
+   cat->cur_file - cat->files, pkt->stream_index,
+   av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &st->time_base),
+   av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &st->time_base));
+
 delta = av_rescale_q(cat->cur_file->start_time - cat->avf->start_time,
  AV_TIME_BASE_Q,
  cat->avf->streams[pkt->stream_index]->time_base);
@@ -511,6 +519,9 @@ static int concat_read_packet(AVFormatContext *avf, 
AVPacket *pkt)
 pkt->pts += delta;
 if (pkt->dts != AV_NOPTS_VALUE)
 pkt->dts += delta;
+av_log(avf, AV_LOG_DEBUG, " -> pts:%s pts_time:%s dts:%s dts_time:%s\n",
+   av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &st->time_base),
+   av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &st->time_base));
 return ret;
 }
 
-- 
1.8.3.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavf/concatdec: fix timestamp conversion

2014-11-18 Thread Stefano Sabatini
Use the correct output time base when converting.
---
 libavformat/concatdec.c | 21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index f275bac..2574e0b 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -480,7 +480,7 @@ static int concat_read_packet(AVFormatContext *avf, 
AVPacket *pkt)
 int ret;
 int64_t delta;
 ConcatStream *cs;
-AVStream *st;
+AVStream *ist, *ost;
 
 while (1) {
 ret = av_read_frame(cat->avf, pkt);
@@ -506,22 +506,23 @@ static int concat_read_packet(AVFormatContext *avf, 
AVPacket *pkt)
 if ((ret = filter_packet(avf, cs, pkt)))
 return ret;
 
-st = cat->avf->streams[pkt->stream_index];
-av_log(avf, AV_LOG_DEBUG, "file:%li stream:%d pts:%s pts_time:%s dts:%s 
dts_time:%s",
+ist = cat->avf->streams[pkt->stream_index];
+ost = avf ->streams[pkt->stream_index];
+av_log(avf, AV_LOG_DEBUG, "file:%li stream:%d pts:%s pts_time:%s dts:%s 
dts_time:%s time_base:%d/%d",
cat->cur_file - cat->files, pkt->stream_index,
-   av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &st->time_base),
-   av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &st->time_base));
+   av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &ist->time_base),
+   av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ist->time_base), 
ist->time_base.num, ist->time_base.den);
 
+av_packet_rescale_ts(pkt, ist->time_base, ost->time_base);
 delta = av_rescale_q(cat->cur_file->start_time - cat->avf->start_time,
- AV_TIME_BASE_Q,
- cat->avf->streams[pkt->stream_index]->time_base);
+ AV_TIME_BASE_Q, ost->time_base);
 if (pkt->pts != AV_NOPTS_VALUE)
 pkt->pts += delta;
 if (pkt->dts != AV_NOPTS_VALUE)
 pkt->dts += delta;
-av_log(avf, AV_LOG_DEBUG, " -> pts:%s pts_time:%s dts:%s dts_time:%s\n",
-   av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &st->time_base),
-   av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &st->time_base));
+av_log(avf, AV_LOG_DEBUG, " -> pts:%s pts_time:%s dts:%s dts_time:%s 
time_base:%d/%d\n",
+   av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &ost->time_base),
+   av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ost->time_base), 
ost->time_base.num, ost->time_base.den);
 return ret;
 }
 
-- 
1.8.3.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] avcodec/nellymoser: Use avpriv_float_dsp_alloc()

2014-11-18 Thread Michael Niedermayer
On Fri, Nov 14, 2014 at 08:45:43PM +0100, Reimar Döffinger wrote:
> On Fri, Nov 14, 2014 at 08:38:39PM +0100, Michael Niedermayer wrote:
> > On Fri, Nov 14, 2014 at 07:59:17PM +0100, Reimar Döffinger wrote:
> > > On Fri, Nov 14, 2014 at 02:39:46PM +0100, Michael Niedermayer wrote:
> > > > Signed-off-by: Michael Niedermayer 
> > > > ---
> > > >  libavcodec/nellymoserdec.c |9 ++---
> > > >  libavcodec/nellymoserenc.c |   17 +++--
> > > >  2 files changed, 17 insertions(+), 9 deletions(-)
> > > > 
> > > > diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c
> > > > index ef16fd6..2d8a594 100644
> > > > --- a/libavcodec/nellymoserdec.c
> > > > +++ b/libavcodec/nellymoserdec.c
> > > > @@ -51,7 +51,7 @@ typedef struct NellyMoserDecodeContext {
> > > >  AVLFG   random_state;
> > > >  GetBitContext   gb;
> > > >  float   scale_bias;
> > > > -AVFloatDSPContext fdsp;
> > > > +AVFloatDSPContext *fdsp;
> > > 
> > > Why, and why only for Nellymoser?
> > > I could see it from an ABI compatibility standpoint, but wouldn't
> > > this be fairly pointless unless all other uses are changed as well?
> > 
> > it will be done for all uses after the API itself is pushed.
> > nelly was just an example and for ensuring the API is tested & works
> 
> Ok, but I think then it would be good to mark avpriv_float_dsp_init
> as deprecated and for removal on next major bump, to both make the
> purpose of the patch more clearer and avoid adding more incorrect
> usages by accident later.

yes, but ill wait with deprecation before theres no(t much) usage of
it left otherwise it would spam with warnings

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] avutil/float_dsp: add avpriv_float_dsp_alloc()

2014-11-18 Thread Michael Niedermayer
On Fri, Nov 14, 2014 at 02:39:45PM +0100, Michael Niedermayer wrote:
> TODO: update APIChanges & version
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  libavutil/float_dsp.c |   11 ++-
>  libavutil/float_dsp.h |7 +++
>  2 files changed, 17 insertions(+), 1 deletion(-)

applied


[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
conveniently.
New school: Use the highest level language in which the latest supercomputer
can solve the problem without the user falling asleep waiting.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 07/11] lavu/dict: add av_dict_serialize

2014-11-18 Thread Michael Niedermayer
On Mon, Nov 17, 2014 at 02:46:54AM +0100, Lukasz Marek wrote:
> TODO: bump minor, update doc/APIchanges

also please make sure the version you add to doc/APIchanges matches
what you set in version.h

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] doc/filters: use '|' instead of ':' in the documentation.

2014-11-18 Thread Simon Thelen
Using colons to separate the outdefs is deprecated. Switch to using '|'
to separate the list items.

Signed-off-by: Simon Thelen 
---
 doc/filters.texi | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 53f4cb2..8c16c7a 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -1710,11 +1710,11 @@ The default is 0.707q and gives a Butterworth response.
 Mix channels with specific gain levels. The filter accepts the output
 channel layout followed by a set of channels definitions.
 
-This filter is also designed to remap efficiently the channels of an audio
+This filter is also designed to efficiently remap the channels of an audio
 stream.
 
 The filter accepts parameters of the form:
-"@var{l}:@var{outdef}:@var{outdef}:..."
+"@var{l}|@var{outdef}|@var{outdef}|..."
 
 @table @option
 @item l
@@ -1745,13 +1745,13 @@ avoiding clipping noise.
 For example, if you want to down-mix from stereo to mono, but with a bigger
 factor for the left channel:
 @example
-pan=1:c0=0.9*c0+0.1*c1
+pan=1c|c0=0.9*c0+0.1*c1
 @end example
 
 A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
 7-channels surround:
 @example
-pan=stereo: FL < FL + 0.5*FC + 0.6*BL + 0.6*SL : FR < FR + 0.5*FC + 0.6*BR + 
0.6*SR
+pan=stereo| FL < FL + 0.5*FC + 0.6*BL + 0.6*SL | FR < FR + 0.5*FC + 0.6*BR + 
0.6*SR
 @end example
 
 Note that @command{ffmpeg} integrates a default down-mix (and up-mix) system
@@ -1774,25 +1774,25 @@ remapping.
 For example, if you have a 5.1 source and want a stereo audio stream by
 dropping the extra channels:
 @example
-pan="stereo: c0=FL : c1=FR"
+pan="stereo| c0=FL | c1=FR"
 @end example
 
 Given the same source, you can also switch front left and front right channels
 and keep the input channel layout:
 @example
-pan="5.1: c0=c1 : c1=c0 : c2=c2 : c3=c3 : c4=c4 : c5=c5"
+pan="5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5"
 @end example
 
 If the input is a stereo audio stream, you can mute the front left channel (and
 still keep the stereo channel layout) with:
 @example
-pan="stereo:c1=c1"
+pan="stereo|c1=c1"
 @end example
 
 Still with a stereo audio stream input, you can copy the right channel in both
 front left and right:
 @example
-pan="stereo: c0=FR : c1=FR"
+pan="stereo| c0=FR | c1=FR"
 @end example
 
 @section replaygain
-- 
2.1.3

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 07/11] lavu/dict: add av_dict_serialize

2014-11-18 Thread Lukasz Marek
On 18 November 2014 11:56, Michael Niedermayer  wrote:

> On Mon, Nov 17, 2014 at 02:46:54AM +0100, Lukasz Marek wrote:
> > TODO: bump minor, update doc/APIchanges
>
> also please make sure the version you add to doc/APIchanges matches
> what you set in version.h
>

Did I add wrong before?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 07/11] lavu/dict: add av_dict_serialize

2014-11-18 Thread Michael Niedermayer
On Tue, Nov 18, 2014 at 01:30:31PM +0100, Lukasz Marek wrote:
> On 18 November 2014 11:56, Michael Niedermayer  wrote:
> 
> > On Mon, Nov 17, 2014 at 02:46:54AM +0100, Lukasz Marek wrote:
> > > TODO: bump minor, update doc/APIchanges
> >
> > also please make sure the version you add to doc/APIchanges matches
> > what you set in version.h
> >
> 
> Did I add wrong before?

I fixed it in 4eae568a0712b8b59cb74b3882963f938c26eab4

[...]
-- 
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] doc/filters: use '|' instead of ':' in the documentation.

2014-11-18 Thread Michael Niedermayer
On Tue, Nov 18, 2014 at 01:29:27PM +0100, Simon Thelen wrote:
> Using colons to separate the outdefs is deprecated. Switch to using '|'
> to separate the list items.
> 
> Signed-off-by: Simon Thelen 
> ---
>  doc/filters.texi | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.


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/9] lavu/opt: introduce av_opt_serialize()

2014-11-18 Thread Stefano Sabatini
On date Wednesday 2014-11-12 22:32:04 +0100, Lukasz Marek encoded:
> On 12.11.2014 17:45, Stefano Sabatini wrote:
> >On date Tuesday 2014-11-11 21:24:45 +0100, Lukasz Marek encoded:
> >>On 11.11.2014 17:19, Stefano Sabatini wrote:
> >>>We have already av_get_opt() which serializes the value. Also we should
> >>>probably escape the values.
> >>
> >>I saw that function, but don't remember why I didn't use. I was
> >>wrong obviously.
> >>BTW, I found few bugs in it, sent separate patch for it.
> >
> >>Updated patch is attached. It is without escaping. I left it for
> >>separate patch.
> >
> >Not sure this is a good idea. Indeed the API allows to specify several
> >key/value and option separators, so this may be a limitation.
> 
> I don't want to say it is not needed or so, but it can be done in
> separate patch, thats all.

Yes but it would break public API.
> 
> 
> >>+int av_opt_serialize(void *obj, int opt_flags, int skip_defaults, char 
> >>**buffer,
> >>+ const char key_val_sep, const char pairs_sep)
> >
> >skip_defaults could be a flag, in case we want to extend it further
> >(for example suppose we only want to print long or short option
> >names).
> 
> Yes, this is good and I changed it.
> 
> I don't know if we should also add a parameter for choosing
> >the escaping algorithm, probably not.
> 
> I don't see any reason for it. If any in future, it can still be
> forced by flag.
> 
> >>+{
> >>+const AVOption *o = NULL;
> >>+uint8_t *buf;
> >>+AVBPrint bprint;
> >>+int ret, cnt = 0;
> >>+
> >>+if (!obj || !buffer)
> >>+return AVERROR(EINVAL);
> >>+
> >>+*buffer = NULL;
> >>+av_bprint_init(&bprint, 64, AV_BPRINT_SIZE_UNLIMITED);
> >>+
> >>+while (o = av_opt_next(obj, o)) {
> >>+if (o->flags & opt_flags != opt_flags || o->type == 
> >>AV_OPT_TYPE_CONST)
> >>+continue;
> >>+if (skip_defaults && av_opt_is_set_to_default(obj, o) > 0)
> >>+continue;
> >
> >>+if ((ret = av_opt_get(obj, o->name, 0, &buf)) < 0) {
> >
> >Here there is a potential problem. At the moment there is no way to
> >distinguish between a string set to NULL and a string set to "", since
> >av_opt_get() will return "" for a string set to NULL. For some
> >configurable elements this will make a difference. The only solution
> >in this case is to use "skip defaults". Also in general the user won't
> >be able to set an option to NULL if not using the binary interface.
> 
> I know it cannot be distinguish now. It is possible to serialize
> null as \0 for example (where \ is escaping char), but such string
> have to be unescaped before passing to set_from_string function, or
> such function support escaping itself.
> 
> 
> >>+av_bprint_finalize(&bprint, NULL);
> >>+return ret;
> >>+}
> >
> >This will print alias options as well. This was my solution:
> 

> I'm not sure it is always safe. Options with the same offset may
> have different opt_flags and different defaults.

I think this would be a bug, since for example set_defaults with set
only the value of the last specified option. Do you have examples for
this?

> user may want to serialize object if opt_flags = 0, but apply to
> object with specific mask.


> This can be controlled by a flag I think.
> 
> Updated doxy, I hope it is better.

> From 715f2ef32c85112a4d7dced62afcb6d89274a927 Mon Sep 17 00:00:00 2001
> From: Lukasz Marek 
> Date: Mon, 10 Nov 2014 22:28:44 +0100
> Subject: [PATCH] lavu/opt: introduce av_opt_serialize()
> 
> TODO: bump minor version, update doc/APIchanges
> 
> Function allows to create string containing object's serialized options.
> Such string may be passed back to av_set_options_string() in order to restore 
> options.
> 
> Signed-off-by: Lukasz Marek 
> ---
>  libavutil/opt.c| 64 
> ++
>  libavutil/opt.h| 20 +
>  tests/ref/fate/opt |  8 +++
>  3 files changed, 92 insertions(+)
> 
> diff --git a/libavutil/opt.c b/libavutil/opt.c
> index 1381cc9..f0bb3cf 100644
> --- a/libavutil/opt.c
> +++ b/libavutil/opt.c
> @@ -37,6 +37,7 @@
>  #include "pixdesc.h"
>  #include "mathematics.h"
>  #include "samplefmt.h"
> +#include "bprint.h"
>  
>  #include 
>  
> @@ -1835,6 +1836,40 @@ int av_opt_is_set_to_default_by_name(void *obj, const 
> char *name, int search_fla
>  return av_opt_is_set_to_default(target, o);
>  }
>  
> +int av_opt_serialize(void *obj, int opt_flags, int flags, char **buffer,
> + const char key_val_sep, const char pairs_sep)
> +{
> +const AVOption *o = NULL;
> +uint8_t *buf;
> +AVBPrint bprint;
> +int ret, cnt = 0;
> +
> +if (!obj || !buffer)
> +return AVERROR(EINVAL);
> +
> +*buffer = NULL;
> +av_bprint_init(&bprint, 64, AV_BPRINT_SIZE_UNLIMITED);
> +
> +while (o = av_opt_next(obj, o)) {
> +if (o->flags & opt_flags != opt_flags || o->type == 
> AV_OPT_TYPE_CONST)
> +   

Re: [FFmpeg-devel] [PATCH 2/9] lavu/opt: introduce av_opt_serialize()

2014-11-18 Thread Lukasz Marek
On 18 November 2014 17:06, Stefano Sabatini  wrote:

> > >>+av_bprint_finalize(&bprint, NULL);
> > >>+return ret;
> > >>+}
> > >
> > >This will print alias options as well. This was my solution:
> >
>
> > I'm not sure it is always safe. Options with the same offset may
> > have different opt_flags and different defaults.
>
> I think this would be a bug, since for example set_defaults with set
> only the value of the last specified option. Do you have examples for
> this?


static const AVOption avcodec_options[] = {
{"b", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.i64 =
AV_CODEC_DEFAULT_BITRATE }, 0, INT_MAX, A|V|E},
{"ab", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.i64
= 128*1000 }, 0, INT_MAX, A|E},
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavf/ffmenc: fix memleak in ffm_write_header

2014-11-18 Thread James Almer
On 18/11/14 7:26 AM, Michael Niedermayer wrote:
> On Tue, Nov 18, 2014 at 03:16:19AM -0300, James Almer wrote:
>> Regression since 745730c9c208c40f800d5d71ffa39aceab6ce044.
>> The dynamic buffer was not being used or freed.
>>
>> Signed-off-by: James Almer 
> 
> LGTM
> 
> thanks

Pushed.

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] Patch mpegts_start_pid to allow ATSC PID ranges

2014-11-18 Thread Zach Swena
Hi,

Here is a patch to allow FFmpeg to use PID ranges compatible with ATSC
television.  I based the new minimum value on the PID ranges here
on wikipedia.  This
should be sufficient to allow the use of any standard PID used in ATSC
television.

Zach

As Attached:
in mpegtsenc.c line

1441c1441
<   { .i64 = 0x0100 }, 0x0100, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
---
>   { .i64 = 0x0100 }, 0x0020, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },


This patch is basically a continuation of this one, but for a different
property:
https://trac.ffmpeg.org/attachment/ticket/518/ffmpeg-mpegts_pmt_start_pid_range_error.diff
1441c1441
<   { .i64 = 0x0100 }, 0x0100, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
---
>   { .i64 = 0x0100 }, 0x0020, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Patch mpegts_start_pid to allow ATSC PID ranges

2014-11-18 Thread Timothy Gu
Hi,

On Tue, Nov 18, 2014 at 9:02 AM, Zach Swena  wrote:
> Hi,
>
> Here is a patch to allow FFmpeg to use PID ranges compatible with ATSC
> television.  I based the new minimum value on the PID ranges here
> on wikipedia.  This
> should be sufficient to allow the use of any standard PID used in ATSC
> television.
>
> Zach
>
> As Attached:
> in mpegtsenc.c line
>
> 1441c1441
> <   { .i64 = 0x0100 }, 0x0100, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
> ---
>>   { .i64 = 0x0100 }, 0x0020, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
>

We only read Git unified patches. `git commit` and `git format-patch -1`

Timothy
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] web/style.less: Separate out .table-bordered from .table

2014-11-18 Thread Timothy Gu
On Tue, Nov 18, 2014 at 2:20 AM, Michael Niedermayer  wrote:
> On Sat, Nov 15, 2014 at 09:23:39PM -0800, Timothy Gu wrote:
>> The only instance of .table in the web source is the download page for the
>> Git repos. I did not change that page because an unbordered table there is
>> prettier IMO.
>>
>> I retained the .table-bordered style in case anyone want to use it in the
>> future.
>
> do you have screenshots from before/after for the new variant ?

Yes.

Timothy
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 07/11] lavu/dict: add av_dict_serialize

2014-11-18 Thread Lukasz Marek
On 18 November 2014 03:31, Michael Niedermayer  wrote:
>
> > >It should be also possible to serialize an empty dictionary
> > >
> > >the serialization string should also contain a serialization format
> > >identifer/version otherwise future maintaince could become hard
> > >this identifer should specify the used separator chars
> >
> > Escaping OK, added. But what is the point of this? It will just
> > require additional function to remove these and pass it to
> > av_dict_parse_string.
> > Of course user will not have to remember separators.
>
> what will the function be used for ?
> will it be used to store dictionaries in files?, communicate them
> across the network? communicate between libs ?
>
> most likely the format will change over the years in some way,
> maybe dictionaries will get additional fields for type or maybe
> length for non-null terminated data, or ...


OK, with this assumption you are totally right. I'm just not sure it is so
likely.


> how will that work without any way to identify the version or format?
>
> also a serialization stream thats self containd seems much nicer to
> handle as theres no need to keep track of the exact version (if we
> end up having more than 1) the used seperators, ...
>
> also consider 2 libs or apps to interface with each other using this
> serialization format, if one requires a change to the format how can
> the other know without a version in it, it would need to know it by
> external means. it can surely be done but it doesnt feel like
> something desirable
>

I can do one of followings:
- I can move this function to ffserver_config.c, where it is needed as
presented here (to create simple pairs separated with comas)
- Rename function to av_dict_get_string or something so it wont get
confused with your idea of serialize function. I still think both version
has own usecases


> [...]
> > +if (!buffer || pairs_sep == '\0' || key_val_sep == '\0' ||
> pairs_sep == key_val_sep)
> > +return AVERROR(EINVAL);
>
> does it work if the escaping chars " ' \ are used as seperators ?


It may be surprising, but all crazy combinations are working ok.

> > also please make sure the version you add to doc/APIchanges matches
> > > what you set in version.h
> > Did I add wrong before?
> I fixed it in 4eae568a0712b8b59cb74b3882963f938c26eab4
>

OK, sorry for that. Most entries below had 0 and I copy pasted. I didn't
really noticed there is 0, not 100, but I will be more careful next time.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] dashenc: degrade gracefully if a stream's bitrate is unavailable

2014-11-18 Thread Rodger Combs
>From e6793b554bb3979cfb5c1feec2ba73bbf8a31d8a Mon Sep 17 00:00:00 2001
From: Rodger Combs 
Date: Tue, 18 Nov 2014 12:59:59 -0600
Subject: [PATCH] dashenc: degrade gracefully if a stream's bitrate is
 unavailable

If a stream's bitrate is not set, this attempts to use its rc_max_rate;
if neither is set, it avoids writing a bandwidth attribute at all.
---
 libavformat/dashenc.c | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 4f972b3..dac217e 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -59,6 +59,7 @@ typedef struct OutputStream {
 int nb_segments, segments_size, segment_index;
 Segment **segments;
 int64_t first_dts, start_dts, end_dts;
+char bandwidth_str[64];
 
 char codec_str[100];
 } OutputStream;
@@ -368,7 +369,7 @@ static int write_manifest(AVFormatContext *s, int final)
 OutputStream *os = &c->streams[i];
 if (s->streams[i]->codec->codec_type != AVMEDIA_TYPE_VIDEO)
 continue;
-avio_printf(out, "\t\t\t\n", i, os->codec_str, st->codec->bit_rate, st->codec->width, 
st->codec->height);
+avio_printf(out, "\t\t\t\n", i, 
os->codec_str, os->bandwidth_str, st->codec->width, st->codec->height);
 output_segment_list(&c->streams[i], out, c);
 avio_printf(out, "\t\t\t\n");
 }
@@ -381,7 +382,7 @@ static int write_manifest(AVFormatContext *s, int final)
 OutputStream *os = &c->streams[i];
 if (s->streams[i]->codec->codec_type != AVMEDIA_TYPE_AUDIO)
 continue;
-avio_printf(out, "\t\t\t\n", i, os->codec_str, st->codec->bit_rate, 
st->codec->sample_rate);
+avio_printf(out, "\t\t\t\n", i, 
os->codec_str, os->bandwidth_str, st->codec->sample_rate);
 avio_printf(out, "\t\t\t\t\n", st->codec->channels);
 output_segment_list(&c->streams[i], out, c);
 avio_printf(out, "\t\t\t\n");
@@ -439,10 +440,15 @@ static int dash_write_header(AVFormatContext *s)
 AVDictionary *opts = NULL;
 char filename[1024];
 
-if (!s->streams[i]->codec->bit_rate) {
-av_log(s, AV_LOG_ERROR, "No bit rate set for stream %d\n", i);
-ret = AVERROR(EINVAL);
-goto fail;
+int bit_rate = s->streams[i]->codec->bit_rate ?
+   s->streams[i]->codec->bit_rate :
+   s->streams[i]->codec->rc_max_rate;
+if (bit_rate) {
+snprintf(os->bandwidth_str, sizeof(os->bandwidth_str),
+ " bandwidth=\"%i\"", bit_rate);
+} else {
+av_log(s, AV_LOG_WARNING, "No bit rate set for stream %d\n", i);
+os->bandwidth_str[0] = 0;
 }
 
 ctx = avformat_alloc_context();
-- 
1.9.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] web/style.less: Separate out .table-bordered from .table

2014-11-18 Thread Timothy Gu
On Tue, Nov 18, 2014 at 10:51 AM, Timothy Gu  wrote:
> On Tue, Nov 18, 2014 at 2:20 AM, Michael Niedermayer  wrote:
>> On Sat, Nov 15, 2014 at 09:23:39PM -0800, Timothy Gu wrote:
>>> The only instance of .table in the web source is the download page for the
>>> Git repos. I did not change that page because an unbordered table there is
>>> prettier IMO.
>>>
>>> I retained the .table-bordered style in case anyone want to use it in the
>>> future.
>>
>> do you have screenshots from before/after for the new variant ?
>
> Yes.

See yourselves at http://104.131.148.213:8031/download.html and
http://104.131.148.213:8031/download-old.html

Timothy
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavf/concatdec: add timestamp log

2014-11-18 Thread Nicolas George
L'octidi 28 brumaire, an CCXXIII, Stefano Sabatini a écrit :
> Help debugging timestamp conversion issues.
> ---
>  libavformat/concatdec.c | 11 +++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
> index 2089883..f275bac 100644
> --- a/libavformat/concatdec.c
> +++ b/libavformat/concatdec.c
> @@ -23,6 +23,7 @@
>  #include "libavutil/intreadwrite.h"
>  #include "libavutil/opt.h"
>  #include "libavutil/parseutils.h"
> +#include "libavutil/timestamp.h"
>  #include "avformat.h"
>  #include "internal.h"
>  #include "url.h"
> @@ -479,6 +480,7 @@ static int concat_read_packet(AVFormatContext *avf, 
> AVPacket *pkt)
>  int ret;
>  int64_t delta;
>  ConcatStream *cs;
> +AVStream *st;
>  
>  while (1) {
>  ret = av_read_frame(cat->avf, pkt);
> @@ -504,6 +506,12 @@ static int concat_read_packet(AVFormatContext *avf, 
> AVPacket *pkt)
>  if ((ret = filter_packet(avf, cs, pkt)))
>  return ret;
>  
> +st = cat->avf->streams[pkt->stream_index];

> +av_log(avf, AV_LOG_DEBUG, "file:%li stream:%d pts:%s pts_time:%s dts:%s 
> dts_time:%s",

IIRC, "%li" is wrong: the value is ptrdiff_t, the valid prefix is 't'.
Except it will probably not work with microsoft's compiler... again. You can
safely cast the value to unsigned, since nb_files has that type.

> +   cat->cur_file - cat->files, pkt->stream_index,
> +   av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &st->time_base),
> +   av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &st->time_base));
> +
>  delta = av_rescale_q(cat->cur_file->start_time - cat->avf->start_time,
>   AV_TIME_BASE_Q,
>   cat->avf->streams[pkt->stream_index]->time_base);
> @@ -511,6 +519,9 @@ static int concat_read_packet(AVFormatContext *avf, 
> AVPacket *pkt)
>  pkt->pts += delta;
>  if (pkt->dts != AV_NOPTS_VALUE)
>  pkt->dts += delta;
> +av_log(avf, AV_LOG_DEBUG, " -> pts:%s pts_time:%s dts:%s dts_time:%s\n",
> +   av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &st->time_base),
> +   av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &st->time_base));
>  return ret;
>  }

The rest LGTM.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavf/concatdec: fix timestamp conversion

2014-11-18 Thread Nicolas George
L'octidi 28 brumaire, an CCXXIII, Stefano Sabatini a écrit :
> Use the correct output time base when converting.
> ---
>  libavformat/concatdec.c | 21 +++--
>  1 file changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
> index f275bac..2574e0b 100644
> --- a/libavformat/concatdec.c
> +++ b/libavformat/concatdec.c
> @@ -480,7 +480,7 @@ static int concat_read_packet(AVFormatContext *avf, 
> AVPacket *pkt)
>  int ret;
>  int64_t delta;
>  ConcatStream *cs;
> -AVStream *st;
> +AVStream *ist, *ost;
>  
>  while (1) {
>  ret = av_read_frame(cat->avf, pkt);
> @@ -506,22 +506,23 @@ static int concat_read_packet(AVFormatContext *avf, 
> AVPacket *pkt)
>  if ((ret = filter_packet(avf, cs, pkt)))
>  return ret;
>  
> -st = cat->avf->streams[pkt->stream_index];
> -av_log(avf, AV_LOG_DEBUG, "file:%li stream:%d pts:%s pts_time:%s dts:%s 
> dts_time:%s",
> +ist = cat->avf->streams[pkt->stream_index];
> +ost = avf ->streams[pkt->stream_index];
> +av_log(avf, AV_LOG_DEBUG, "file:%li stream:%d pts:%s pts_time:%s dts:%s 
> dts_time:%s time_base:%d/%d",
> cat->cur_file - cat->files, pkt->stream_index,
> -   av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &st->time_base),
> -   av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &st->time_base));
> +   av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &ist->time_base),
> +   av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ist->time_base), 
> ist->time_base.num, ist->time_base.den);
>  

> +av_packet_rescale_ts(pkt, ist->time_base, ost->time_base);

Normally, ist->time_base and ost->time_base should be the same. Can you
explain the circumstances where this is needed?

>  delta = av_rescale_q(cat->cur_file->start_time - cat->avf->start_time,
> - AV_TIME_BASE_Q,
> - cat->avf->streams[pkt->stream_index]->time_base);
> + AV_TIME_BASE_Q, ost->time_base);
>  if (pkt->pts != AV_NOPTS_VALUE)
>  pkt->pts += delta;
>  if (pkt->dts != AV_NOPTS_VALUE)
>  pkt->dts += delta;
> -av_log(avf, AV_LOG_DEBUG, " -> pts:%s pts_time:%s dts:%s dts_time:%s\n",
> -   av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &st->time_base),
> -   av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &st->time_base));
> +av_log(avf, AV_LOG_DEBUG, " -> pts:%s pts_time:%s dts:%s dts_time:%s 
> time_base:%d/%d\n",
> +   av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &ost->time_base),
> +   av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ost->time_base), 
> ost->time_base.num, ost->time_base.den);
>  return ret;
>  }

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 07/11] lavu/dict: add av_dict_serialize

2014-11-18 Thread Michael Niedermayer
On Tue, Nov 18, 2014 at 08:00:51PM +0100, Lukasz Marek wrote:
> On 18 November 2014 03:31, Michael Niedermayer  wrote:
> >
> > > >It should be also possible to serialize an empty dictionary
> > > >
> > > >the serialization string should also contain a serialization format
> > > >identifer/version otherwise future maintaince could become hard
> > > >this identifer should specify the used separator chars
> > >
> > > Escaping OK, added. But what is the point of this? It will just
> > > require additional function to remove these and pass it to
> > > av_dict_parse_string.
> > > Of course user will not have to remember separators.
> >
> > what will the function be used for ?
> > will it be used to store dictionaries in files?, communicate them
> > across the network? communicate between libs ?
> >
> > most likely the format will change over the years in some way,
> > maybe dictionaries will get additional fields for type or maybe
> > length for non-null terminated data, or ...
> 
> 
> OK, with this assumption you are totally right. I'm just not sure it is so
> likely.
> 
> 

> > how will that work without any way to identify the version or format?
> >
> > also a serialization stream thats self containd seems much nicer to
> > handle as theres no need to keep track of the exact version (if we
> > end up having more than 1) the used seperators, ...
> >
> > also consider 2 libs or apps to interface with each other using this
> > serialization format, if one requires a change to the format how can
> > the other know without a version in it, it would need to know it by
> > external means. it can surely be done but it doesnt feel like
> > something desirable
> >
> 
> I can do one of followings:
> - I can move this function to ffserver_config.c, where it is needed as
> presented here (to create simple pairs separated with comas)
> - Rename function to av_dict_get_string or something so it wont get
> confused with your idea of serialize function. I still think both version
> has own usecases

iam fine with either of these

yes, my concern was that for serialization some compatibility
issues need to be addressed


[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 03/11] ffserver_config: map ffserver options to AVOptions

2014-11-18 Thread Reynaldo H. Verdejo Pinochet
Hi

On 11/16/2014 10:46 PM, Lukasz Marek wrote:
> Signed-off-by: Lukasz Marek 
> [..]
> @@ -965,43 +881,38 @@ static int ffserver_parse_config_stream(FFServerConfig 
> *config, const char *cmd,
>  ret = av_parse_video_size(&w, &h, arg);
>  if (ret < 0)
>  ERROR("Invalid video size '%s'\n", arg);
> -else if ((w % 2) || (h % 2))

See bellow

> -WARNING("Image size is not a multiple of 2\n");
> -if (av_dict_set_int(&config->video_conf, "VideoSizeWidth", w, 0) < 0 
> ||
> -av_dict_set_int(&config->video_conf, "VideoSizeHeight", h, 0) < 
> 0)
> -goto nomem;
> -} else if (!av_strcasecmp(cmd, "VideoFrameRate")) {
> -AVRational frame_rate;
> -ffserver_get_arg(arg, sizeof(arg), p);
> -if (av_parse_video_rate(&frame_rate, arg) < 0) {
> -ERROR("Incorrect frame rate: %s\n", arg);
> -} else {
> -if (av_dict_set_int(&config->video_conf, "VideoFrameRateNum", 
> frame_rate.num, 0) < 0 ||
> -av_dict_set_int(&config->video_conf, "VideoFrameRateDen", 
> frame_rate.den, 0) < 0)
> +else {
> +if ((w % 2) || (h % 2))

Drop the redundant () across %. Also, please make an effort
to break lines at 80 chars as long as it doesn't make the
code harder to read. This seems particularly possible on the
function declarations.

Other than these two minor nits, the patch seems OK
to push.

Thanks a lot.

-- 
Reynaldo H. Verdejo Pinochet
Open Source Group
Samsung Research America / Silicon Valley
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 04/11] ffserver_config: remove ffserver_apply_stream_config function

2014-11-18 Thread Reynaldo H. Verdejo Pinochet
Hi Lukasz

On 11/16/2014 10:46 PM, Lukasz Marek wrote:
> [..]
> @@ -174,13 +174,20 @@ void ffserver_parse_acl_row(FFServerStream *stream, 
> FFServerStream* feed,
>  }
>  
>  /* add a codec and set the default parameters */
> -static void add_codec(FFServerStream *stream, AVCodecContext *av)
> +static void add_codec(FFServerStream *stream, AVCodecContext *av, 
> FFServerConfig *config)
>  {
>  AVStream *st;
> +AVDictionary **opts;
>  
>  if(stream->nb_streams >= FF_ARRAY_ELEMS(stream->streams))
>  return;
>  
> +opts = av->codec_type == AVMEDIA_TYPE_AUDIO ? &config->audio_opts : 
> &config->video_opts;
> +av_opt_set_dict2(av->priv_data, opts, AV_OPT_SEARCH_CHILDREN);
> +av_opt_set_dict2(av, opts, AV_OPT_SEARCH_CHILDREN);
> +if (av_dict_count(*opts))
> +av_log(NULL, AV_LOG_ERROR, "Something went wrong, %d options not 
> set!!!\n", av_dict_count(*opts));
> +

Is this really an error? OK to push if so. Otherwise demote to
warning and push the updated patch. Usual comments about your
line lengths apply too but are not blockers.

As a general comment, I would avoid the grammatical "!!!"s and
such to denote severity. We have the log categories for that.
This is also just a tip, not something you need to change.

Bests,

-- 
Reynaldo H. Verdejo Pinochet
Open Source Group
Samsung Research America / Silicon Valley
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 05/11] ffserver: allow skip setting defaults

2014-11-18 Thread Reynaldo H. Verdejo Pinochet
Hi

On 11/16/2014 10:46 PM, Lukasz Marek wrote:
>[..]
> diff --git a/doc/ffserver.texi b/doc/ffserver.texi
> index b7c5b6a..d3ff13e 100644
> --- a/doc/ffserver.texi
> +++ b/doc/ffserver.texi
> @@ -408,6 +408,11 @@ ignored, and the log is written to standard output.
>  Set no-daemon mode. This option is currently ignored since now
>  @command{ffserver} will always work in no-daemon mode, and is
>  deprecated.
> +
> +@item UseDefaults
> +@item NoDefaults
> +Control whether default codec options are used for the all streams or not.
> +Each stream may overwrite this setting for its own. Default is 
> @var{UseDefaults}.
> [...]

I think I commented about this before but having yesvar & novar
options seems redundant. Having var = yes or no if absent (or the
other way around depending on the intended default) seems less
cumbersome and should simplify the code a bit too, avoiding checking
for the two and imposing a precedence, which is not always
documented. What do you think? This happens twice on this patch
IIRC.

Otherwise seems OK to push.

Bests,

-- 
Reynaldo H. Verdejo Pinochet
Open Source Group
Samsung Research America / Silicon Valley
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] dashenc: degrade gracefully if a stream's bitrate is unavailable

2014-11-18 Thread Michael Niedermayer
On Tue, Nov 18, 2014 at 01:02:58PM -0600, Rodger Combs wrote:
> From e6793b554bb3979cfb5c1feec2ba73bbf8a31d8a Mon Sep 17 00:00:00 2001
> From: Rodger Combs 
> Date: Tue, 18 Nov 2014 12:59:59 -0600
> Subject: [PATCH] dashenc: degrade gracefully if a stream's bitrate is
>  unavailable
> 
> If a stream's bitrate is not set, this attempts to use its rc_max_rate;
> if neither is set, it avoids writing a bandwidth attribute at all.
> ---
>  libavformat/dashenc.c | 18 --
>  1 file changed, 12 insertions(+), 6 deletions(-)

applied

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 06/11] [WIP][RFC]tools: add ffserver_config_test

2014-11-18 Thread Reynaldo H. Verdejo Pinochet
Hi. Overall this looks good, thanks. I would move the test to
tests/ though and integrate it with the build/test system as,
say, the way tiny_ssim is:

grep -R tiny_ssim *
Makefile:TESTTOOLS   = audiogen videogen rotozoom tiny_psnr tiny_ssim base64
tests/Makefile:FATE_UTILS = base64 tiny_psnr tiny_ssim
tests/tiny_ssim.c: * tiny_ssim.c
tests/tiny_ssim.c:printf("tiny_ssim  
x []\n");

Small nit bellow while I'm at this:


On 11/16/2014 10:46 PM, Lukasz Marek wrote:
> [..]
> @@ -1205,3 +1205,43 @@ int ffserver_parse_ffconfig(const char *filename, 
> FFServerConfig *config)
>  
>  #undef ERROR
>  #undef WARNING
> +
> +static void ffserver_free_server_stream(FFServerStream *stream)
> +{
> +int i;
> +
> +av_dict_free(&stream->in_opts);
> +av_dict_free(&stream->metadata);
> +while(stream->acl) {

You seem to use an space before ( for if/while/for. Add it here.

Bests,

-- 
Reynaldo H. Verdejo Pinochet
Open Source Group
Samsung Research America / Silicon Valley
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 06/11] [WIP][RFC]tools: add ffserver_config_test

2014-11-18 Thread Reynaldo H. Verdejo Pinochet


On 11/16/2014 11:00 PM, Lukasz Marek wrote:
> [..]
> Second thing, I don't know how to integrate this test into build system.
> I put it into tool, but it requires ffserver_config.o and cmdutils.o
> For now it have to be build with make && make tools/ffserver_config_test
> as these two *.o are not treated as  dependencies. I don't know where to
> place it in general, so I could use some help.
> 

For build/test system integration, see my previous answer on
this same thread.

Bests,

-- 
Reynaldo H. Verdejo Pinochet
Open Source Group
Samsung Research America / Silicon Valley
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 08/11] ffserver: export recommented encoder configuration

2014-11-18 Thread Reynaldo H. Verdejo Pinochet
Hi

On 11/16/2014 10:46 PM, Lukasz Marek wrote:
> [..]
> @@ -3355,6 +3354,9 @@ static int add_av_stream(FFServerStream *feed, AVStream 
> *st)
>  fst = add_av_stream1(feed, av, 0);
>  if (!fst)
>  return -1;
> +if (av_stream_get_recommended_encoder_configuration(st))
> +av_stream_set_recommended_encoder_configuration(fst,
> +av_strdup(av_stream_get_recommended_encoder_configuration(st)));

Is the return of av_strdup here been freed somewhere?. Also
adding braces to ifs when the body is multilined wouldn't
hurt. Not a blocker of course.

Looks OK otherwise. Feel free to push after confirming ^

Bests,

-- 
Reynaldo H. Verdejo Pinochet
Open Source Group
Samsung Research America / Silicon Valley
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 05/11] ffserver: allow skip setting defaults

2014-11-18 Thread Nicolas George
L'octidi 28 brumaire, an CCXXIII, Reynaldo H. Verdejo Pinochet a écrit :
> I think I commented about this before but having yesvar & novar
> options seems redundant. Having var = yes or no if absent (or the
> other way around depending on the intended default) seems less
> cumbersome and should simplify the code a bit too, avoiding checking

I think exactly the opposite. People who build reliable configurations want
to avoid relying on default values as much as possible, because default
values can change without notice. Therefore, they need to be able to specify
explicitly any behaviour, even if it is currently the default.

> for the two and imposing a precedence, which is not always
> documented.

I think we can "implicitly document" that the behaviour for contradictory
options is nasal demons.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Patch mpegts_start_pid to allow ATSC PID ranges

2014-11-18 Thread Zach Swena
Sorry, I am new to using Git.  I have a .patch file, but I am not sure what
the proper way to send it is.  I am using GitHub for windows.  Anyway, the
.patch file is attached.

Zach



On Tue, Nov 18, 2014 at 10:33 AM, Timothy Gu  wrote:

> Hi,
>
> On Tue, Nov 18, 2014 at 9:02 AM, Zach Swena 
> wrote:
> > Hi,
> >
> > Here is a patch to allow FFmpeg to use PID ranges compatible with ATSC
> > television.  I based the new minimum value on the PID ranges here
> > on wikipedia.  This
> > should be sufficient to allow the use of any standard PID used in ATSC
> > television.
> >
> > Zach
> >
> > As Attached:
> > in mpegtsenc.c line
> >
> > 1441c1441
> > <   { .i64 = 0x0100 }, 0x0100, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
> > ---
> >>   { .i64 = 0x0100 }, 0x0020, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
> >
>
> We only read Git unified patches. `git commit` and `git format-patch -1`
>
> Timothy
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


0001-min-value-for-mpegts_start_pid-to-allow-ATSC-PIDs.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] web/style.less: Separate out .table-bordered from .table

2014-11-18 Thread Clément Bœsch
On Tue, Nov 18, 2014 at 11:08:01AM -0800, Timothy Gu wrote:
> On Tue, Nov 18, 2014 at 10:51 AM, Timothy Gu  wrote:
> > On Tue, Nov 18, 2014 at 2:20 AM, Michael Niedermayer  
> > wrote:
> >> On Sat, Nov 15, 2014 at 09:23:39PM -0800, Timothy Gu wrote:
> >>> The only instance of .table in the web source is the download page for the
> >>> Git repos. I did not change that page because an unbordered table there is
> >>> prettier IMO.
> >>>
> >>> I retained the .table-bordered style in case anyone want to use it in the
> >>> future.
> >>
> >> do you have screenshots from before/after for the new variant ?
> >
> > Yes.
> 
> See yourselves at http://104.131.148.213:8031/download.html and
> http://104.131.148.213:8031/download-old.html
> 

LGTM

-- 
Clément B.


pgp7eC4Gyk0Di.pgp
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] web/style.less: Separate out .table-bordered from .table

2014-11-18 Thread Michael Niedermayer
On Tue, Nov 18, 2014 at 11:16:52PM +0100, Clément Bœsch wrote:
> On Tue, Nov 18, 2014 at 11:08:01AM -0800, Timothy Gu wrote:
> > On Tue, Nov 18, 2014 at 10:51 AM, Timothy Gu  wrote:
> > > On Tue, Nov 18, 2014 at 2:20 AM, Michael Niedermayer  
> > > wrote:
> > >> On Sat, Nov 15, 2014 at 09:23:39PM -0800, Timothy Gu wrote:
> > >>> The only instance of .table in the web source is the download page for 
> > >>> the
> > >>> Git repos. I did not change that page because an unbordered table there 
> > >>> is
> > >>> prettier IMO.
> > >>>
> > >>> I retained the .table-bordered style in case anyone want to use it in 
> > >>> the
> > >>> future.
> > >>
> > >> do you have screenshots from before/after for the new variant ?
> > >
> > > Yes.
> > 
> > See yourselves at http://104.131.148.213:8031/download.html and
> > http://104.131.148.213:8031/download-old.html
> > 
> 
> LGTM

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

DNS cache poisoning attacks, popular search engine, Google internet authority
dont be evil, please


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 05/11] ffserver: allow skip setting defaults

2014-11-18 Thread Reynaldo H. Verdejo Pinochet
Hi

On 11/18/2014 06:54 PM, Nicolas George wrote:
> L'octidi 28 brumaire, an CCXXIII, Reynaldo H. Verdejo Pinochet a
> écrit :
>> I think I commented about this before but having yesvar & novar 
>> options seems redundant. Having var = yes or no if absent (or
>> the other way around depending on the intended default) seems
>> less cumbersome and should simplify the code a bit too, avoiding
>> checking
> 
> I think exactly the opposite. People who build reliable
> configurations want to avoid relying on default values as much as
> possible, because default values can change without notice.
> Therefore, they need to be able to specify explicitly any
> behaviour, even if it is currently the default.
> 
>> for the two and imposing a precedence, which is not always 
>> documented.
> 
> I think we can "implicitly document" that the behaviour for
> contradictory options is nasal demons.

Good point I guess. OK all the same as long as we keep
it consistent across config files. Phrased as a question
to the author for this very reason.

I do think undefined behavior should be avoided if possible
without too much hassle, so if we go with the former I would
appreciate doc entries specifying the options precedence. Brownie
points+ if an odd combination fires a warning().

Bests,

-- 
Reynaldo H. Verdejo Pinochet
Open Source Group
Samsung Research America / Silicon Valley
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/3] web: Remove all comments in the cleaned CSS

2014-11-18 Thread Michael Niedermayer
On Sun, Nov 16, 2014 at 08:12:55PM +0100, Michael Niedermayer wrote:
> On Sat, Nov 15, 2014 at 09:26:08PM -0800, Timothy Gu wrote:
> > http://ffmpeg.org/css/style.min.css and the copy in ffmpeg/doc are both
> > generated using this option.
> > 
> > Signed-off-by: Timothy Gu 
> > ---
> >  Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> applied

reverted, this doesnt work with the lessc installed on teh server
it wasnt noticed immedeatly as the new makefile didnt run until
a few minutes ago which broke the background color and created
a file with this name
ption=--s0

reverting this and re running the makefile fixed it 

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 06/11] [WIP][RFC]tools: add ffserver_config_test

2014-11-18 Thread Lukasz Marek

On 18.11.2014 22:20, Reynaldo H. Verdejo Pinochet wrote:

Hi. Overall this looks good, thanks. I would move the test to
tests/ though and integrate it with the build/test system as,
say, the way tiny_ssim is:

grep -R tiny_ssim *
Makefile:TESTTOOLS   = audiogen videogen rotozoom tiny_psnr tiny_ssim base64
tests/Makefile:FATE_UTILS = base64 tiny_psnr tiny_ssim
tests/tiny_ssim.c: * tiny_ssim.c
tests/tiny_ssim.c:printf("tiny_ssim  
x []\n");


I tried as I remember but this test need to be linked with ffmpeg's libs
so adding it to FATE_UTILS is not enough

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 07/11] lavu/dict: add av_dict_serialize

2014-11-18 Thread Lukasz Marek

On 18.11.2014 20:47, Michael Niedermayer wrote:

how will that work without any way to identify the version or format?

also a serialization stream thats self containd seems much nicer to
handle as theres no need to keep track of the exact version (if we
end up having more than 1) the used seperators, ...

also consider 2 libs or apps to interface with each other using this
serialization format, if one requires a change to the format how can
the other know without a version in it, it would need to know it by
external means. it can surely be done but it doesnt feel like
something desirable



I can do one of followings:
- I can move this function to ffserver_config.c, where it is needed as
presented here (to create simple pairs separated with comas)
- Rename function to av_dict_get_string or something so it wont get
confused with your idea of serialize function. I still think both version
has own usecases


iam fine with either of these


OK, renamed. I swapped separators order to be the same as parse_string's 
ones. added tests for corner cases where potential escape chars are 
separators.


>From f23203f83687ae5a354847919046fb107b145700 Mon Sep 17 00:00:00 2001
From: Lukasz Marek 
Date: Sun, 16 Nov 2014 01:45:07 +0100
Subject: [PATCH] lavu/dict: add av_dict_serialize

TODO: bump minor, update doc/APIchanges

Signed-off-by: Lukasz Marek 
---
 libavutil/Makefile |  1 +
 libavutil/dict.c   | 94 ++
 libavutil/dict.h   | 17 ++
 3 files changed, 112 insertions(+)

diff --git a/libavutil/Makefile b/libavutil/Makefile
index 6f90301..c1aa8aa 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -157,6 +157,7 @@ TESTPROGS = adler32 \
 cpu \
 crc \
 des \
+dict\
 error   \
 eval\
 file\
diff --git a/libavutil/dict.c b/libavutil/dict.c
index 475e906..e071ec9 100644
--- a/libavutil/dict.c
+++ b/libavutil/dict.c
@@ -24,6 +24,7 @@
 #include "dict.h"
 #include "internal.h"
 #include "mem.h"
+#include "bprint.h"
 
 struct AVDictionary {
 int count;
@@ -207,3 +208,96 @@ void av_dict_copy(AVDictionary **dst, FF_CONST_AVUTIL53 AVDictionary *src, int f
 while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX)))
 av_dict_set(dst, t->key, t->value, flags);
 }
+
+int av_dict_get_string(const AVDictionary *m, char **buffer,
+   const char key_val_sep, const char pairs_sep)
+{
+AVDictionaryEntry *t = NULL;
+AVBPrint bprint;
+int cnt = 0;
+char special_chars[] = {pairs_sep, key_val_sep, '\0'};
+
+if (!buffer || pairs_sep == '\0' || key_val_sep == '\0' || pairs_sep == key_val_sep)
+return AVERROR(EINVAL);
+
+if (!av_dict_count(m)) {
+*buffer = av_strdup("");
+return *buffer ? 0 : AVERROR(ENOMEM);
+}
+
+av_bprint_init(&bprint, 64, AV_BPRINT_SIZE_UNLIMITED);
+while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX))) {
+if (cnt++)
+av_bprint_append_data(&bprint, &pairs_sep, 1);
+av_bprint_escape(&bprint, t->key, special_chars, AV_ESCAPE_MODE_BACKSLASH, 0);
+av_bprint_append_data(&bprint, &key_val_sep, 1);
+av_bprint_escape(&bprint, t->value, special_chars, AV_ESCAPE_MODE_BACKSLASH, 0);
+}
+return av_bprint_finalize(&bprint, buffer);
+}
+
+#ifdef TEST
+static void print_dict(const AVDictionary *m)
+{
+AVDictionaryEntry *t = NULL;
+while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX)))
+printf("%s %s   ", t->key, t->value);
+printf("\n");
+}
+
+static void test_separators(const AVDictionary *m, const char pair, const char val)
+{
+AVDictionary *dict = NULL;
+char pairs[] = {pair , '\0'};
+char vals[]  = {val, '\0'};
+
+char *buffer = NULL;
+av_dict_copy(&dict, m, 0);
+print_dict(dict);
+av_dict_get_string(dict, &buffer, val, pair);
+printf("%s\n", buffer);
+av_dict_free(&dict);
+av_dict_parse_string(&dict, buffer, vals, pairs, 0);
+av_freep(&buffer);
+print_dict(dict);
+av_dict_free(&dict);
+}
+
+int main(void)
+{
+AVDictionary *dict = NULL;
+char *buffer = NULL;
+
+printf("Testing av_dict_get_string() and av_dict_parse_string()");
+av_dict_get_string(dict, &buffer, '=', ',');
+printf("%s\n", buffer);
+av_freep(&buffer);
+av_dict_set(&dict, "aaa", "aaa", 0);
+av_dict_set(&dict, "b,b", "bbb", 0);
+av_dict_set(&dict, "c=c", "ccc", 0);
+av_dict_set(&dict, "ddd", "d,d", 0);
+av_dict_set(&dict, "e

Re: [FFmpeg-devel] Patch mpegts_start_pid to allow ATSC PID ranges

2014-11-18 Thread Michael Niedermayer
On Tue, Nov 18, 2014 at 01:56:21PM -0800, Zach Swena wrote:
> Sorry, I am new to using Git.  I have a .patch file, but I am not sure what
> the proper way to send it is.  I am using GitHub for windows.  Anyway, the
> .patch file is attached.
> 
> Zach
> 
> 
> 
> On Tue, Nov 18, 2014 at 10:33 AM, Timothy Gu  wrote:
> 
> > Hi,
> >
> > On Tue, Nov 18, 2014 at 9:02 AM, Zach Swena 
> > wrote:
> > > Hi,
> > >
> > > Here is a patch to allow FFmpeg to use PID ranges compatible with ATSC
> > > television.  I based the new minimum value on the PID ranges here
> > > on wikipedia.  This
> > > should be sufficient to allow the use of any standard PID used in ATSC
> > > television.
> > >
> > > Zach
> > >
> > > As Attached:
> > > in mpegtsenc.c line
> > >
> > > 1441c1441
> > > <   { .i64 = 0x0100 }, 0x0100, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
> > > ---
> > >>   { .i64 = 0x0100 }, 0x0020, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
> > >
> >
> > We only read Git unified patches. `git commit` and `git format-patch -1`
> >
> > Timothy
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >

>  mpegtsenc.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> eec00a02476529142a50aac8b0e2bbaf5780df8b  
> 0001-min-value-for-mpegts_start_pid-to-allow-ATSC-PIDs.patch
> From dcd75a7f912a0a7e14314e9c66a6f9cf67351934 Mon Sep 17 00:00:00 2001
> From: dedicatedbroadcastsolutions 
> Date: Tue, 18 Nov 2014 13:43:07 -0800
> Subject: [PATCH] min value for mpegts_start_pid to allow ATSC PIDs

patch applied


> 
> Here is a patch to allow FFmpeg to use PID ranges compatible with ATSC
> television.  I based the new minimum value on the PID ranges on
> wikipedia.  This should be sufficient to allow the use of any standard
> PID used in ATSC television.

wikipedia is generally not a good choice for these things.
Whenever possible the actual specifications (or drafts) should be
checked
but either way its better to allow the user to choose lower pids if
thats what (s)he wants ...

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 07/11] lavu/dict: add av_dict_serialize

2014-11-18 Thread Michael Niedermayer
On Wed, Nov 19, 2014 at 12:30:53AM +0100, Lukasz Marek wrote:
> On 18.11.2014 20:47, Michael Niedermayer wrote:
> >>>how will that work without any way to identify the version or format?
> >>>
> >>>also a serialization stream thats self containd seems much nicer to
> >>>handle as theres no need to keep track of the exact version (if we
> >>>end up having more than 1) the used seperators, ...
> >>>
> >>>also consider 2 libs or apps to interface with each other using this
> >>>serialization format, if one requires a change to the format how can
> >>>the other know without a version in it, it would need to know it by
> >>>external means. it can surely be done but it doesnt feel like
> >>>something desirable
> >>>
> >>
> >>I can do one of followings:
> >>- I can move this function to ffserver_config.c, where it is needed as
> >>presented here (to create simple pairs separated with comas)
> >>- Rename function to av_dict_get_string or something so it wont get
> >>confused with your idea of serialize function. I still think both version
> >>has own usecases
> >
> >iam fine with either of these
> 
> OK, renamed. I swapped separators order to be the same as
> parse_string's ones. added tests for corner cases where potential
> escape chars are separators.

[...]

> +{
> +AVDictionary *dict = NULL;
> +char *buffer = NULL;
> +
> +printf("Testing av_dict_get_string() and av_dict_parse_string()");
> +av_dict_get_string(dict, &buffer, '=', ',');
> +printf("%s\n", buffer);
> +av_freep(&buffer);
> +av_dict_set(&dict, "aaa", "aaa", 0);
> +av_dict_set(&dict, "b,b", "bbb", 0);
> +av_dict_set(&dict, "c=c", "ccc", 0);
> +av_dict_set(&dict, "ddd", "d,d", 0);
> +av_dict_set(&dict, "eee", "e=e", 0);
> +av_dict_set(&dict, "f,f", "f=f", 0);
> +av_dict_set(&dict, "g=g", "g,g", 0);
> +test_separators(dict, ',', '=');
> +av_dict_free(&dict);
> +av_dict_set(&dict, "aaa", "aaa", 0);

i tried this instead
av_dict_set(&dict, "a\\,=\'\"aa", "a\\,=\'\"aa", 0);

and it doesnt seem to work

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libavformat/mxfdec.c: export source package uids and names as metadata

2014-11-18 Thread Mark Reid
---
 libavformat/mxfdec.c | 74 +++-
 1 file changed, 39 insertions(+), 35 deletions(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index fa0a2f4..8c13c24 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -668,22 +668,6 @@ static int mxf_read_source_clip(void *arg, AVIOContext 
*pb, int tag, int size, U
 return 0;
 }
 
-static int mxf_read_material_package(void *arg, AVIOContext *pb, int tag, int 
size, UID uid, int64_t klv_offset)
-{
-MXFPackage *package = arg;
-switch(tag) {
-case 0x4403:
-package->tracks_count = avio_rb32(pb);
-package->tracks_refs = av_calloc(package->tracks_count, sizeof(UID));
-if (!package->tracks_refs)
-return AVERROR(ENOMEM);
-avio_skip(pb, 4); /* useless size of objects, always 16 according to 
specs */
-avio_read(pb, (uint8_t *)package->tracks_refs, package->tracks_count * 
sizeof(UID));
-break;
-}
-return 0;
-}
-
 static int mxf_read_timecode_component(void *arg, AVIOContext *pb, int tag, 
int size, UID uid, int64_t klv_offset)
 {
 MXFTimecodeComponent *mxf_timecode = arg;
@@ -1416,6 +1400,34 @@ static int mxf_is_intra_only(MXFDescriptor *descriptor)
 &descriptor->essence_codec_ul)->id != 
AV_CODEC_ID_NONE;
 }
 
+static int mxf_uid_to_str(UID uid, char **str)
+{
+int i;
+char *p;
+p = *str = av_mallocz(sizeof(UID) * 2 + 4 + 1);
+if (!p)
+return AVERROR(ENOMEM);
+for (i = 0; i < sizeof(UID); i++) {
+snprintf(p, 2 + 1, "%.2x", uid[i]);
+p += 2;
+if (i == 3 || i == 5 || i == 7 || i == 9) {
+snprintf(p, 1 + 1, "-");
+p++;
+}
+}
+return 0;
+}
+
+static int mxf_add_uid_metadata(AVDictionary **pm, const char *key, UID uid)
+{
+char *str;
+int ret;
+if ((ret = mxf_uid_to_str(uid, &str)) < 0)
+return ret;
+av_dict_set(pm, key, str, AV_DICT_DONT_STRDUP_VAL);
+return 0;
+}
+
 static int mxf_add_timecode_metadata(AVDictionary **pm, const char *key, 
AVTimecode *tc)
 {
 char buf[AV_TIMECODE_STR_SIZE];
@@ -1476,6 +1488,8 @@ static int mxf_parse_physical_source_package(MXFContext 
*mxf, MXFTrack *source_t
 if (!physical_package)
 break;
 
+mxf_add_uid_metadata(&st->metadata, "reel_uid", 
physical_package->package_uid);
+
 /* the name of physical source package is name of the reel or tape */
 if (physical_package->name && physical_package->name[0])
 av_dict_set(&st->metadata, "reel_name", physical_package->name, 0);
@@ -1532,6 +1546,10 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
 return AVERROR_INVALIDDATA;
 }
 
+mxf_add_uid_metadata(&mxf->fc->metadata, "material_package_uid", 
material_package->package_uid);
+if (material_package->name && material_package->name[0])
+av_dict_set(&mxf->fc->metadata, "material_package_name", 
material_package->name, 0);
+
 for (i = 0; i < material_package->tracks_count; i++) {
 MXFPackage *source_package = NULL;
 MXFTrack *material_track = NULL;
@@ -1712,6 +1730,10 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
 }
 av_log(mxf->fc, AV_LOG_VERBOSE, "\n");
 
+mxf_add_uid_metadata(&st->metadata, "file_package_uid", 
source_package->package_uid);
+if (source_package->name && source_package->name[0])
+av_dict_set(&st->metadata, "file_package_name", 
source_package->name, 0);
+
 mxf_parse_physical_source_package(mxf, source_track, st);
 
 if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
@@ -1851,24 +1873,6 @@ fail_and_free:
 return ret;
 }
 
-static int mxf_uid_to_str(UID uid, char **str)
-{
-int i;
-char *p;
-p = *str = av_mallocz(sizeof(UID) * 2 + 4 + 1);
-if (!p)
-return AVERROR(ENOMEM);
-for (i = 0; i < sizeof(UID); i++) {
-snprintf(p, 2 + 1, "%.2x", uid[i]);
-p += 2;
-if (i == 3 || i == 5 || i == 7 || i == 9) {
-snprintf(p, 1 + 1, "-");
-p++;
-}
-}
-return 0;
-}
-
 static int mxf_timestamp_to_str(uint64_t timestamp, char **str)
 {
 struct tm time = { 0 };
@@ -1969,7 +1973,7 @@ static const MXFMetadataReadTableEntry 
mxf_metadata_read_table[] = {
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x30,0x00 
}, mxf_read_identification_metadata },
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x18,0x00 
}, mxf_read_content_storage, 0, AnyType },
 { { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x37,0x00 
}, mxf_read_source_package, sizeof(MXFPackage), SourcePackage },
-{ { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x36,0x00 
}, mxf_read_material_package, sizeof(MXFPackage), MaterialPackage },
+{ { 
0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0

[FFmpeg-devel] [PATCH] libavformat/mxfdec.c: export source package uids and names as metadata

2014-11-18 Thread Mark Reid
hi,
This patch exports mxf source package uids and names as metadata. AAF files and 
some
editing applications can link to mxf files and their streams by package uids. 
They 
can be used to resolve a media file instead of just a url.

Here are the metadata keys I added:

material_package_uid
material_package_name
file_package_uid
file_package_name
reel_uid

Mark Reid (1):
  libavformat/mxfdec.c: export source package uids and names as metadata

 libavformat/mxfdec.c | 74 +++-
 1 file changed, 39 insertions(+), 35 deletions(-)

-- 
2.0.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 07/11] lavu/dict: add av_dict_serialize

2014-11-18 Thread Lukasz Marek

On 19.11.2014 01:13, Michael Niedermayer wrote:

On Wed, Nov 19, 2014 at 12:30:53AM +0100, Lukasz Marek wrote:

On 18.11.2014 20:47, Michael Niedermayer wrote:

how will that work without any way to identify the version or format?

also a serialization stream thats self containd seems much nicer to
handle as theres no need to keep track of the exact version (if we
end up having more than 1) the used seperators, ...

also consider 2 libs or apps to interface with each other using this
serialization format, if one requires a change to the format how can
the other know without a version in it, it would need to know it by
external means. it can surely be done but it doesnt feel like
something desirable



I can do one of followings:
- I can move this function to ffserver_config.c, where it is needed as
presented here (to create simple pairs separated with comas)
- Rename function to av_dict_get_string or something so it wont get
confused with your idea of serialize function. I still think both version
has own usecases


iam fine with either of these


OK, renamed. I swapped separators order to be the same as
parse_string's ones. added tests for corner cases where potential
escape chars are separators.


[...]


+{
+AVDictionary *dict = NULL;
+char *buffer = NULL;
+
+printf("Testing av_dict_get_string() and av_dict_parse_string()");
+av_dict_get_string(dict, &buffer, '=', ',');
+printf("%s\n", buffer);
+av_freep(&buffer);
+av_dict_set(&dict, "aaa", "aaa", 0);
+av_dict_set(&dict, "b,b", "bbb", 0);
+av_dict_set(&dict, "c=c", "ccc", 0);
+av_dict_set(&dict, "ddd", "d,d", 0);
+av_dict_set(&dict, "eee", "e=e", 0);
+av_dict_set(&dict, "f,f", "f=f", 0);
+av_dict_set(&dict, "g=g", "g,g", 0);
+test_separators(dict, ',', '=');
+av_dict_free(&dict);
+av_dict_set(&dict, "aaa", "aaa", 0);


i tried this instead
av_dict_set(&dict, "a\\,=\'\"aa", "a\\,=\'\"aa", 0);

and it doesnt seem to work


obviously av_get_token is broken, i'm not going to fix it soon, so 
consider patchset dropped unless no one does or wahtever


___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 07/11] lavu/dict: add av_dict_serialize

2014-11-18 Thread Michael Niedermayer
On Wed, Nov 19, 2014 at 02:25:48AM +0100, Lukasz Marek wrote:
> On 19.11.2014 01:13, Michael Niedermayer wrote:
> >On Wed, Nov 19, 2014 at 12:30:53AM +0100, Lukasz Marek wrote:
> >>On 18.11.2014 20:47, Michael Niedermayer wrote:
> >how will that work without any way to identify the version or format?
> >
> >also a serialization stream thats self containd seems much nicer to
> >handle as theres no need to keep track of the exact version (if we
> >end up having more than 1) the used seperators, ...
> >
> >also consider 2 libs or apps to interface with each other using this
> >serialization format, if one requires a change to the format how can
> >the other know without a version in it, it would need to know it by
> >external means. it can surely be done but it doesnt feel like
> >something desirable
> >
> 
> I can do one of followings:
> - I can move this function to ffserver_config.c, where it is needed as
> presented here (to create simple pairs separated with comas)
> - Rename function to av_dict_get_string or something so it wont get
> confused with your idea of serialize function. I still think both version
> has own usecases
> >>>
> >>>iam fine with either of these
> >>
> >>OK, renamed. I swapped separators order to be the same as
> >>parse_string's ones. added tests for corner cases where potential
> >>escape chars are separators.
> >
> >[...]
> >
> >>+{
> >>+AVDictionary *dict = NULL;
> >>+char *buffer = NULL;
> >>+
> >>+printf("Testing av_dict_get_string() and av_dict_parse_string()");
> >>+av_dict_get_string(dict, &buffer, '=', ',');
> >>+printf("%s\n", buffer);
> >>+av_freep(&buffer);
> >>+av_dict_set(&dict, "aaa", "aaa", 0);
> >>+av_dict_set(&dict, "b,b", "bbb", 0);
> >>+av_dict_set(&dict, "c=c", "ccc", 0);
> >>+av_dict_set(&dict, "ddd", "d,d", 0);
> >>+av_dict_set(&dict, "eee", "e=e", 0);
> >>+av_dict_set(&dict, "f,f", "f=f", 0);
> >>+av_dict_set(&dict, "g=g", "g,g", 0);
> >>+test_separators(dict, ',', '=');
> >>+av_dict_free(&dict);
> >>+av_dict_set(&dict, "aaa", "aaa", 0);
> >
> >i tried this instead
> >av_dict_set(&dict, "a\\,=\'\"aa", "a\\,=\'\"aa", 0);
> >
> >and it doesnt seem to work
> 
> obviously av_get_token is broken, i'm not going to fix it soon, so
> consider patchset dropped unless no one does or wahtever

if the bug is not in the patchset then theres no reason to drop
the patchset.
just document the issue 

[...]
-- 
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] Bypass video H264 IP UDP Multicast over FLV RTMP

2014-11-18 Thread Dang Duc Hung
This is ouput full message when I run ffmpeg
[root@Flexi108 ~]# ffmpeg -i udp://x.x.x.x:x -vcodec copy -acodec aac -strict 
-2 -b:a 32k -ac 1 -ar 32000 -f flv "rtmp://x.x.x.x/ app=x playpath=x"
ffmpeg version N-55517-g640a36a Copyright (c) 2000-2013 the FFmpeg developers
  built on Nov 19 2014 10:52:59 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11)
  configuration: --enable-version3 --enable-libopencore-amrnb 
--enable-libopencore-amrwb --enable-libvpx --enable-libfaac --enable-libmp3lame 
--enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid 
--disable-ffplay --enable-shared --enable-gpl --enable-postproc 
--enable-nonfree --enable-avfilter --enable-librtmp --enable-libfreetype 
--enable-pthreads --extra-cflags=-fPIC
  libavutil  52. 42.100 / 52. 42.100
  libavcodec 55. 27.100 / 55. 27.100
  libavformat55. 13.102 / 55. 13.102
  libavdevice55.  3.100 / 55.  3.100
  libavfilter 3. 82.100 /  3. 82.100
  libswscale  2.  4.100 /  2.  4.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc52.  3.100 / 52.  3.100
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138cce0] non-existing PPS referenced
[h264 @ 0x138cce0] non-existing PPS 0 referenced
[h264 @ 0x138cce0] decode_slice_header error
[h264 @ 0x138cce0] no frame!
[h264 @ 0x138