Re: [FFmpeg-devel] Post-processing filter Documentation

2015-01-31 Thread arwa arif
On Thu, Jan 29, 2015 at 5:18 PM, Stefano Sabatini 
wrote:

> On date Thursday 2015-01-29 03:46:42 +0530, Arwa Arif encoded:
> > I have updated the page with new images.
> > http://trac.ffmpeg.org/wiki/Postprocessing
>
> Note: probably you can improve the page layout by stripping the black
> top and bottom bands in the matrix reference.
>
> How do you exactly created the query image? Also please specify the
> information unit (200K = 200 Kbit/s, right?)
>
>
I used this command to create the query image:
ffmpeg -i matrixbench_mpeg2.mpg -b:v 200k matrixbench_mpeg2-lq.mpg




> > What exactly needs to be done in benchmark section?
>
> I already suggested a command (please keep some context when
> replying), but Michael observed that the actual benchmark could be
> affected by I/O speed.
>
> I wonder if there is a better way to benchmark the performance of a
> single filter. Using START/STOP_TIMER can be an idea but it would be
> probably a little awkward.
>

So, which method should I follow to get the runtime?


> --
> FFmpeg = Forgiving and Forgiving Murdering Picky Excellent Gorilla
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/2] avcodec/put_bits: remove unneeded #include, there are no assert()

2015-01-31 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavcodec/put_bits.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/put_bits.h b/libavcodec/put_bits.h
index 8858caa..81be6b3 100644
--- a/libavcodec/put_bits.h
+++ b/libavcodec/put_bits.h
@@ -28,7 +28,6 @@
 
 #include 
 #include 
-#include 
 
 #include "libavutil/intreadwrite.h"
 #include "libavutil/avassert.h"
-- 
1.7.11.2

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


[FFmpeg-devel] [PATCH 2/2] avcodec/motion_est: remove unneeded #include, there are no assert() only av_assert*

2015-01-31 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavcodec/motion_est.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index 901fafd..44a28ac 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -36,9 +36,6 @@
 #include "mpegutils.h"
 #include "mpegvideo.h"
 
-#undef NDEBUG
-#include 
-
 #define P_LEFT P[1]
 #define P_TOP P[2]
 #define P_TOPRIGHT P[3]
-- 
1.7.11.2

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


Re: [FFmpeg-devel] [PATCH 6/6] avformat/movenc: remove unneeded #include, there are no assert() only av_assert*

2015-01-31 Thread Paul B Mahol
On 1/31/15, Michael Niedermayer  wrote:
> On Fri, Jan 30, 2015 at 11:27:57AM +, Paul B Mahol wrote:
>> Signed-off-by: Paul B Mahol 
>> ---
>>  libavformat/movenc.c | 3 ---
>>  1 file changed, 3 deletions(-)
>
> LGTM

all applied

thx

> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> DNS cache poisoning attacks, popular search engine, Google internet
> authority
> dont be evil, please
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Add support to process_command in vf_eq.c

2015-01-31 Thread Stefano Sabatini
On date Friday 2015-01-30 23:17:33 +0530, Arwa Arif encoded:
> I have tried to add process_command in vf_eq.c. I have attached the patch.

> From 1d65e493a8eb247d86b0db324cb740579662706d Mon Sep 17 00:00:00 2001
> From: Arwa Arif 
> Date: Fri, 30 Jan 2015 23:06:50 +0530
> Subject: [PATCH] Add support to process_command in vf_eq.c
> 
> ---
>  libavfilter/vf_eq.c |   53 
> ++-
>  1 file changed, 40 insertions(+), 13 deletions(-)

Missing doc updates.

> 
> diff --git a/libavfilter/vf_eq.c b/libavfilter/vf_eq.c
> index ad2a37e..5899abb 100644
> --- a/libavfilter/vf_eq.c
> +++ b/libavfilter/vf_eq.c
> @@ -27,11 +27,6 @@
>   * very simple video equalizer
>   */
>  
> -/**
> - * TODO:
> - * - Add support to process_command
> - */
> -
>  #include "libavfilter/internal.h"
>  #include "libavutil/common.h"
>  #include "libavutil/imgutils.h"
> @@ -217,6 +212,37 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
> *in)
>  av_frame_free(&in);
>  return ff_filter_frame(outlink, out);
>  }
> +
> +static int process_command(AVFilterContext *ctx, const char *cmd, const char 
> *args,
> +   char *res, int res_len, int flags)
> +{
> +EQContext *eq = ctx->priv;
> +
> +if (!strcmp(cmd, "contrast"))

> +eq->contrast = av_clipf(strtod(args, NULL), -2.0,  2.0);

All this parameters are set through the av_opt_ interface. Try to use
it, since otherwise range checks and parsing is inconsistent. In
particular, the parsing performed by av_opt_ may be different from
strtod(). Also you want to want the user in case of out-of-range values.

> +if (!strcmp(cmd, "brightness"))
> +eq->brightness   = av_clipf(strtod(args, NULL), -1.0,  1.0);
> +if (!strcmp(cmd, "saturation"))
> +eq->saturation   = av_clipf(strtod(args, NULL),  0.0,  3.0);
> +if (!strcmp(cmd, "gamma"))
> +eq->gamma= av_clipf(strtod(args, NULL),  0.1, 10.0);
> +if (!strcmp(cmd, "gamma_r"))
> +eq->gamma_r  = av_clipf(strtod(args, NULL),  0.1, 10.0);
> +if (!strcmp(cmd, "gamma_g"))
> +eq->gamma_g  = av_clipf(strtod(args, NULL),  0.1, 10.0);
> +if (!strcmp(cmd, "gamma_b"))
> +eq->gamma_b  = av_clipf(strtod(args, NULL),  0.1, 10.0);
> +if (!strcmp(cmd, "gamma_weight"))
> +eq->gamma_weight = av_clipf(strtod(args, NULL),  0.0,  1.0);
> +
> +set_gamma(eq);
> +set_contrast(eq);
> +set_brightness(eq);
> +set_saturation(eq);
> +
> +return 0;
> +}

if (!strcmp(cmd, "contrast) {
   set contrast
   set_contrast(eq);
} else if (...)

} else...

This wauy you don't need to set the other parameters if they are not
changed.


Also it should return AVERROR(ENOSYS) in case of unrecognized command.  

> +
>  static const AVFilterPad eq_inputs[] = {
>  {
>  .name = "default",
> @@ -260,12 +286,13 @@ static const AVOption eq_options[] = {
>  AVFILTER_DEFINE_CLASS(eq);
>  
>  AVFilter ff_vf_eq = {
> -.name  = "eq",
> -.description   = NULL_IF_CONFIG_SMALL("Adjust brightness, contrast, 
> gamma, and saturation."),
> -.priv_size = sizeof(EQContext),
> -.priv_class= &eq_class,
> -.inputs= eq_inputs,
> -.outputs   = eq_outputs,
> -.query_formats = query_formats,
> -.init  = initialize,

> +.name= "eq",
> +.description = NULL_IF_CONFIG_SMALL("Adjust brightness, contrast, 
> gamma, and saturation."),
> +.priv_size   = sizeof(EQContext),
> +.priv_class  = &eq_class,
> +.inputs  = eq_inputs,
> +.outputs = eq_outputs,
> +.process_command = process_command,
> +.query_formats   = query_formats,
> +.init= initialize,

avoid cosmetic changes, you can vertically realign in a separate
(cosmetical) commit.
-- 
FFmpeg = Fostering Faithless Mournful Puristic Ecletic Generator
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/3] x86/hevc: add ff_hevc_sao_band_filter_{8, 10, 12}_{sse2, avx2}

2015-01-31 Thread Christophe Gisquet
Hi,

2015-01-30 19:50 GMT+01:00 James Almer :
> +%macro HEVC_SAO_BAND_FILTER_COMPUTE 3
> +psraw %2, %3, %1-5
> +pcmpeqw  m10, %2, m0
> +pcmpeqw  m11, %2, m1
> +pcmpeqw  m12, %2, m2
> +pcmpeqw   %2, m3
> +pand m10, m4
> +pand m11, m5
> +pand m12, m6
> +pand  %2, m7
> +por  m10, m11
> +por  m12, %2
> +por  m10, m12
> +paddw %3, m10
> +%endmacro

The shift does really force to work on bytes, too bad. Some pshufb
might still be possible using the result, but it would be cumbersome
because the psraw result is [0-31], and offset might be signed.

> +.loop:
> +movu m13, [srcq+widthq]
[...]
> +movu  [dstq+widthq], m8

Some of those moves could be aligned, but there's some work to be done
at the buffer levels. So it's not like it's really part of this patch.

Looks good, any improvement seems like an additional patch.

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


Re: [FFmpeg-devel] [PATCH] lavd/libcdio: add more paranoia mode constants

2015-01-31 Thread Stefano Sabatini
On date Friday 2015-01-30 22:06:14 +0100, Michael Niedermayer encoded:
> On Fri, Jan 30, 2015 at 06:32:33PM +0100, Stefano Sabatini wrote:
> > ---
> >  libavdevice/libcdio.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> seems not to apply cleanly but should be ok

Applied.
-- 
FFmpeg = Faithless and Furious Multimedia Problematic Elitarian Genius
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavd/libcdio: apply minor fixes to options documentation

2015-01-31 Thread Stefano Sabatini
On date Friday 2015-01-30 19:41:43 +, Paul B Mahol encoded:
> On 1/30/15, Stefano Sabatini  wrote:
> > ---
> >  libavdevice/libcdio.c | 10 +-
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> >
> 
> lgtm

Applied.
-- 
FFmpeg = Forgiving and Fascinating Most Practical Evangelical Gigant
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] doc/indevs/libcdio: apply minor spell fixes, extend documentation

2015-01-31 Thread Stefano Sabatini
On date Saturday 2015-01-31 03:09:47 +, Timothy Gu encoded:
> On Fri Jan 30 2015 at 9:32:58 AM Stefano Sabatini 
> wrote:
> 
> > ---
> >  doc/indevs.texi | 32 +---
> >  1 file changed, 29 insertions(+), 3 deletions(-)
[...]
> > +For more information about the available recovery modes, consult the
> > +paranoia project documentation.
> >
> 
> Is there a man page somewhere the user can directly `man paranoia`?

man cdparanoia, but probably the modes are only documented in the headers.
-- 
FFmpeg = Faithful Fiendish Most Puritan Enigmatic Geisha
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/3] x86/hevc: add ff_hevc_sao_band_filter_{8, 10, 12}_{sse2, avx2}

2015-01-31 Thread Mickaël Raulet
LGTM.

Mickaël

Le samedi 31 janvier 2015, Christophe Gisquet 
a écrit :

> Hi,
>
> 2015-01-30 19:50 GMT+01:00 James Almer >:
> > +%macro HEVC_SAO_BAND_FILTER_COMPUTE 3
> > +psraw %2, %3, %1-5
> > +pcmpeqw  m10, %2, m0
> > +pcmpeqw  m11, %2, m1
> > +pcmpeqw  m12, %2, m2
> > +pcmpeqw   %2, m3
> > +pand m10, m4
> > +pand m11, m5
> > +pand m12, m6
> > +pand  %2, m7
> > +por  m10, m11
> > +por  m12, %2
> > +por  m10, m12
> > +paddw %3, m10
> > +%endmacro
>
> The shift does really force to work on bytes, too bad. Some pshufb
> might still be possible using the result, but it would be cumbersome
> because the psraw result is [0-31], and offset might be signed.
>
> > +.loop:
> > +movu m13, [srcq+widthq]
> [...]
> > +movu  [dstq+widthq], m8
>
> Some of those moves could be aligned, but there's some work to be done
> at the buffer levels. So it's not like it's really part of this patch.
>
> Looks good, any improvement seems like an additional patch.
>
> --
> Christophe
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org 
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/3] x86/hevc: add ff_hevc_sao_band_filter_{8, 10, 12}_{sse2, avx2}

2015-01-31 Thread Christophe Gisquet
Hi,

2015-01-31 11:33 GMT+01:00 Christophe Gisquet :
> 2015-01-30 19:50 GMT+01:00 James Almer :
>> +%macro HEVC_SAO_BAND_FILTER_COMPUTE 3
>> +psraw %2, %3, %1-5
>> +pcmpeqw  m10, %2, m0
>> +pcmpeqw  m11, %2, m1
>> +pcmpeqw  m12, %2, m2
>> +pcmpeqw   %2, m3
>> +pand m10, m4
>> +pand m11, m5
>> +pand m12, m6
>> +pand  %2, m7
>> +por  m10, m11
>> +por  m12, %2
>> +por  m10, m12
>> +paddw %3, m10
>> +%endmacro
>
> The shift does really force to work on bytes, too bad. Some pshufb
> might still be possible using the result, but it would be cumbersome
> because the psraw result is [0-31], and offset might be signed.

Now that I think of it... For 8bits, can't you pmullw the values
derived from "left" by 2^5 (to get pixel values), pack them, and work
on bytes? From ff_hevc_sao_offset_abs_decode, the offsets look to be
within 7 bits.

The patch can still go in, it's a somewhat new algorithm.

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


Re: [FFmpeg-devel] [PATCH 3/3] x86/hevc: add ff_hevc_sao_band_filter_{8, 10, 12}_{sse2, avx2}

2015-01-31 Thread Christophe Gisquet
Hi,

and hopefully the last comments.

2015-01-30 19:50 GMT+01:00 James Almer :
> +%if mmsize > 16
> +cmp   widthq, 16
> +je hevc_sao_band_filter_16_%1 %+ SUFFIX
> +%endif
> +cmp   widthq, 8
> +je hevc_sao_band_filter_8_%1 %+ SUFFIX
> +%endmacro

Frankly a width of < 16 is quite unlikely. You bothered with it, but
if it goes any issue down the drain it should be dropped.

Secondly, shouldn't the jump be to the .loop location, and not the
function start?

Third, 64 and 32 are the more likely size, I'd probably unroll
accordingly. (eg loop64, loop32, loop16).

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


Re: [FFmpeg-devel] PATCH dshow show devices options

2015-01-31 Thread Roger Pack
On 1/30/15, Michael Niedermayer  wrote:
> On Fri, Jan 30, 2015 at 08:55:45AM -0700, Roger Pack wrote:
>> On 1/30/15, Don Moir  wrote:
>> >
>> > - Original Message -
>> > From: "Roger Pack" 
>> > To: "FFmpeg development discussions and patches"
>> > 
>> > Sent: Friday, January 30, 2015 7:09 AM
>> > Subject: [FFmpeg-devel] PATCH dshow show devices options
>> >
>> >
>> >> See attached.  Hope I didn't get it reversed or something weird.
>> >> -roger-
>> >>
>> > -#define DSHOWDEBUG 0
>> > +/* Set to 1 to enable lots of verbose DSHOW debug info the logger */
>> > +#define DSHOWDEBUG 1
>> >
>> > Seems to turn on a lot of over head even if not displayed.
>>
>> Oops good eye.  Thought I had just added the comment but no.
>> Revision attached.
>>
>> If you'd like to review the other recent dshow commits feedback
>> welcome there also.
>> Cheers!
>> -roger-
>
>>  dshow.c |   12 +++-
>>  dshow_capture.h |1 +
>>  2 files changed, 8 insertions(+), 5 deletions(-)
>> 8cc6a2d1787151cc1a72be27dd5d5178784eb15a
>> 0001-dshow-show-incremental-values-allowed.patch
>> From e8e08ee49c6f80b02334891207d9f0d1b165b4b9 Mon Sep 17 00:00:00 2001
>> From: rogerdpack 
>> Date: Fri, 30 Jan 2015 08:53:16 -0700
>> Subject: [PATCH] dshow: show incremental values allowed
>>
>> Signed-off-by: rogerdpack 
>> ---
>>  libavdevice/dshow.c | 12 +++-
>>  libavdevice/dshow_capture.h |  1 +
>>  2 files changed, 8 insertions(+), 5 deletions(-)
>>
>> diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
>> index d03670e..f823793 100644
>> --- a/libavdevice/dshow.c
>> +++ b/libavdevice/dshow.c
>> @@ -365,18 +365,18 @@ dshow_cycle_formats(AVFormatContext *avctx, enum
>> dshowDeviceType devtype,
>>  enum AVCodecID codec_id = av_codec_get_id(tags,
>> bih->biCompression);
>>  AVCodec *codec = avcodec_find_decoder(codec_id);
>>  if (codec_id == AV_CODEC_ID_NONE || !codec) {
>> -av_log(avctx, AV_LOG_INFO, "  unknown compression
>> type 0x%X", (int) bih->biCompression);
>> +av_log(avctx, AV_LOG_INFO, "  unknown compression
>> type [please report] 0x%X", (int) bih->biCompression);
>
> this maybe should say where to report to like email address or url
> of ffmpeg-devel
>
> the other changes look fine though if one wanted to nitpick could
> be in seperate patches

Good idea, will revise and repost [I thought of some more stuff I
wanted to add anyway, so will post it all together].
Thanks.
-roger-
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/cache: pass options to the underlying protocol via the url_open2

2015-01-31 Thread Michael Niedermayer
On Sat, Jan 31, 2015 at 01:35:04PM +0800, Zhang Rui wrote:
> ---
>  libavformat/cache.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

applied

thanks

[...]
-- 
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] avcodec/put_bits: remove unneeded #include, there are no assert()

2015-01-31 Thread Michael Niedermayer
On Sat, Jan 31, 2015 at 09:37:13AM +, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  libavcodec/put_bits.h | 1 -
>  1 file changed, 1 deletion(-)

LGTM

thanks

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

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus


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] avcodec/motion_est: remove unneeded #include, there are no assert() only av_assert*

2015-01-31 Thread Michael Niedermayer
On Sat, Jan 31, 2015 at 09:37:14AM +, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  libavcodec/motion_est.c | 3 ---
>  1 file changed, 3 deletions(-)

LGTM

thanks

[...]
-- 
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


[FFmpeg-devel] [PATCH 1/2] examples/demuxing_decoding: abort decoding when width, height or pix_fmt change

2015-01-31 Thread Andreas Cadhalpun

Hi,

the demuxing_decoding example crashes, if width, height or pixel format 
of the video stream change.


Attached patch fixes this.

Best regards,
Andreas
>From 37979054edd30f3c0ea60c2103c30a18fbbc9448 Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun 
Date: Sat, 31 Jan 2015 20:58:07 +0100
Subject: [PATCH 1/2] examples/demuxing_decoding: abort decoding when width,
 height or pix_fmt change

This is necessary, because avcodec_decode_video2 can change
width, height and/or pixel format of the AVCodecContext. Since
video_dst_data and video_dst_linesize are not updated by calling
av_image_alloc again, av_image_copy[_plane] asserts, because the
destination buffer is too small.

In this case, creating a useable rawvideo is not possible anyway, since
it has fixed width/height/pix_fmt.

Signed-off-by: Andreas Cadhalpun 
---
 doc/examples/demuxing_decoding.c | 22 ++
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/doc/examples/demuxing_decoding.c b/doc/examples/demuxing_decoding.c
index 2ce4018..905df01 100644
--- a/doc/examples/demuxing_decoding.c
+++ b/doc/examples/demuxing_decoding.c
@@ -36,6 +36,8 @@
 
 static AVFormatContext *fmt_ctx = NULL;
 static AVCodecContext *video_dec_ctx = NULL, *audio_dec_ctx;
+static int width, height;
+static enum AVPixelFormat pix_fmt;
 static AVStream *video_stream = NULL, *audio_stream = NULL;
 static const char *src_filename = NULL;
 static const char *video_dst_filename = NULL;
@@ -79,6 +81,16 @@ static int decode_packet(int *got_frame, int cached)
 fprintf(stderr, "Error decoding video frame (%s)\n", av_err2str(ret));
 return ret;
 }
+if (video_dec_ctx->width != width || video_dec_ctx->height != height ||
+video_dec_ctx->pix_fmt != pix_fmt) {
+fprintf(stderr, "Error: input video width/height/format changed:\n"
+"old: width = %d, height = %d, format = %s\n"
+"new: width = %d, height = %d, format = %s\n",
+width, height, av_get_pix_fmt_name(pix_fmt),
+video_dec_ctx->width, video_dec_ctx->height,
+av_get_pix_fmt_name(video_dec_ctx->pix_fmt));
+return -1;
+}
 
 if (*got_frame) {
 printf("video_frame%s n:%d coded_n:%d pts:%s\n",
@@ -90,7 +102,7 @@ static int decode_packet(int *got_frame, int cached)
  * this is required since rawvideo expects non aligned data */
 av_image_copy(video_dst_data, video_dst_linesize,
   (const uint8_t **)(frame->data), frame->linesize,
-  video_dec_ctx->pix_fmt, video_dec_ctx->width, video_dec_ctx->height);
+  pix_fmt, width, height);
 
 /* write to rawvideo file */
 fwrite(video_dst_data[0], 1, video_dst_bufsize, video_dst_file);
@@ -264,9 +276,11 @@ int main (int argc, char **argv)
 }
 
 /* allocate image where the decoded image will be put */
+width = video_dec_ctx->width;
+height = video_dec_ctx->height;
+pix_fmt = video_dec_ctx->pix_fmt;
 ret = av_image_alloc(video_dst_data, video_dst_linesize,
- video_dec_ctx->width, video_dec_ctx->height,
- video_dec_ctx->pix_fmt, 1);
+ width, height, pix_fmt, 1);
 if (ret < 0) {
 fprintf(stderr, "Could not allocate raw video buffer\n");
 goto end;
@@ -341,7 +355,7 @@ int main (int argc, char **argv)
 if (video_stream) {
 printf("Play the output video file with the command:\n"
"ffplay -f rawvideo -pix_fmt %s -video_size %dx%d %s\n",
-   av_get_pix_fmt_name(video_dec_ctx->pix_fmt), video_dec_ctx->width, video_dec_ctx->height,
+   av_get_pix_fmt_name(pix_fmt), width, height,
video_dst_filename);
 }
 
-- 
2.1.4

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


[FFmpeg-devel] [PATCH 2/2] examples/demuxing_decoding: set stream_idx in open_codec_context only if no error occured

2015-01-31 Thread Andreas Cadhalpun

Hi,

the demuxing_decoding example sets the stream_idx even if it fails find 
a codec for that streams. This leads to a crash, when trying to decode 
the stream.


Attached patch fixes this.

Best regards,
Andreas
>From 387b8eb9c1a45bd93b7dde68669426e9ca42525a Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun 
Date: Sat, 31 Jan 2015 21:11:38 +0100
Subject: [PATCH 2/2] examples/demuxing_decoding: set stream_idx in
 open_codec_context only if no error occured

Signed-off-by: Andreas Cadhalpun 
---
 doc/examples/demuxing_decoding.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/doc/examples/demuxing_decoding.c b/doc/examples/demuxing_decoding.c
index 905df01..196d481 100644
--- a/doc/examples/demuxing_decoding.c
+++ b/doc/examples/demuxing_decoding.c
@@ -150,7 +150,7 @@ static int decode_packet(int *got_frame, int cached)
 static int open_codec_context(int *stream_idx,
   AVFormatContext *fmt_ctx, enum AVMediaType type)
 {
-int ret;
+int ret, stream_index;
 AVStream *st;
 AVCodecContext *dec_ctx = NULL;
 AVCodec *dec = NULL;
@@ -162,8 +162,8 @@ static int open_codec_context(int *stream_idx,
 av_get_media_type_string(type), src_filename);
 return ret;
 } else {
-*stream_idx = ret;
-st = fmt_ctx->streams[*stream_idx];
+stream_index = ret;
+st = fmt_ctx->streams[stream_index];
 
 /* find decoder for the stream */
 dec_ctx = st->codec;
@@ -182,6 +182,7 @@ static int open_codec_context(int *stream_idx,
 av_get_media_type_string(type));
 return ret;
 }
+*stream_idx = stream_index;
 }
 
 return 0;
-- 
2.1.4

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


Re: [FFmpeg-devel] [PATCH] configure: add --build-date and --build-time options

2015-01-31 Thread Andreas Cadhalpun

On 25.01.2015 21:25, Andreas Cadhalpun wrote:

Hi,

On 25.01.2015 18:53, Michael Niedermayer wrote:

On Sun, Jan 25, 2015 at 05:29:08PM +0100, Hendrik Leppkes wrote:

On Sun, Jan 25, 2015 at 5:15 PM, Reimar Döffinger

wrote:

I vote for just removing the build date.

[...]

Remove it for all I care, the important part is the revision info and
the
compiler used.


+1


OK, if that's preferred. New patch attached.

The ffmpeg_program_string function in t2h.pm is just the
_default_program_string function from texinfo [1] without the timestamp.

Best regards,
Andreas

1:
https://anonscm.debian.org/cgit/debian-tex/texinfo.git/tree/tp/Texinfo/Convert/HTML.pm/#n6118


Ping.

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


Re: [FFmpeg-devel] [PATCH 2/2] examples/demuxing_decoding: set stream_idx in open_codec_context only if no error occured

2015-01-31 Thread Michael Niedermayer
On Sat, Jan 31, 2015 at 09:25:44PM +0100, Andreas Cadhalpun wrote:
> Hi,
> 
> the demuxing_decoding example sets the stream_idx even if it fails
> find a codec for that streams. This leads to a crash, when trying to
> decode the stream.
> 
> Attached patch fixes this.
> 
> Best regards,
> Andreas

>  demuxing_decoding.c |7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> d273429b7aa2e30049a79262c9f3485580b8286e  
> 0002-examples-demuxing_decoding-set-stream_idx-in-open_co.patch
> From 387b8eb9c1a45bd93b7dde68669426e9ca42525a Mon Sep 17 00:00:00 2001
> From: Andreas Cadhalpun 
> Date: Sat, 31 Jan 2015 21:11:38 +0100
> Subject: [PATCH 2/2] examples/demuxing_decoding: set stream_idx in
>  open_codec_context only if no error occured

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The educated differ from the uneducated as much as the living from the
dead. -- 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 1/2] examples/demuxing_decoding: abort decoding when width, height or pix_fmt change

2015-01-31 Thread Hendrik Leppkes
On Sat, Jan 31, 2015 at 9:25 PM, Andreas Cadhalpun <
andreas.cadhal...@googlemail.com> wrote:

> Hi,
>
> the demuxing_decoding example crashes, if width, height or pixel format of
> the video stream change.
>
>
Since this is an example, there should maybe be a more descriptive error
message and a comment to mention why its done, and how one would usually go
about adapting to these changes?

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


Re: [FFmpeg-devel] [PATCH] configure: add --build-date and --build-time options

2015-01-31 Thread Michael Niedermayer
On Sun, Jan 25, 2015 at 09:25:07PM +0100, Andreas Cadhalpun wrote:
> Hi,
> 
> On 25.01.2015 18:53, Michael Niedermayer wrote:
> >On Sun, Jan 25, 2015 at 05:29:08PM +0100, Hendrik Leppkes wrote:
> >>On Sun, Jan 25, 2015 at 5:15 PM, Reimar Döffinger 
> >>wrote:
> >>>I vote for just removing the build date.
> [...]
> >>Remove it for all I care, the important part is the revision info and the
> >>compiler used.
> >
> >+1
> 
> OK, if that's preferred. New patch attached.
> 
> The ffmpeg_program_string function in t2h.pm is just the
> _default_program_string function from texinfo [1] without the
> timestamp.
> 
> Best regards,
> Andreas
> 
> 1: 
> https://anonscm.debian.org/cgit/debian-tex/texinfo.git/tree/tp/Texinfo/Convert/HTML.pm/#n6118

>  cmdutils.c   |3 +--
>  doc/Doxyfile |2 +-
>  doc/Makefile |4 ++--
>  doc/t2h.pm   |   17 +
>  ffprobe.c|2 --
>  5 files changed, 21 insertions(+), 7 deletions(-)
> edc63ab37708e1e5b509b3d3b7523b3b1213f55e  stop-embedding-the-build-date.patch
> From 3163612fb5da694a4ebcc39605561558566d85ed Mon Sep 17 00:00:00 2001
> From: Andreas Cadhalpun 
> Date: Sun, 25 Jan 2015 21:13:18 +0100
> Subject: [PATCH] stop embedding the build date
> 
> Theis makes the build binary reproducible.
> 
> Signed-off-by: Andreas Cadhalpun 
> ---
>  cmdutils.c   |  3 +--
>  doc/Doxyfile |  2 +-
>  doc/Makefile |  4 ++--
>  doc/t2h.pm   | 17 +
>  ffprobe.c|  2 --
>  5 files changed, 21 insertions(+), 7 deletions(-)
> 
> diff --git a/cmdutils.c b/cmdutils.c
> index 53268d8..6c40df9 100644
> --- a/cmdutils.c
> +++ b/cmdutils.c
> @@ -1081,8 +1081,7 @@ static void print_program_info(int flags, int level)
>  av_log(NULL, level, " Copyright (c) %d-%d the FFmpeg developers",
> program_birth_year, CONFIG_THIS_YEAR);
>  av_log(NULL, level, "\n");
> -av_log(NULL, level, "%sbuilt on %s %s with %s\n",
> -   indent, __DATE__, __TIME__, CC_IDENT);
> +av_log(NULL, level, "%sbuilt with %s\n", indent, CC_IDENT);
>  
>  av_log(NULL, level, "%sconfiguration: " FFMPEG_CONFIGURATION "\n", 
> indent);
>  }

> diff --git a/doc/Doxyfile b/doc/Doxyfile
> index 8697e6c..5d18b10 100644
> --- a/doc/Doxyfile
> +++ b/doc/Doxyfile
> @@ -839,7 +839,7 @@ HTML_COLORSTYLE_GAMMA  = 80
>  # page will contain the date and time when the page was generated. Setting
>  # this to NO can help when comparing the output of multiple runs.
>  
> -HTML_TIMESTAMP = YES
> +HTML_TIMESTAMP = NO

is there some other means to identify outdated doxygen ?
like a git revission ?


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope


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


Re: [FFmpeg-devel] [PATCH 4/6] dv: fix weight table for 2x4x8 transform

2015-01-31 Thread Christophe Gisquet
Hi,

2014-10-30 14:49 GMT+01:00 Christophe Gisquet :
> Hi,
>
> 2014-10-26 19:20 GMT+01:00 Michael Niedermayer :
>> I took the liberty to apply the patch and fix the bug instead of
>> leaving it open until someone succeeds writing a fate test for it
>
> Hi, I wonder whether this should be reverted for now (and ticket #2970
> reopened at the same time).
>
> I have been checking how to produce interlaced content through the
> encoder, and the current table produces worse results (PSNR-wise, but
> it was big enough to not bother checking visually).
>
> I don't know if that's an encoder issue yet or if the decoder table is
> still incorrect.

So I've rederived the encoder table, and I'm getting the following
PSNR values, using tiny_psnr, on a progressive sequence from a chained
encoding and decoding:
Full progressive: stddev:0.74 PSNR: 50.69 MAXDIFF:   19
Before:   stddev:1.43 PSNR: 44.97 MAXDIFF:   17
This patch:   stddev:0.76 PSNR: 50.44 MAXDIFF:   14

-- 
Christophe
From 614a10803e964ff621e6ac27f166081699d045da Mon Sep 17 00:00:00 2001
From: Christophe Gisquet 
Date: Fri, 30 Jan 2015 19:43:03 +0100
Subject: [PATCH] dvenc: fix 2x4x8 (interlaced) weight table

Since the decoder has been fixed to output something similar to
other implementations, the encoder weight table needed this fix.

Reference PSNR values on a progressive sequence (from tiny_psnr)
from a chained encoding and decoding:
Full progressive: stddev:0.74 PSNR: 50.69 MAXDIFF:   19
Before:   stddev:1.43 PSNR: 44.97 MAXDIFF:   17
This patch:   stddev:0.76 PSNR: 50.44 MAXDIFF:   14
---
 libavcodec/dvenc.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c
index 7061508..2442f2b 100644
--- a/libavcodec/dvenc.c
+++ b/libavcodec/dvenc.c
@@ -232,14 +232,14 @@ static const int dv_weight_88[64] = {
 170627, 165371, 160727, 153560, 160727, 144651, 144651, 136258,
 };
 static const int dv_weight_248[64] = {
-131072, 242189, 257107, 237536, 229376, 200636, 242189, 223754,
-224969, 196781, 262144, 242189, 229376, 200636, 257107, 237536,
-211916, 185364, 235923, 217965, 229376, 211916, 206433, 180568,
-242189, 223754, 224969, 196781, 211916, 185364, 235923, 217965,
-200704, 175557, 222935, 205965, 200636, 185364, 195068, 170627,
-229376, 211916, 206433, 180568, 200704, 175557, 222935, 205965,
-175557, 153560, 188995, 174609, 165371, 144651, 200636, 185364,
-195068, 170627, 175557, 153560, 188995, 174609, 165371, 144651,
+131072, 262144, 257107, 257107, 242189, 242189, 242189, 242189,
+237536, 237536, 229376, 229376, 200636, 200636, 224973, 224973,
+223754, 223754, 235923, 235923, 229376, 229376, 217965, 217965,
+211916, 211916, 196781, 196781, 185364, 185364, 206433, 206433,
+211916, 211916, 222935, 222935, 200636, 200636, 205964, 205964,
+200704, 200704, 180568, 180568, 175557, 175557, 195068, 195068,
+185364, 185364, 188995, 188995, 174606, 174606, 175557, 175557,
+170627, 170627, 153560, 153560, 165371, 165371, 144651, 144651,
 };
 
 static av_always_inline int dv_init_enc_block(EncBlockInfo *bi, uint8_t *data,
-- 
1.9.2.msysgit.0

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


Re: [FFmpeg-devel] [PATCH 1/2] examples/demuxing_decoding: abort decoding when width, height or pix_fmt change

2015-01-31 Thread Andreas Cadhalpun

Hi,

On 31.01.2015 22:19, Hendrik Leppkes wrote:

Since this is an example, there should maybe be a more descriptive error
message and a comment to mention why its done, and how one would usually go
about adapting to these changes?


That's a good idea. Do you think the attached patch is sufficient or can 
you suggest a better wording?


Best regards,
Andreas

>From 090e0fb14f3e4741c46fdd97cdcf3c0c7c922f39 Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun 
Date: Sat, 31 Jan 2015 20:36:07 +0100
Subject: [PATCH] examples/demuxing_decoding: abort decoding when width, height
 or pix_fmt change

This is necessary, because avcodec_decode_video2 can change
width, height and/or pixel format of the AVCodecContext. Since
video_dst_data and video_dst_linesize are not updated by calling
av_image_alloc again, av_image_copy[_plane] asserts, because the
destination buffer is too small.

In this case, creating a useable rawvideo is not possible anyway, since
it has fixed width/height/pix_fmt.

Signed-off-by: Andreas Cadhalpun 
---
 doc/examples/demuxing_decoding.c | 26 ++
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/doc/examples/demuxing_decoding.c b/doc/examples/demuxing_decoding.c
index 30bee1d..feeeb96 100644
--- a/doc/examples/demuxing_decoding.c
+++ b/doc/examples/demuxing_decoding.c
@@ -36,6 +36,8 @@
 
 static AVFormatContext *fmt_ctx = NULL;
 static AVCodecContext *video_dec_ctx = NULL, *audio_dec_ctx;
+static int width, height;
+static enum AVPixelFormat pix_fmt;
 static AVStream *video_stream = NULL, *audio_stream = NULL;
 static const char *src_filename = NULL;
 static const char *video_dst_filename = NULL;
@@ -79,6 +81,20 @@ static int decode_packet(int *got_frame, int cached)
 fprintf(stderr, "Error decoding video frame (%s)\n", av_err2str(ret));
 return ret;
 }
+if (video_dec_ctx->width != width || video_dec_ctx->height != height ||
+video_dec_ctx->pix_fmt != pix_fmt) {
+/* To handle this change, one could call av_image_alloc again and
+ * decode the following frames into another rawvideo file. */
+fprintf(stderr, "Error: Width, height and pixel format have to be "
+"constant in a rawvideo file, but the width, height or "
+"pixel format of the input video changed:\n"
+"old: width = %d, height = %d, format = %s\n"
+"new: width = %d, height = %d, format = %s\n",
+width, height, av_get_pix_fmt_name(pix_fmt),
+video_dec_ctx->width, video_dec_ctx->height,
+av_get_pix_fmt_name(video_dec_ctx->pix_fmt));
+return -1;
+}
 
 if (*got_frame) {
 printf("video_frame%s n:%d coded_n:%d pts:%s\n",
@@ -90,7 +106,7 @@ static int decode_packet(int *got_frame, int cached)
  * this is required since rawvideo expects non aligned data */
 av_image_copy(video_dst_data, video_dst_linesize,
   (const uint8_t **)(frame->data), frame->linesize,
-  video_dec_ctx->pix_fmt, video_dec_ctx->width, video_dec_ctx->height);
+  pix_fmt, width, height);
 
 /* write to rawvideo file */
 fwrite(video_dst_data[0], 1, video_dst_bufsize, video_dst_file);
@@ -265,9 +281,11 @@ int main (int argc, char **argv)
 }
 
 /* allocate image where the decoded image will be put */
+width = video_dec_ctx->width;
+height = video_dec_ctx->height;
+pix_fmt = video_dec_ctx->pix_fmt;
 ret = av_image_alloc(video_dst_data, video_dst_linesize,
- video_dec_ctx->width, video_dec_ctx->height,
- video_dec_ctx->pix_fmt, 1);
+ width, height, pix_fmt, 1);
 if (ret < 0) {
 fprintf(stderr, "Could not allocate raw video buffer\n");
 goto end;
@@ -342,7 +360,7 @@ int main (int argc, char **argv)
 if (video_stream) {
 printf("Play the output video file with the command:\n"
"ffplay -f rawvideo -pix_fmt %s -video_size %dx%d %s\n",
-   av_get_pix_fmt_name(video_dec_ctx->pix_fmt), video_dec_ctx->width, video_dec_ctx->height,
+   av_get_pix_fmt_name(pix_fmt), width, height,
video_dst_filename);
 }
 
-- 
2.1.4

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


Re: [FFmpeg-devel] [PATCH] configure: add --build-date and --build-time options

2015-01-31 Thread Andreas Cadhalpun

Hi,

On 31.01.2015 22:36, Michael Niedermayer wrote:

On Sun, Jan 25, 2015 at 09:25:07PM +0100, Andreas Cadhalpun wrote:

diff --git a/doc/Doxyfile b/doc/Doxyfile
index 8697e6c..5d18b10 100644
--- a/doc/Doxyfile
+++ b/doc/Doxyfile
@@ -839,7 +839,7 @@ HTML_COLORSTYLE_GAMMA  = 80
  # page will contain the date and time when the page was generated. Setting
  # this to NO can help when comparing the output of multiple runs.

-HTML_TIMESTAMP = YES
+HTML_TIMESTAMP = NO


is there some other means to identify outdated doxygen ?
like a git revission ?


One can include the git revision in the PROJECT_NUMBER, e.g. with 
attached patch.


Best regards,
Andreas

>From 1d3f9639514c65db061fb4e8dbf779a38081b7ee Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun 
Date: Sat, 31 Jan 2015 23:08:24 +0100
Subject: [PATCH] doc/doxy-wrapper.sh: autodetect version

Signed-off-by: Andreas Cadhalpun 
---
 doc/doxy-wrapper.sh | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/doc/doxy-wrapper.sh b/doc/doxy-wrapper.sh
index d88f60e..c57d39f 100755
--- a/doc/doxy-wrapper.sh
+++ b/doc/doxy-wrapper.sh
@@ -6,8 +6,15 @@ DOXYGEN="${3}"
 
 shift 3
 
+if [ -e "$SRC_PATH/VERSION" ]; then
+VERSION=`cat "$SRC_PATH/VERSION"`
+else
+VERSION=`cd "$SRC_PATH"; git describe`
+fi
+
 $DOXYGEN - <___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] ffplay: Fallback to dts if pts is unavailable in pkt_in_play_range calculation

2015-01-31 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 ffplay.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ffplay.c b/ffplay.c
index 72ec35d..c112ead 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2881,6 +2881,7 @@ static int read_thread(void *arg)
 int orig_nb_streams;
 SDL_mutex *wait_mutex = SDL_CreateMutex();
 int scan_all_pmts_set = 0;
+int64_t pkt_ts;
 
 memset(st_index, -1, sizeof(st_index));
 is->last_video_stream = is->video_stream = -1;
@@ -3143,8 +3144,9 @@ static int read_thread(void *arg)
 }
 /* check if packet is in play range specified by user, then queue, 
otherwise discard */
 stream_start_time = ic->streams[pkt->stream_index]->start_time;
+pkt_ts = pkt->pts == AV_NOPTS_VALUE ? pkt->dts : pkt->pts;
 pkt_in_play_range = duration == AV_NOPTS_VALUE ||
-(pkt->pts - (stream_start_time != AV_NOPTS_VALUE ? 
stream_start_time : 0)) *
+(pkt_ts - (stream_start_time != AV_NOPTS_VALUE ? 
stream_start_time : 0)) *
 av_q2d(ic->streams[pkt->stream_index]->time_base) -
 (double)(start_time != AV_NOPTS_VALUE ? start_time : 0) / 
100
 <= ((double)duration / 100);
-- 
1.7.9.5

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


[FFmpeg-devel] [PATCH] libavformat/mpegtsenc: allow to set service_type in sdt

2015-01-31 Thread dhead666
---
 doc/muxers.texi | 3 +++
 libavformat/mpegtsenc.c | 6 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index 7ca6409..52a9cd4 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -690,6 +690,9 @@ Set the transport_stream_id (default 0x0001). This 
identifies a
 transponder in DVB.
 @item -mpegts_service_id @var{number}
 Set the service_id (default 0x0001) also known as program in DVB.
+@item -mpegts_service_type @var{number}
+Set the program service_type (default 0x01 - TV).  For the list of valid 
+values see ETSI 300 468.
 @item -mpegts_pmt_start_pid @var{number}
 Set the first PID for PMT (default 0x1000, max 0x1f00).
 @item -mpegts_start_pid @var{number}
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 8d0da0b..6b6064a 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -76,6 +76,7 @@ typedef struct MpegTSWrite {
 int transport_stream_id;
 int original_network_id;
 int service_id;
+int service_type;
 
 int pmt_start_pid;
 int start_pid;
@@ -521,7 +522,7 @@ static void mpegts_write_sdt(AVFormatContext *s)
 *q++ = 0x48;
 desc_len_ptr = q;
 q++;
-*q++ = 0x01; /* digital television service */
+*q++ = ts->service_type;
 putstr8(&q, service->provider_name);
 putstr8(&q, service->name);
 desc_len_ptr[0] = q - desc_len_ptr - 1;
@@ -1434,6 +1435,9 @@ static const AVOption options[] = {
 { "mpegts_service_id", "Set service_id field.",
   offsetof(MpegTSWrite, service_id), AV_OPT_TYPE_INT,
   { .i64 = 0x0001 }, 0x0001, 0x, AV_OPT_FLAG_ENCODING_PARAM },
+{ "mpegts_service_type", "Set service_type field.",
+  offsetof(MpegTSWrite, service_type), AV_OPT_TYPE_INT,
+  { .i64 = 0x0001 }, 0x0001, 0xff, AV_OPT_FLAG_ENCODING_PARAM },
 { "mpegts_pmt_start_pid", "Set the first pid of the PMT.",
   offsetof(MpegTSWrite, pmt_start_pid), AV_OPT_TYPE_INT,
   { .i64 = 0x1000 }, 0x0010, 0x1f00, AV_OPT_FLAG_ENCODING_PARAM },
-- 
2.2.2

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


Re: [FFmpeg-devel] [PATCH] libavformat/mpegtsenc: allow to set service_type in sdt

2015-01-31 Thread dhead 666
Description:

This adds an option to set the service type in mpegts as define in ETSI 300
468.

I've been using this to pipe internet radio stream (originally as HLS/m3u8)
from ffmpeg to tvheadend, when the service type set right tvheadend
recognize the mpegts stream as a radio channel.

This have been test against master and it closing issue #4118
.
linuxstb from the hts freenode channel originally written the patch and
allowed me to push it upstream.



On Sun, Feb 1, 2015 at 3:40 AM, dhead666  wrote:

> ---
>  doc/muxers.texi | 3 +++
>  libavformat/mpegtsenc.c | 6 +-
>  2 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/doc/muxers.texi b/doc/muxers.texi
> index 7ca6409..52a9cd4 100644
> --- a/doc/muxers.texi
> +++ b/doc/muxers.texi
> @@ -690,6 +690,9 @@ Set the transport_stream_id (default 0x0001). This
> identifies a
>  transponder in DVB.
>  @item -mpegts_service_id @var{number}
>  Set the service_id (default 0x0001) also known as program in DVB.
> +@item -mpegts_service_type @var{number}
> +Set the program service_type (default 0x01 - TV).  For the list of valid
> +values see ETSI 300 468.
>  @item -mpegts_pmt_start_pid @var{number}
>  Set the first PID for PMT (default 0x1000, max 0x1f00).
>  @item -mpegts_start_pid @var{number}
> diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
> index 8d0da0b..6b6064a 100644
> --- a/libavformat/mpegtsenc.c
> +++ b/libavformat/mpegtsenc.c
> @@ -76,6 +76,7 @@ typedef struct MpegTSWrite {
>  int transport_stream_id;
>  int original_network_id;
>  int service_id;
> +int service_type;
>
>  int pmt_start_pid;
>  int start_pid;
> @@ -521,7 +522,7 @@ static void mpegts_write_sdt(AVFormatContext *s)
>  *q++ = 0x48;
>  desc_len_ptr = q;
>  q++;
> -*q++ = 0x01; /* digital television service */
> +*q++ = ts->service_type;
>  putstr8(&q, service->provider_name);
>  putstr8(&q, service->name);
>  desc_len_ptr[0] = q - desc_len_ptr - 1;
> @@ -1434,6 +1435,9 @@ static const AVOption options[] = {
>  { "mpegts_service_id", "Set service_id field.",
>offsetof(MpegTSWrite, service_id), AV_OPT_TYPE_INT,
>{ .i64 = 0x0001 }, 0x0001, 0x, AV_OPT_FLAG_ENCODING_PARAM },
> +{ "mpegts_service_type", "Set service_type field.",
> +  offsetof(MpegTSWrite, service_type), AV_OPT_TYPE_INT,
> +  { .i64 = 0x0001 }, 0x0001, 0xff, AV_OPT_FLAG_ENCODING_PARAM },
>  { "mpegts_pmt_start_pid", "Set the first pid of the PMT.",
>offsetof(MpegTSWrite, pmt_start_pid), AV_OPT_TYPE_INT,
>{ .i64 = 0x1000 }, 0x0010, 0x1f00, AV_OPT_FLAG_ENCODING_PARAM },
> --
> 2.2.2
>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavformat/mpegtsenc: allow to set service_type in sdt

2015-01-31 Thread Timothy Gu
On Sat Jan 31 2015 at 5:41:10 PM dhead666  wrote:

> ---
>  doc/muxers.texi | 3 +++
>  libavformat/mpegtsenc.c | 6 +-
>  2 files changed, 8 insertions(+), 1 deletion(-)
>
[...]

> +{ "mpegts_service_type", "Set service_type field.",
> +  offsetof(MpegTSWrite, service_type), AV_OPT_TYPE_INT,
> +  { .i64 = 0x0001 }, 0x0001, 0xff, AV_OPT_FLAG_ENCODING_PARAM },
>

Again, do something like this to help readability:

{ .i64 = 0x01 }, 0x01, 0xff

Thanks,

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


[FFmpeg-devel] [PATCH] libavformat/mpegtsenc: allow to set service_type in sdt

2015-01-31 Thread dhead666
---

@TimothyGu thanks for all your help, I hope this is now fine.

 doc/muxers.texi | 3 +++
 libavformat/mpegtsenc.c | 6 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index 7ca6409..2a9ebfa 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -690,6 +690,9 @@ Set the transport_stream_id (default 0x0001). This 
identifies a
 transponder in DVB.
 @item -mpegts_service_id @var{number}
 Set the service_id (default 0x0001) also known as program in DVB.
+@item -mpegts_service_type @var{number}
+Set the program service_type (default 0x01 - TV).  For the list of valid
+values see ETSI 300 468.
 @item -mpegts_pmt_start_pid @var{number}
 Set the first PID for PMT (default 0x1000, max 0x1f00).
 @item -mpegts_start_pid @var{number}
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 8d0da0b..46234b5 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -76,6 +76,7 @@ typedef struct MpegTSWrite {
 int transport_stream_id;
 int original_network_id;
 int service_id;
+int service_type;
 
 int pmt_start_pid;
 int start_pid;
@@ -521,7 +522,7 @@ static void mpegts_write_sdt(AVFormatContext *s)
 *q++ = 0x48;
 desc_len_ptr = q;
 q++;
-*q++ = 0x01; /* digital television service */
+*q++ = ts->service_type;
 putstr8(&q, service->provider_name);
 putstr8(&q, service->name);
 desc_len_ptr[0] = q - desc_len_ptr - 1;
@@ -1434,6 +1435,9 @@ static const AVOption options[] = {
 { "mpegts_service_id", "Set service_id field.",
   offsetof(MpegTSWrite, service_id), AV_OPT_TYPE_INT,
   { .i64 = 0x0001 }, 0x0001, 0x, AV_OPT_FLAG_ENCODING_PARAM },
+{ "mpegts_service_type", "Set service_type field.",
+  offsetof(MpegTSWrite, service_type), AV_OPT_TYPE_INT,
+  { .i64 = 0x01 }, 0x01, 0xff, AV_OPT_FLAG_ENCODING_PARAM },
 { "mpegts_pmt_start_pid", "Set the first pid of the PMT.",
   offsetof(MpegTSWrite, pmt_start_pid), AV_OPT_TYPE_INT,
   { .i64 = 0x1000 }, 0x0010, 0x1f00, AV_OPT_FLAG_ENCODING_PARAM },
-- 
2.2.2

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


Re: [FFmpeg-devel] [PATCH 4/6] dv: fix weight table for 2x4x8 transform

2015-01-31 Thread Michael Niedermayer
On Sat, Jan 31, 2015 at 10:51:05PM +0100, Christophe Gisquet wrote:
> Hi,
> 
> 2014-10-30 14:49 GMT+01:00 Christophe Gisquet :
> > Hi,
> >
> > 2014-10-26 19:20 GMT+01:00 Michael Niedermayer :
> >> I took the liberty to apply the patch and fix the bug instead of
> >> leaving it open until someone succeeds writing a fate test for it
> >
> > Hi, I wonder whether this should be reverted for now (and ticket #2970
> > reopened at the same time).
> >
> > I have been checking how to produce interlaced content through the
> > encoder, and the current table produces worse results (PSNR-wise, but
> > it was big enough to not bother checking visually).
> >
> > I don't know if that's an encoder issue yet or if the decoder table is
> > still incorrect.
> 
> So I've rederived the encoder table, and I'm getting the following
> PSNR values, using tiny_psnr, on a progressive sequence from a chained
> encoding and decoding:
> Full progressive: stddev:0.74 PSNR: 50.69 MAXDIFF:   19
> Before:   stddev:1.43 PSNR: 44.97 MAXDIFF:   17
> This patch:   stddev:0.76 PSNR: 50.44 MAXDIFF:   14
> 
> -- 
> Christophe

>  dvenc.c |   16 
>  1 file changed, 8 insertions(+), 8 deletions(-)
> b9e45f119febaa64d0f9e830fa00f82272c4bc59  
> 0001-dvenc-fix-2x4x8-interlaced-weight-table.patch
> From 614a10803e964ff621e6ac27f166081699d045da Mon Sep 17 00:00:00 2001
> From: Christophe Gisquet 
> Date: Fri, 30 Jan 2015 19:43:03 +0100
> Subject: [PATCH] dvenc: fix 2x4x8 (interlaced) weight table
> 
> Since the decoder has been fixed to output something similar to
> other implementations, the encoder weight table needed this fix.
> 
> Reference PSNR values on a progressive sequence (from tiny_psnr)
> from a chained encoding and decoding:
> Full progressive: stddev:0.74 PSNR: 50.69 MAXDIFF:   19
> Before:   stddev:1.43 PSNR: 44.97 MAXDIFF:   17
> This patch:   stddev:0.76 PSNR: 50.44 MAXDIFF:   14

applied

thanks
[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.


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