Re: [libav-devel] [Libav-devel][Patch] Patch for SDK 7 for NVENC

2016-09-15 Thread Diego Biurrun
Some comments for next time as Luca said he wanted to take care of it.
Please try to maintain the style of the file you are working in.

> --- a/libavcodec/nvenc_hevc.c
> +++ b/libavcodec/nvenc_hevc.c
> @@ -27,8 +27,11 @@
>  #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
>  static const AVOption options[] = {
> -{ "preset",   "Set the encoding preset",  OFFSET(preset),
>   AV_OPT_TYPE_INT,{ .i64 = PRESET_HQ }, PRESET_DEFAULT, 
> PRESET_LOSSLESS_HP, VE, "preset" },
> +{ "preset",   "Set the encoding preset",  OFFSET(preset),
>   AV_OPT_TYPE_INT,{ .i64 = PRESET_MEDIUM }, PRESET_DEFAULT, 
> PRESET_LOSSLESS_HP, VE, "preset" },
> --- a/libavcodec/nvenc_h264.c
> +++ b/libavcodec/nvenc_h264.c
> @@ -27,8 +27,11 @@
>  #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
>  static const AVOption options[] = {
> -{ "preset",   "Set the encoding preset",  OFFSET(preset),
>   AV_OPT_TYPE_INT,{ .i64 = PRESET_HQ }, PRESET_DEFAULT, 
> PRESET_LOSSLESS_HP, VE, "preset" },
> +{ "preset",   "Set the encoding preset",  OFFSET(preset),
>   AV_OPT_TYPE_INT,{ .i64 = PRESET_MEDIUM }, PRESET_DEFAULT, 
> PRESET_LOSSLESS_HP, VE, "preset" },

Why are you changing the default from HQ to MEDIUM?

On Thu, Sep 15, 2016 at 10:40:10AM +, Yogender Gupta wrote:
> From cc4f606cfba7b1ced644fe597b1b424f2af0f2bc Mon Sep 17 00:00:00 2001
> From: Yogender Gupta 
> Date: Thu, 15 Sep 2016 16:06:44 +0530
> Subject: [PATCH] Patch for SDK 7 for NVENC

The log message should be

  nvenc: Update for SDK 7

or similar.

> ---
>  libavcodec/avcodec.h|   1 +
>  libavcodec/nvenc.c  | 117 
> ++--
>  libavcodec/nvenc.h  |  23 +-
>  libavcodec/nvenc_h264.c |  15 ++-
>  libavcodec/nvenc_hevc.c |  19 ++--
>  5 files changed, 166 insertions(+), 9 deletions(-)
> 
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 7a5f10f..607688c 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -2961,6 +2961,7 @@ typedef struct AVCodecContext {
>  #define FF_PROFILE_HEVC_MAIN1
>  #define FF_PROFILE_HEVC_MAIN_10 2
>  #define FF_PROFILE_HEVC_MAIN_STILL_PICTURE  3
> +#define FF_PROFILE_HEVC_REXT4

This is an installed header, so there should be a matching APIchanges
entry.

> --- a/libavcodec/nvenc.c
> +++ b/libavcodec/nvenc.c
> @@ -463,12 +471,15 @@ static int nvec_map_preset(NVENCContext *ctx)
>  GUIDTuple presets[] = {
>  { NV_ENC_PRESET_BD_GUID },
>  { NV_ENC_PRESET_LOW_LATENCY_DEFAULT_GUID, NVENC_LOWLATENCY },
> -{ NV_ENC_PRESET_LOW_LATENCY_HP_GUID,  NVENC_LOWLATENCY },
>  { NV_ENC_PRESET_LOW_LATENCY_HQ_GUID,  NVENC_LOWLATENCY },
> +{ NV_ENC_PRESET_LOW_LATENCY_HP_GUID,  NVENC_LOWLATENCY },
>  { NV_ENC_PRESET_LOSSLESS_DEFAULT_GUID,NVENC_LOSSLESS },
>  { NV_ENC_PRESET_LOSSLESS_HP_GUID, NVENC_LOSSLESS },

That looks like a stray change.

> @@ -589,6 +600,44 @@ static void nvenc_setup_rate_control(AVCodecContext 
> *avctx)
>  
>  if (rc->averageBitRate > 0)
>  avctx->bit_rate = rc->averageBitRate;
> +
> +if (ctx->aq)
> +{

  if (ctx->aq) {

like in the rest of the file, more below.

> +av_log(avctx, AV_LOG_INFO, "AQ Enabled\n");

"enabled" :)

> +av_log(avctx, AV_LOG_WARNING, "Lookahead Not Enabled. Increase 
> Buffer Delay (-delay) \n");

Let's not capitalize every single word :)

> +}
> +else {

  } else {

> +ctx->config.rcParams.enableLookahead = 1;
> +ctx->config.rcParams.lookaheadDepth = av_clip(ctx->rc_lookahead, 
> 0, lkd_bound);
> +ctx->config.rcParams.disableIadapt = ctx->no_scenecut;
> +ctx->config.rcParams.disableBadapt = !ctx->b_adapt;

Align the = for better readability.

> +av_log(avctx, AV_LOG_INFO, "Lookahead Enabled with depth %d, 
> Scenecut %s, B-Adapt %s\n",
> +ctx->config.rcParams.lookaheadDepth, 
> ctx->config.rcParams.disableIadapt ? "Disabled" : "Enabled",
> +ctx->config.rcParams.disableBadapt ? "Disabled" : "Enabled");

Indent the next line to align with the function parameters, like so:

  av_log(avctx, AV_LOG_INFO, "Lookahead Enabled with depth %d, Scenecut %s, 
B-Adapt %s\n",
 ctx->config.rcParams.lookaheadDepth, 
ctx->config.rcParams.disableIadapt ? "Disabled" : "Enabled",
 ctx->config.rcParams.disableBadapt ? "Disabled" : "Enabled");

> @@ -692,9 +741,38 @@ static int nvenc_setup_hevc_config(AVCodecContext *avctx)
>  
> -/* No other profile is supported in the current SDK version 5 */
> -cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN_GUID;
> -avctx->profile  = FF_PROFILE_HEVC_MAIN;
> +switch(ctx->profile) {

switch (

> --- a/libavcodec/nvenc.h
> +++ b/libavcodec/nvenc.h
> 

Re: [libav-devel] [Libav-devel][Patch] Patch for SDK 7 for NVENC

2016-09-15 Thread Luca Barbato
On 15/09/16 12:40, Yogender Gupta wrote:
> Attached is patch for SDK 7 for NVENC.
> 

I'll need the weekend to update my system to try it, there are a couple
of style nits that I'll address while at it beside that seems fine.

Thanks a lot!

lu

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] build: doc: more fine-grained dependencies for generated texi files

2016-09-15 Thread Janne Grunau
On 2016-09-13 11:00:16 +0200, Diego Biurrun wrote:
> ---
> 
> Fixed the issues caught by Janne.
> 
>  doc/Makefile | 11 +++
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/doc/Makefile b/doc/Makefile
> index 2f6a5fb..c464a48 100644
> --- a/doc/Makefile
> +++ b/doc/Makefile
> @@ -1,7 +1,8 @@
>  ALLMANPAGES = $(AVBASENAMES:%=%.1)
>  MANPAGES= $(AVPROGS-yes:%=doc/%.1)
>  PODPAGES= $(AVPROGS-yes:%=doc/%.pod)
> -HTMLPAGES   = $(AVPROGS-yes:%=doc/%.html)   \
> +PROGSHTML   = $(AVPROGS-yes:%=doc/%.html)
> +HTMLPAGES   = $(PROGSHTML)  \
>doc/developer.html\
>doc/faq.html  \
>doc/fate.html \
> @@ -39,22 +40,24 @@ TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 
> }' <$< >$(@:%=%.d)
>  GENTEXI  = format codec
>  GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
>  
> +$(MANPAGES) $(PODPAGES) $(PROGSHTML): $(GENTEXI)
> +
>  $(GENTEXI): TAG = GENTEXI
>  $(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
>   $(M)doc/print_options $* > $@
>  
>  doc/%.html: TAG = HTML
> -doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
> +doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init
>   $(Q)$(TEXIDEP)
>   $(M)texi2html -I doc -monolithic --init-file $(SRC_PATH)/doc/t2h.init 
> --output $@ $<
>  
>  doc/%.pod: TAG = POD
> -doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
> +doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl
>   $(Q)$(TEXIDEP)
>   $(M)$(SRC_PATH)/doc/texi2pod.pl -Idoc $< $@
>  
>  doc/%.1: TAG = MAN
> -doc/%.1: doc/%.pod $(GENTEXI)
> +doc/%.1: doc/%.pod
>   $(M)pod2man --section=1 --center=" " --release=" " $< > $@
>  
>  $(DOCS) doc/doxy/html: | doc/

ok

Janne
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] lavd/libdc1394: distinguish between enumeration errors and no cameras found

2016-09-15 Thread Diego Biurrun
On Mon, Sep 12, 2016 at 12:09:58AM +0100, Josh de Kock wrote:
> On 25/07/2016 11:17, Diego Biurrun wrote:
> > On Sun, Jul 24, 2016 at 08:55:42PM +0100, Josh de Kock wrote:
> >> --- a/libavdevice/libdc1394.c
> >> +++ b/libavdevice/libdc1394.c
> >> @@ -299,9 +299,14 @@ static int dc1394_v2_read_header(AVFormatContext *c)
> >>  /* Now let us prep the hardware. */
> >>  dc1394->d = dc1394_new();
> >> -dc1394_camera_enumerate (dc1394->d, );
> >> -if ( !list || list->num == 0) {
> >> -av_log(c, AV_LOG_ERROR, "Unable to look for an IIDC camera\n\n");
> >> +if (dc1394_camera_enumerate(dc1394->d, ) != DC1394_SUCCESS || 
> >> !list) {
> >> +av_log(c, AV_LOG_ERROR, "Unable to look for an IIDC camera.\n");
> >> +goto out;
> >> +}
> >> +
> >> +if (list->num == 0) {
> >> +av_log(c, AV_LOG_ERROR, "No cameras found.\n");
> >> +dc1394_camera_free_list(list);
> >>  goto out;
> >>  }
> >
> > You add a call to dc1394_camera_free_list(). Is this the only instance
> > where that call should be added. It's not done below the out label and
> > I'm curious why it should not be part of general cleanup if it is needed
> > here.
> 
> Yes, it is the only instance. There are no code-paths where the list 
> will not get free'd.

Pushed.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] opencv not found

2016-09-15 Thread Luca Barbato
On 15/09/16 12:04, Antonio Trande wrote:
> Hi all.
> 
> On libav-11.7, 'configure' fails by activating the 'opencv' support on
> Fedora >24; this problem comes out with 'opencv-3.1.0' only.
> 

IIRC opencv-2 is to be used.

lu

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] rtsp: Fix a crash with the RTSP muxer

2016-09-15 Thread Luca Barbato
On 15/09/16 13:24, Martin Storsjö wrote:
> This was introduced in bc2a32969e.
> 
> The whole block that the statement was added to is only
> relevant when used as a demuxer, but the other statements
> there have had other if statements guarding them. Make
> sure to only run this whole block if being used as a
> demuxer.
> 
> CC: libav-sta...@libav.org
> ---
> This is relevant for the 12 release branch.
> ---
>  libavformat/rtsp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

OK.

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] rtsp: Fix a crash with the RTSP muxer

2016-09-15 Thread Martin Storsjö
This was introduced in bc2a32969e.

The whole block that the statement was added to is only
relevant when used as a demuxer, but the other statements
there have had other if statements guarding them. Make
sure to only run this whole block if being used as a
demuxer.

CC: libav-sta...@libav.org
---
This is relevant for the 12 release branch.
---
 libavformat/rtsp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index b9416d2..84b912f 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -827,7 +827,8 @@ int ff_rtsp_open_transport_ctx(AVFormatContext *s, 
RTSPStream *rtsp_st)
 
 if (!rtsp_st->transport_priv) {
  return AVERROR(ENOMEM);
-} else if (CONFIG_RTPDEC && rt->transport == RTSP_TRANSPORT_RTP) {
+} else if (CONFIG_RTPDEC && rt->transport == RTSP_TRANSPORT_RTP &&
+   s->iformat) {
 RTPDemuxContext *rtpctx = rtsp_st->transport_priv;
 rtpctx->ssrc = rtsp_st->ssrc;
 if (rtsp_st->dynamic_handler) {
-- 
2.8.4 (Apple Git-73)

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] opencv not found

2016-09-15 Thread Antonio Trande


On 09/15/2016 12:36 PM, Sean McGovern wrote:
> Hi Antonio,
> 
> On Sep 15, 2016 06:05, "Antonio Trande"  wrote:
>>
>> Hi all.
>>
>> On libav-11.7, 'configure' fails by activating the 'opencv' support on
>> Fedora >24; this problem comes out with 'opencv-3.1.0' only.
>>
>> /tmp/ffconf.PWJBf2tR.o: In function `cvPointFrom32f':
>> ffconf.FauB7gLz.c:(.text+0x5ca): undefined reference to `cvRound'
>> ffconf.FauB7gLz.c:(.text+0x5e2): undefined reference to `cvRound'
>> /tmp/ffconf.PWJBf2tR.o: In function `cvReadInt':
>> ffconf.FauB7gLz.c:(.text+0xf00): undefined reference to `cvRound'
>> /tmp/ffconf.PWJBf2tR.o: In function `cvEllipseBox':
>> ffconf.FauB7gLz.c:(.text+0x1198): undefined reference to `cvRound'
>> ffconf.FauB7gLz.c:(.text+0x11bc): undefined reference to `cvRound'
>> collect2: error: ld returned 1 exit status
>> ERROR: opencv not found
>>
>> I'm attaching config.log file.
>>
>> Cheers.
>> --
>> ---
>> Antonio Trande
> 
> Can you please report this issue to our bug tracker at
> https://bugzilla.libav.org ?
> 
> -- Sean McG.
> ___

https://bugzilla.libav.org/show_bug.cgi?id=963

-- 
---
Antonio Trande
mailto: sagitter 'at' fedoraproject 'dot' org
http://fedoraos.wordpress.com/
https://fedoraproject.org/wiki/User:Sagitter
GPG Key: 0x6CE6D08A
Check on https://keys.fedoraproject.org/



signature.asc
Description: OpenPGP digital signature
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [Libav-devel][Patch] Patch for SDK 7 for NVENC

2016-09-15 Thread Yogender Gupta
Attached is patch for SDK 7 for NVENC.

Thanks,
Yogender

---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---


0001-Patch-for-SDK-7-for-NVENC.patch
Description: 0001-Patch-for-SDK-7-for-NVENC.patch
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] opencv not found

2016-09-15 Thread Sean McGovern
Hi Antonio,

On Sep 15, 2016 06:05, "Antonio Trande"  wrote:
>
> Hi all.
>
> On libav-11.7, 'configure' fails by activating the 'opencv' support on
> Fedora >24; this problem comes out with 'opencv-3.1.0' only.
>
> /tmp/ffconf.PWJBf2tR.o: In function `cvPointFrom32f':
> ffconf.FauB7gLz.c:(.text+0x5ca): undefined reference to `cvRound'
> ffconf.FauB7gLz.c:(.text+0x5e2): undefined reference to `cvRound'
> /tmp/ffconf.PWJBf2tR.o: In function `cvReadInt':
> ffconf.FauB7gLz.c:(.text+0xf00): undefined reference to `cvRound'
> /tmp/ffconf.PWJBf2tR.o: In function `cvEllipseBox':
> ffconf.FauB7gLz.c:(.text+0x1198): undefined reference to `cvRound'
> ffconf.FauB7gLz.c:(.text+0x11bc): undefined reference to `cvRound'
> collect2: error: ld returned 1 exit status
> ERROR: opencv not found
>
> I'm attaching config.log file.
>
> Cheers.
> --
> ---
> Antonio Trande

Can you please report this issue to our bug tracker at
https://bugzilla.libav.org ?

-- Sean McG.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel