Re: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision Open SRT protocol

2018-03-22 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Nicolas George
> Gesendet: Donnerstag, 22. März 2018 16:03
> An: FFmpeg development discussions and patches
> Betreff: Re: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision
> Open SRT protocol
> 
> Sven Dueking (2018-03-16):
> > Ping !?!?
> 
> I think I am actually expected to reply.
> 
> I think that by reviewing the patch I gave the impression that I was
> promising to accept the patch in FFmpeg. It was not so, and I apologize
> if it was taken that way. The original patch contained significant
> changes in the standard network code that made it much more complex, I
> wanted to avoid that, that is the reason I reviewed, it was purely
> technical. The decision to accept a patch in FFmpeg is not purely
> technical, it also involves balancing the cost of maintenance with the
> benefit for users.
> 
> In this instance, the recent discussion on libav-dev seems to indicate
> that the API and ABI of this library could be not very stable, making
> the cost of maintenance relatively high, a fact that is worsened by the
> library not being integrated in major Linux distros. As for the benefit
> for users, are there public servers serving interesting content
> accessible with this protocol? Are there situations where this protocol
> would allow several instances of ffmpeg to communicate significantly
> better than other protocols? I am not aware of any.
> 
> That, plus the poor choice of name (seriously, who dabs in multimedia
> and does not know that SRT has been a subtitle format for more than
> fifteen years? and there is the SRTP profile too) makes me doubtful
> about integrating this in FFmpeg.
> 
> But it is not my choice only.
> 
> Regards,
> 
> --
>   Nicolas George

Hi,

The SRT library has been made Open Source in April 2017, but was used before
in Haivision products since 2013. It is used in 100s of mission critical
installation (medical, sports, broadcast, military) worldwide and its
reliability has been proven. Since it’s Open Source, 100 organizations have
joined the SRT Alliance (https://www.srtalliance.org/) in order to create a
new ecosystem for broadcast quality streaming over the public internet,
which wasn’t available as Open Source up to that point and only offered as
commercial solutions by very few specialized companies. Meanwhile many
organizations including the EBU (Eurovision), Wowza, Matrox and many more
have SRT Ready solutions. SRT has been integrated into VLC and GStreamer.
The SRT Alliance is working with the video services forum, who recommends
standards to SMPTE, towards a standardization of the protocol. Many
architectures in the broadcast industry are using either libav or ffmpeg and
are asking when they will be able to utilize SRT though these known media
libraries. I understand the name is not optimal, but when it was initially
created in 2013 unfortunately nobody thought about taken it Open Source due
to the typical industry mindset at that time.

Thank you!

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


Re: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision Open SRT protocol

2018-03-16 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Sven Dueking
> Gesendet: Mittwoch, 14. März 2018 08:39
> An: 'FFmpeg development discussions and patches'
> Betreff: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision Open
> SRT protocol
> 
> Updated patch according to latest feedback :
> 
> - spelling errors and capitalization
> - renamed option "timeout" -> "rw_timeout"
> - changed max values for duration parameters to INT64_MAX


Ping !?!?

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


[FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision Open SRT protocol

2018-03-14 Thread Sven Dueking
Updated patch according to latest feedback :

- spelling errors and capitalization
- renamed option "timeout" -> "rw_timeout"
- changed max values for duration parameters to INT64_MAX



0001-avformat-opensrt-add-Haivision-Open-SRT-protocol.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision Open SRT protocol

2018-03-09 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von wm4
> Gesendet: Freitag, 9. März 2018 08:21
> An: ffmpeg-devel@ffmpeg.org
> Betreff: Re: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision
> Open SRT protocol
> 
> On Wed, 21 Feb 2018 10:16:48 +0100
> "Sven Dueking" <s...@nablet.com> wrote:
> 
> > protocol requires libsrt (https://github.com/Haivision/srt) to be
> > installed
> >
> > Signed-off-by: Sven Dueking <sven.duek...@nablet.com>
> > ---
> >  MAINTAINERS |   1 +
> >  configure   |   5 +
> >  doc/protocols.texi  | 134 ++-
> >  libavformat/Makefile|   1 +
> >  libavformat/opensrt.c   | 589
> > 
> >  libavformat/protocols.c |   1 +
> >  6 files changed, 730 insertions(+), 1 deletion(-)  create mode
> 100644
> > libavformat/opensrt.c
> >
> > diff --git a/MAINTAINERS b/MAINTAINERS index b691bd5..3e0355a 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -499,6 +499,7 @@ Protocols:
> >http.cRonald S. Bultje
> >libssh.c  Lukasz Marek
> >mms*.cRonald S. Bultje
> > +  opensrt.c sven Dueking
> >udp.c Luca Abeni
> >icecast.c Marvin Scholz
> >
> > diff --git a/configure b/configure
> > index 013308c..9a78bae 100755
> > --- a/configure
> > +++ b/configure
> > @@ -294,6 +294,7 @@ External library support:
> >--enable-opengl  enable OpenGL rendering [no]
> >--enable-openssl enable openssl, needed for https support
> > if gnutls or libtls is not used [no]
> > +  --enable-opensrt enable Haivision Open SRT protocol [no]
> >--disable-sndio  disable sndio support [autodetect]
> >--disable-schannel   disable SChannel SSP, needed for TLS
> support on
> > Windows if openssl and gnutls are not
> used
> > [autodetect] @@ -1648,6 +1649,7 @@ EXTERNAL_LIBRARY_LIST="
> >  mediacodec
> >  openal
> >  opengl
> > +opensrt
> >  "
> >
> >  HWACCEL_AUTODETECT_LIBRARY_LIST="
> > @@ -3157,6 +3159,8 @@ libssh_protocol_deps="libssh"
> >  libtls_conflict="openssl gnutls"
> >  mmsh_protocol_select="http_protocol"
> >  mmst_protocol_select="network"
> > +opensrt_protocol_select="network"
> > +opensrt_protocol_deps="opensrt"
> >  rtmp_protocol_conflict="librtmp_protocol"
> >  rtmp_protocol_select="tcp_protocol"
> >  rtmp_protocol_suggest="zlib"
> > @@ -6028,6 +6032,7 @@ enabled omx   && require_header
> OMX_Core.h
> >  enabled omx_rpi   && { check_header OMX_Core.h ||
> > { ! enabled cross_compile &&
> > add_cflags -isystem/opt/vc/include/IL && check_header OMX_Core.h ; }
> ||
> > die "ERROR: OpenMAX IL headers not
> > found"; } && enable omx
> > +enabled opensrt   && require_pkg_config libsrt "srt >=
> 1.2.0"
> > srt/srt.h srt_socket
> >  enabled openssl   && { check_pkg_config openssl openssl
> > openssl/ssl.h OPENSSL_init_ssl ||
> > check_pkg_config openssl openssl
> > openssl/ssl.h SSL_library_init ||
> > check_lib openssl openssl/ssl.h
> > SSL_library_init -lssl -lcrypto || diff --git a/doc/protocols.texi
> > b/doc/protocols.texi index c24dc74..1d49eaa 100644
> > --- a/doc/protocols.texi
> > +++ b/doc/protocols.texi
> > @@ -752,12 +752,144 @@ Truncate existing files on write, if set to 1.
> > A value of 0 prevents  truncating. Default value is 1.
> >
> >  @item workgroup
> > -Set the workgroup used for making connections. By default workgroup
> > is not specified.
> > +Set the workgroup used for making connections. By default workgroup
> > +is not specified.
> >
> >  @end table
> >
> >  For more information see: @url{http://www.samba.org/}.
> >
> > +@section srt
> > +
> > +Haivision Secure Reliable Transport Protocol via libsrt.
> > +
> > +The required syntax for a SRT url is:
> > +@example
> > +srt://

Re: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision Open SRT protocol

2018-03-05 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Sven Dueking
> Gesendet: Dienstag, 27. Februar 2018 08:27
> An: 'FFmpeg development discussions and patches'
> Betreff: Re: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision
> Open SRT protocol
> 
> 
> 
> > -Ursprüngliche Nachricht-
> > Von: Sven Dueking [mailto:s...@nablet.com]
> > Gesendet: Mittwoch, 21. Februar 2018 15:25
> > An: 'FFmpeg development discussions and patches'
> > Betreff: AW: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision
> > Open SRT protocol
> >
> >
> >
> > > -Ursprüngliche Nachricht-
> > > Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im
> > > Auftrag von Michael Niedermayer
> > > Gesendet: Mittwoch, 21. Februar 2018 14:35
> > > An: FFmpeg development discussions and patches
> > > Betreff: Re: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision
> > > Open SRT protocol
> > >
> > > On Wed, Feb 21, 2018 at 10:16:48AM +0100, Sven Dueking wrote:
> > > > protocol requires libsrt (https://github.com/Haivision/srt) to be
> > > > installed
> > > >
> > > > Signed-off-by: Sven Dueking <sven.duek...@nablet.com>
> > > > ---
> > > >  MAINTAINERS |   1 +
> > > >  configure   |   5 +
> > > >  doc/protocols.texi  | 134 ++-
> > > >  libavformat/Makefile|   1 +
> > > >  libavformat/opensrt.c   | 589
> > > > 
> > > >  libavformat/protocols.c |   1 +
> > > >  6 files changed, 730 insertions(+), 1 deletion(-)  create mode
> > > > 100644 libavformat/opensrt.c
> > > >
> > > > diff --git a/MAINTAINERS b/MAINTAINERS index b691bd5..3e0355a
> > 100644
> > > > --- a/MAINTAINERS
> > > > +++ b/MAINTAINERS
> > > > @@ -499,6 +499,7 @@ Protocols:
> > > >http.cRonald S. Bultje
> > > >libssh.c  Lukasz Marek
> > > >mms*.cRonald S. Bultje
> > > > +  opensrt.c sven Dueking
> > > >udp.c Luca Abeni
> > > >icecast.c Marvin Scholz
> > > >
> > > > diff --git a/configure b/configure index 013308c..9a78bae 100755
> > > > --- a/configure
> > > > +++ b/configure
> > > > @@ -294,6 +294,7 @@ External library support:
> > > >--enable-opengl  enable OpenGL rendering [no]
> > > >--enable-openssl enable openssl, needed for https
> > support
> > > > if gnutls or libtls is not used [no]
> > > > +  --enable-opensrt enable Haivision Open SRT protocol
> [no]
> > > >--disable-sndio  disable sndio support [autodetect]
> > > >--disable-schannel   disable SChannel SSP, needed for TLS
> > support
> > > on
> > > > Windows if openssl and gnutls are not
> > > > used [autodetect] @@ -1648,6 +1649,7 @@ EXTERNAL_LIBRARY_LIST="
> > > >  mediacodec
> > > >  openal
> > > >  opengl
> > > > +opensrt
> > >
> > > there is something wrong with newlines this patch is corrupted and
> > > cannot be tested or applied
> > >
> > > [...]
> >
> > Hi Michael,
> >
> > Sorry, no idea why this happens. Patch attached.
> 
> Ping ?!
> 
> >
> > > --
> > > Michael GnuPG fingerprint:
> > 9FF2128B147EF6730BADF133611EC787040B0FAB
> > >
> > > Rewriting code that is poorly written but fully understood is good.
> > > Rewriting code that one doesnt understand is a sign that one is
> less
> > > smart then the original author, trying to rewrite it will not make
> > > it
> > better.
> 

Any chance to get feedback ? 
> ___
> 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] avformat/opensrt: add Haivision Open SRT protocol

2018-02-26 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: Sven Dueking [mailto:s...@nablet.com]
> Gesendet: Mittwoch, 21. Februar 2018 15:25
> An: 'FFmpeg development discussions and patches'
> Betreff: AW: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision
> Open SRT protocol
> 
> 
> 
> > -Ursprüngliche Nachricht-
> > Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> > von Michael Niedermayer
> > Gesendet: Mittwoch, 21. Februar 2018 14:35
> > An: FFmpeg development discussions and patches
> > Betreff: Re: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision
> > Open SRT protocol
> >
> > On Wed, Feb 21, 2018 at 10:16:48AM +0100, Sven Dueking wrote:
> > > protocol requires libsrt (https://github.com/Haivision/srt) to be
> > > installed
> > >
> > > Signed-off-by: Sven Dueking <sven.duek...@nablet.com>
> > > ---
> > >  MAINTAINERS |   1 +
> > >  configure   |   5 +
> > >  doc/protocols.texi  | 134 ++-
> > >  libavformat/Makefile|   1 +
> > >  libavformat/opensrt.c   | 589
> > > 
> > >  libavformat/protocols.c |   1 +
> > >  6 files changed, 730 insertions(+), 1 deletion(-)  create mode
> > > 100644 libavformat/opensrt.c
> > >
> > > diff --git a/MAINTAINERS b/MAINTAINERS index b691bd5..3e0355a
> 100644
> > > --- a/MAINTAINERS
> > > +++ b/MAINTAINERS
> > > @@ -499,6 +499,7 @@ Protocols:
> > >http.cRonald S. Bultje
> > >libssh.c  Lukasz Marek
> > >mms*.cRonald S. Bultje
> > > +  opensrt.c sven Dueking
> > >udp.c Luca Abeni
> > >icecast.c Marvin Scholz
> > >
> > > diff --git a/configure b/configure
> > > index 013308c..9a78bae 100755
> > > --- a/configure
> > > +++ b/configure
> > > @@ -294,6 +294,7 @@ External library support:
> > >--enable-opengl  enable OpenGL rendering [no]
> > >--enable-openssl enable openssl, needed for https
> support
> > > if gnutls or libtls is not used [no]
> > > +  --enable-opensrt enable Haivision Open SRT protocol [no]
> > >--disable-sndio  disable sndio support [autodetect]
> > >--disable-schannel   disable SChannel SSP, needed for TLS
> support
> > on
> > > Windows if openssl and gnutls are not
> > > used [autodetect] @@ -1648,6 +1649,7 @@ EXTERNAL_LIBRARY_LIST="
> > >  mediacodec
> > >  openal
> > >  opengl
> > > +opensrt
> >
> > there is something wrong with newlines this patch is corrupted and
> > cannot be tested or applied
> >
> > [...]
> 
> Hi Michael,
> 
> Sorry, no idea why this happens. Patch attached.

Ping ?!

> 
> > --
> > Michael GnuPG fingerprint:
> 9FF2128B147EF6730BADF133611EC787040B0FAB
> >
> > Rewriting code that is poorly written but fully understood is good.
> > Rewriting code that one doesnt understand is a sign that one is less
> > smart then the original author, trying to rewrite it will not make it
> better.

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


Re: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision Open SRT protocol

2018-02-21 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag von
> Michael Niedermayer
> Gesendet: Mittwoch, 21. Februar 2018 14:35
> An: FFmpeg development discussions and patches
> Betreff: Re: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision Open
> SRT protocol
> 
> On Wed, Feb 21, 2018 at 10:16:48AM +0100, Sven Dueking wrote:
> > protocol requires libsrt (https://github.com/Haivision/srt) to be
> > installed
> >
> > Signed-off-by: Sven Dueking <sven.duek...@nablet.com>
> > ---
> >  MAINTAINERS |   1 +
> >  configure   |   5 +
> >  doc/protocols.texi  | 134 ++-
> >  libavformat/Makefile|   1 +
> >  libavformat/opensrt.c   | 589
> > 
> >  libavformat/protocols.c |   1 +
> >  6 files changed, 730 insertions(+), 1 deletion(-)  create mode 100644
> > libavformat/opensrt.c
> >
> > diff --git a/MAINTAINERS b/MAINTAINERS index b691bd5..3e0355a 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -499,6 +499,7 @@ Protocols:
> >http.cRonald S. Bultje
> >    libssh.c      Lukasz Marek
> >mms*.cRonald S. Bultje
> > +  opensrt.c sven Dueking
> >udp.c Luca Abeni
> >icecast.c Marvin Scholz
> >
> > diff --git a/configure b/configure
> > index 013308c..9a78bae 100755
> > --- a/configure
> > +++ b/configure
> > @@ -294,6 +294,7 @@ External library support:
> >--enable-opengl  enable OpenGL rendering [no]
> >--enable-openssl enable openssl, needed for https support
> > if gnutls or libtls is not used [no]
> > +  --enable-opensrt enable Haivision Open SRT protocol [no]
> >--disable-sndio  disable sndio support [autodetect]
> >--disable-schannel   disable SChannel SSP, needed for TLS support
> on
> > Windows if openssl and gnutls are not used
> > [autodetect] @@ -1648,6 +1649,7 @@ EXTERNAL_LIBRARY_LIST="
> >  mediacodec
> >  openal
> >  opengl
> > +opensrt
> 
> there is something wrong with newlines
> this patch is corrupted and cannot be tested or applied
> 
> [...]

Hi Michael,

Sorry, no idea why this happens. Patch attached.

> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> Rewriting code that is poorly written but fully understood is good.
> Rewriting code that one doesnt understand is a sign that one is less smart
> then the original author, trying to rewrite it will not make it better.


0001-avformat-opensrt-add-Haivision-Open-SRT-protocol.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision Open SRT protocol

2018-02-21 Thread Sven Dueking
protocol requires libsrt (https://github.com/Haivision/srt) to be installed

Signed-off-by: Sven Dueking <sven.duek...@nablet.com>
---
 MAINTAINERS |   1 +
 configure   |   5 +
 doc/protocols.texi  | 134 ++-
 libavformat/Makefile|   1 +
 libavformat/opensrt.c   | 589

 libavformat/protocols.c |   1 +
 6 files changed, 730 insertions(+), 1 deletion(-)  create mode 100644
libavformat/opensrt.c

diff --git a/MAINTAINERS b/MAINTAINERS
index b691bd5..3e0355a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -499,6 +499,7 @@ Protocols:
   http.cRonald S. Bultje
   libssh.c  Lukasz Marek
   mms*.cRonald S. Bultje
+  opensrt.c     sven Dueking
   udp.c Luca Abeni
   icecast.c Marvin Scholz
 
diff --git a/configure b/configure
index 013308c..9a78bae 100755
--- a/configure
+++ b/configure
@@ -294,6 +294,7 @@ External library support:
   --enable-opengl  enable OpenGL rendering [no]
   --enable-openssl enable openssl, needed for https support
if gnutls or libtls is not used [no]
+  --enable-opensrt enable Haivision Open SRT protocol [no]
   --disable-sndio  disable sndio support [autodetect]
   --disable-schannel   disable SChannel SSP, needed for TLS support on
Windows if openssl and gnutls are not used
[autodetect] @@ -1648,6 +1649,7 @@ EXTERNAL_LIBRARY_LIST="
 mediacodec
 openal
 opengl
+opensrt
 "
 
 HWACCEL_AUTODETECT_LIBRARY_LIST="
@@ -3157,6 +3159,8 @@ libssh_protocol_deps="libssh"
 libtls_conflict="openssl gnutls"
 mmsh_protocol_select="http_protocol"
 mmst_protocol_select="network"
+opensrt_protocol_select="network"
+opensrt_protocol_deps="opensrt"
 rtmp_protocol_conflict="librtmp_protocol"
 rtmp_protocol_select="tcp_protocol"
 rtmp_protocol_suggest="zlib"
@@ -6028,6 +6032,7 @@ enabled omx   && require_header OMX_Core.h
 enabled omx_rpi   && { check_header OMX_Core.h ||
{ ! enabled cross_compile && add_cflags
-isystem/opt/vc/include/IL && check_header OMX_Core.h ; } ||
die "ERROR: OpenMAX IL headers not found"; }
&& enable omx
+enabled opensrt   && require_pkg_config libsrt "srt >= 1.2.0"
srt/srt.h srt_socket
 enabled openssl   && { check_pkg_config openssl openssl
openssl/ssl.h OPENSSL_init_ssl ||
check_pkg_config openssl openssl
openssl/ssl.h SSL_library_init ||
check_lib openssl openssl/ssl.h
SSL_library_init -lssl -lcrypto || diff --git a/doc/protocols.texi
b/doc/protocols.texi index c24dc74..1d49eaa 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -752,12 +752,144 @@ Truncate existing files on write, if set to 1. A
value of 0 prevents  truncating. Default value is 1.
 
 @item workgroup
-Set the workgroup used for making connections. By default workgroup is not
specified.
+Set the workgroup used for making connections. By default workgroup is 
+not specified.
 
 @end table
 
 For more information see: @url{http://www.samba.org/}.
 
+@section srt
+
+Haivision Secure Reliable Transport Protocol via libsrt.
+
+The required syntax for a SRT url is:
+@example
+srt://@var{hostname}:@var{port}[?@var{options}]
+@end example
+
+@var{options} contains a list of &-separated options of the form 
+@var{key}=@var{val}.
+
+This protocol accepts the following options.
+
+@table @option
+@item connect_timeout
+Connection timeout. SRT cannot connect for RTT > 1500 msec
+(2 handshake exchanges) with the default connect timeout of
+3 seconds. This option applies to the caller and rendezvous connection 
+modes. The connect timeout is 10 times the value set for the rendezvous 
+mode (which can be used as a workaround for this connection problem 
+with earlier versions).
+
+@item fc=@var{bytes}
+Flight Flag Size (Window Size), in bytes. FC is actually an internal 
+parameter and you should set it to not less than 
+@option{recv_buffer_size} and @option{mss}. The default value is 
+relatively large, therefore unless you set a very large receiver 
+buffer, you do not need to change this option. Default value is 25600.
+
+@item inputbw=@var{bytes/seconds}
+Sender nominal input rate, in bytes per seconds. Used along with 
+@option{oheadbw}, when @option{maxbw} is set to relative (0), to 
+calculate maximum sending rate when recovery packets are sent along 
+with main media stream:
+@option{inputbw} * (100 + @option{oheadbw}) / 100 if @option{inputbw} 
+is not set while @option{maxbw} is set to relativ

Re: [FFmpeg-devel] avcodec/qsv: export session management functionality

2015-12-14 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Nicolas George
> Gesendet: Montag, 14. Dezember 2015 16:55
> An: FFmpeg development discussions and patches
> Betreff: Re: [FFmpeg-devel] avcodec/qsv: export session management
> functionality
> 
> Le quartidi 24 frimaire, an CCXXIV, Sven Dueking a écrit :
> > Thanks for your feedback, I think it´s necessary because :
> >
> > 1. qsv_api.c is single file where qsv-related public functions are
> > located 2. there is big question that qsv.c will exists in future
> most
> > likely it will merged with qsv_api later.
> > We have only one common function left
> >
> > If you disagree, please suggest how to split this.
> 
> Patch #1: make the functions public (renaming ff_ -> av_, removing
> static, moving prototypes in public headers).
> 
> Patch #2: move the code from one file to the other.
> 
> I see no reason this would not work, please correct me if I am wrong.

I didn´t say that this would not work. 
Will split the patch, but will wait for Hendriks feedback - maybe he has
some feedback for this patch.

> 
> Regards,
> 
> --
>   Nicolas George

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


[FFmpeg-devel] avcodec/qsv: export session management functionality

2015-12-14 Thread Sven Dueking
Updated patch according to Hendriks feedback.

 

Thanks,

Sven



0001-export-session-management-functionality.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] avcodec/qsv: export session management functionality

2015-12-14 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Nicolas George
> Gesendet: Montag, 14. Dezember 2015 16:32
> An: FFmpeg development discussions and patches
> Betreff: Re: [FFmpeg-devel] avcodec/qsv: export session management
> functionality
> 
> Le quartidi 24 frimaire, an CCXXIV, Sven Dueking a écrit :
> > Updated patch according to Hendriks feedback.
> 
> Is it really necessary to have the moves from a file to another in the
> same patch as the functional changes? It makes seeing what did actually
> change much harder, almost impossible.
> 
> Regards,
> 
> --
>   Nicolas George

Hi Nicolas,

Thanks for your feedback, I think it´s necessary because : 

1. qsv_api.c is single file where qsv-related public functions are located
2. there is big question that qsv.c will exists in future most likely it
will merged with qsv_api later. 
We have only one common function left

If you disagree, please suggest how to split this.

Thanks,
Sven

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


Re: [FFmpeg-devel] [PATCH] QSV : making three qsv routines public

2015-12-14 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Hendrik Leppkes
> Gesendet: Donnerstag, 10. Dezember 2015 10:19
> An: FFmpeg development discussions and patches
> Betreff: Re: [FFmpeg-devel] [PATCH] QSV : making three qsv routines
> public
> 
> On Thu, Dec 10, 2015 at 10:16 AM, Sven Dueking <s...@nablet.com> wrote:
> > This patch expose 3 QSV functions as public.
> > This is needed because the VPP needs access to these functions too.
> >
> > Please review.
> >
> 
> public API is not allowed to use config.h, it needs to be config and OS
> agnostic.
> 
> - Hendrik

Updated patch attached, I removed the config.h related stuff and use a void 
pointer instead.
(should be ok since VADisplay is a void * pointer)

Please review.

Thanks,
Sven

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


0001-make-some-internal-QSV-routines-public.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] QSV : making three qsv routines public

2015-12-10 Thread Sven Dueking
This patch expose 3 QSV functions as public. 
This is needed because the VPP needs access to these functions too.

Please review.

Thanks,
Sven


0001-make-some-internal-QSV-routines-public.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] making qsv session routines private

2015-11-30 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Hendrik Leppkes
> Gesendet: Montag, 30. November 2015 10:56
> An: FFmpeg development discussions and patches
> Betreff: Re: [FFmpeg-devel] [PATCH] making qsv session routines private
> 
> On Mon, Nov 30, 2015 at 10:45 AM, Sven Dueking <s...@nablet.com> wrote:
> > Hi all,
> >
> > This is a follow up patch according to the discussion of
> >
> > [FFmpeg-devel] [PATCH] qsv.c: making qsv session routines
> >
> > Hopefully this is the correct way to share internal functions between
> > codecs and filters.
> > At least other filters seems to do it this way ...
> >
> > Thanks,
> > Sven
> >
> >
> 
> We really try to avoid avpriv in new code, as its a kludge at best.

Strange, this was suggested during the discussion 

I guess we need a better way to share internal things. The currently 
nonsensical library separation makes this hard. We could just use avpriv_ in 
this case, or make a header-only implementation. Certainly it doesn't need to 
be public API.

So, do you prefer that I double the code or a header only implementation ?
Or, is there another way to do this (besides avpriv) ?

> ___
> 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] making qsv session routines private

2015-11-30 Thread Sven Dueking
Hi all,

This is a follow up patch according to the discussion of 

[FFmpeg-devel] [PATCH] qsv.c: making qsv session routines

Hopefully this is the correct way to share internal functions between codecs
and filters.
At least other filters seems to do it this way ...

Thanks,
Sven




0001-make-qsv-functions-avpriv.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] making qsv session routines private

2015-11-30 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Sven Dueking
> Gesendet: Montag, 30. November 2015 11:06
> An: 'FFmpeg development discussions and patches'
> Betreff: Re: [FFmpeg-devel] [PATCH] making qsv session routines private
> 
> 
> 
> > -Ursprüngliche Nachricht-
> > Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> > von Hendrik Leppkes
> > Gesendet: Montag, 30. November 2015 10:56
> > An: FFmpeg development discussions and patches
> > Betreff: Re: [FFmpeg-devel] [PATCH] making qsv session routines
> > private
> >
> > On Mon, Nov 30, 2015 at 10:45 AM, Sven Dueking <s...@nablet.com>
> wrote:
> > > Hi all,
> > >
> > > This is a follow up patch according to the discussion of
> > >
> > > [FFmpeg-devel] [PATCH] qsv.c: making qsv session routines
> > >
> > > Hopefully this is the correct way to share internal functions
> > > between codecs and filters.
> > > At least other filters seems to do it this way ...
> > >
> > > Thanks,
> > > Sven
> > >
> > >
> >
> > We really try to avoid avpriv in new code, as its a kludge at best.
> 
> Strange, this was suggested during the discussion
> 
> I guess we need a better way to share internal things. The currently
> nonsensical library separation makes this hard. We could just use
> avpriv_ in this case, or make a header-only implementation. Certainly
> it doesn't need to be public API.
> 
> So, do you prefer that I double the code or a header only
> implementation ?
> Or, is there another way to do this (besides avpriv) ?

Another option is to rename the header from QSV_internal.h to QSV_public.h 
(something like this) 
and use the av_ prefix. Not sure that it´s allowed, some other filters call av_ 
functions from the codecs.
What do you think ?

> 
> > ___
> > 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 mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCHv3] Added QSV based VPP filter

2015-11-12 Thread Sven Dueking
Hello,

 

Attached an updated version of the VPP filter.

 

Changes to v2 :

 

-Copy input frame if not aligned

-Proper use of AVERROR(ENOMEM)

-Removed unneeded pointer checks

-Cleanup

-Updated Documentation

 

Please review.

 

Thanks,

Sven

 



0001-added-QSV-VPP-filter.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCHv3] Added QSV based VPP filter

2015-11-12 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von wm4
> Gesendet: Donnerstag, 12. November 2015 15:34
> An: ffmpeg-devel@ffmpeg.org
> Betreff: Re: [FFmpeg-devel] [PATCHv3] Added QSV based VPP filter
> 
> On Thu, 12 Nov 2015 11:33:28 +0100
> "Sven Dueking" <s...@nablet.com> wrote:
> 
> > From a4de3cfda2f99a2e1f1e471d198ef39971c03798 Mon Sep 17 00:00:00
> 2001
> > From: Sven Dueking <s...@nablet.com>
> > Date: Thu, 12 Nov 2015 08:33:50 +
> > Subject: [PATCH] added QSV VPP filter
> >
> > ---
> >  configure|   1 +
> >  doc/filters.texi | 169 +++
> >  libavfilter/Makefile |   1 +
> >  libavfilter/allfilters.c |   1 +
> >  libavfilter/vf_qsv_vpp.c | 734
> > +++
> >  5 files changed, 906 insertions(+)
> >  create mode 100644 libavfilter/vf_qsv_vpp.c
> >
> > diff --git a/configure b/configure
> > index d5e76de..811be83 100755
> > --- a/configure
> > +++ b/configure
> > @@ -2846,6 +2846,7 @@ super2xsai_filter_deps="gpl"
> >  tinterlace_filter_deps="gpl"
> >  vidstabdetect_filter_deps="libvidstab"
> >  vidstabtransform_filter_deps="libvidstab"
> > +vppqsv_filter_deps="libmfx"
> >  pixfmts_super2xsai_test_deps="super2xsai_filter"
> >  tinterlace_merge_test_deps="tinterlace_filter"
> >  tinterlace_pad_test_deps="tinterlace_filter"
> > diff --git a/doc/filters.texi b/doc/filters.texi index
> > 471ec3f..e90d998 100644
> > --- a/doc/filters.texi
> > +++ b/doc/filters.texi
> > @@ -11581,6 +11581,175 @@ vignette='PI/4+random(1)*PI/50':eval=frame
> >
> >  @end itemize
> >
> > +
> > +@section vppqsv
> > +
> > +The VPP library is part of the Intel® Media SDK and exposes the
> media
> > +acceleration capabilities of Intel® platforms.
> > +
> > +Specifically, this library performs the following conversions:
> > +
> > +@itemize
> > +@item
> > +@emph{Color Conversion}: is the process of changing one type of
> color-encoded signal into another.
> > +VPP supports several input color formats and NV12 as output format.
> > +
> > +@verbatim
> > +Format Type |
> > +
> -
> > +Input (uncompressed)| YV12, NV12, YUY2, RGB4 (RGB 32-
> bit)
> > +
> -
> > +Output (uncompressed)   | NV12
> > +@end verbatim
> > +
> > +@item
> > +@emph{Scaling}: is the process of resizing an image.
> > +An image size can be changed in several ways, VPP uses a separable
> > +8-tap poly-phase scaling filter with adaptive filter ringing
> suppression.
> > +
> > +@item
> > +@emph{Deinterlacing}: is the process of converting interlaced video
> into a non-interlaced form.
> > +VPP uses a motion adaptive based deinterlacing algorithm.
> > +
> > +@verbatim
> > +Input Frame Rate (FPS) |  Output Frame Rate (FPS)
> > +   Interlaced  |   Progressive
> > +   |  23.976  |  25  |  29.97  |  30  |  50  |
> > +59.94  |  60
> > +
> -
> > +  29.97| Inverse  |  | |  |  |
> |
> > +   | Telecine |  |x|  |  |
> |
> > +
> -
> > +   50  |  |   x  | |  |   x  |
> |
> > +
> -
> > +  59.94|  |  |x|  |  |
> x|
> > +
> -
> > +   60  |  |  | |   x  |  |
> |x
> > +
> > +x indicates a supported function
> > +@end verbatim
> > +
> > +@item
> > +@emph{Denoising}: is the process of removing noise from a video
> signal.
> > +VPP uses a motion detection based temporal (adaptive to noise
> > +history) and spatial (edge/ texture preserved) denoiser.
> > +The spatial video denoiser is applied to each frame individually and
> > +the temporal video denoiser to reduce nois

Re: [FFmpeg-devel] [PATCHv3] Added QSV based VPP filter

2015-11-12 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von wm4
> Gesendet: Donnerstag, 12. November 2015 16:37
> An: ffmpeg-devel@ffmpeg.org
> Betreff: Re: [FFmpeg-devel] [PATCHv3] Added QSV based VPP filter
> 
> On Thu, 12 Nov 2015 16:25:06 +0100
> "Sven Dueking" <s...@nablet.com> wrote:
> 
> > > You can't just set the data pointers on a refcounted AVFrame to a
> > > completely different allocation. This breaks refcounting
> completely.
> > > Also, a refcounted AVFrame has to remain valid even if the filter
> > > gets destroyed, so I guess you can only output not-refcounted
> > > AVFrames, which probably will result in a copy sooner or later.
> > >
> > > I'd say this is a pretty critical issue.
> >
> > Means I need to copy the data from my surface into the AVFrame ?
> 
> That'd be the easiest fix.
> 
> > > > +static av_cold int vpp_init(AVFilterContext *ctx) {
> > > > +VPPContext *vpp= ctx->priv;
> > > > +
> > > > +AVCodecContext *avctx = (AVCodecContext *)ctx;
> > >
> > > Excuse me, what???
> >
> > I assume this means that such cast is not allowed, right ?
> > This means that I need to add some stuff from qsv.c to this filter
> >
> > int ff_qsv_init_internal_session(AVCodecContext *avctx, QSVSession
> *qs,
> >  const char *load_plugins)
> >
> > Btw, this cast works (even it´s not allowed) ...
> 
> Also, this function is private to libavcodec and can't be used from
> libavfilter. Your code doesn't even LINK as shared lib.
> 

Missed that, ok - will think how to "duplicate" some code from the codecs.

> >
> > Again, thanks for your review. I will think about your proposal to
> redesign the filter.
> 
> I didn't suggest to "redesign" it.

To introduce some new functions to simplify the readability :). 

> ___
> 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] Intel QuickSync Video

2015-11-09 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Sevan Gelici
> Gesendet: Freitag, 6. November 2015 20:35
> An: FFmpeg development discussions and patches
> Betreff: Re: [FFmpeg-devel] Intel QuickSync Video
> 
> @Will Kelleher
> CPU:
> http://ark.intel.com/products/75122/Intel-Core-i7-4770-Processor-8M-
> Cache-up-to-3_90-GHz
> MediaSDK: Intel-linux-media-ocl_generic_16.4.2.1-39163_64bit.tar.gz
> (inside package of mediaserverstudioessentials2015r6.tar.gz)
> Ubuntu 14.04.3 LTS, Codename:   trusty
> 
> 
> 
> @Sven Dueking
> file to file also not working, I made a debug log
> 
> 
> Splitting the commandline.
> Reading option '-y' ... matched as option 'y' (overwrite output files)
> with argument '1'.
> Reading option '-fflags' ... matched as AVOption 'fflags' with argument
> '+genpts'.
> Reading option '-loglevel' ... matched as option 'loglevel' (set
> logging
> level) with argument 'debug'.
> Reading option '-probesize' ... matched as AVOption 'probesize' with
> argument '1000'.
> Reading option '-analyzeduration' ... matched as AVOption
> 'analyzeduration'
> with argument '1500'.
> Reading option '-i' ... matched as input file with argument
> 'm84_2.mpg'.
> Reading option '-strict' ...Routing option strict to both codec and
> muxer layer  matched as AVOption 'strict' with argument '-2'.
> Reading option '-dn' ... matched as option 'dn' (disable data) with
> argument '1'.
> Reading option '-vcodec' ... matched as option 'vcodec' (force video
> codec ('copy' to copy stream)) with argument 'h264_qsv'.
> Reading option '-preset' ... matched as AVOption 'preset' with argument
> 'veryfast'.
> Reading option '-profile:v' ... matched as option 'profile' (set
> profile) with argument 'baseline'.
> Reading option '-level' ... matched as AVOption 'level' with argument
> '3.0'.
> Reading option '-acodec' ... matched as option 'acodec' (force audio
> codec ('copy' to copy stream)) with argument 'aac'.
> Reading option '-b:v' ... matched as option 'b' (video bitrate (please
> use
> -b:v)) with argument '1000k'.
> Reading option '-r' ... matched as option 'r' (set frame rate (Hz
> value, fraction or abbreviation)) with argument '25'.
> Reading option '-b:a' ... matched as option 'b' (video bitrate (please
> use
> -b:v)) with argument '128k'.
> Reading option '-minrate' ... matched as AVOption 'minrate' with
> argument '200k'.
> Reading option '-maxrate' ... matched as AVOption 'maxrate' with
> argument '1200k'.
> Reading option '-bufsize' ... matched as AVOption 'bufsize' with
> argument '1200k'.
> Reading option '-vf' ... matched as option 'vf' (set video filters)
> with argument 'scale=720:576'.
> Reading option '-aspect' ... matched as option 'aspect' (set aspect
> ratio (4:3, 16:9 or 1., 1.)) with argument '16:9'.
> Reading option '-ar' ... matched as option 'ar' (set audio sampling
> rate (in Hz)) with argument '48000'.
> Reading option '-ac' ... matched as option 'ac' (set number of audio
> channels) with argument '2'.
> Reading option '-f' ... matched as option 'f' (force format) with
> argument 'mpegts'.
> Reading option 'bla.ts' ... matched as output file.
> Finished splitting the commandline.
> Parsing a group of options: global .
> Applying option y (overwrite output files) with argument 1.
> Applying option loglevel (set logging level) with argument debug.
> Successfully parsed a group of options.
> Parsing a group of options: input file m84_2.mpg.
> Successfully parsed a group of options.
> Opening an input file: m84_2.mpg.
> [mpeg @ 0x311aa40] Format mpeg probed with size=2048 and score=26 [mpeg
> @ 0x311aa40] Before avformat_find_stream_info() pos: 0 bytes
> read:32768 seeks:0
> [mpeg @ 0x311aa40] probing stream 0 pp:2500 [mpeg @ 0x311aa40] Probe
> with size=2012, packets=1 detected mpegvideo with
> score=25
> [mpeg @ 0x311aa40] probed stream 0
> [mpeg @ 0x311aa40] Probe buffer size limit of 1000 bytes reached
> [mpeg @ 0x311aa40] rfps: 30.00 0.013228 [mpeg @ 0x311aa40] rfps:
> 29.970030 0.00
> Last message repeated 1 times
> [mpeg @ 0x311aa40] rfps: 59.940060 0.00
> Last message repeated 1 times
> [mpeg @ 0x311aa40] After avformat_find_stream_info() pos: 0 bytes
> read:10473616 seeks:2 frames:399
> Input #0, mpeg, from 'm84_2.mpg':
>   Duration: 00:00:21.99, start: 0.387500, bitrate: 6108 kb/s
> Stream #0:0[0x1e0], 399, 1/9: Video: mpeg2video (Main), 1
> reference frame, yuv420p(tv, bt470bg, left), 720x480 [SAR 8:9 DAR 4:3],
> 1001/6, 6000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
> Successfully opened the file.
> Parsing a group of options: output file bla.ts.
> A

Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter - second try

2015-11-05 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von wm4
> Gesendet: Donnerstag, 5. November 2015 13:43
> An: ffmpeg-devel@ffmpeg.org
> Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter - second
> try
> 
> On Thu, 5 Nov 2015 12:49:50 +0100
> "Sven Dueking" <s...@nablet.com> wrote:
> 
> > > > +} else if (ret == MFX_WRN_DEVICE_BUSY) {
> > > > +av_usleep(500);
> > >
> > > What. Use proper event-based waiting.
> >
> > That´s the same behavior as we have in the qsv encoder and decoder.
> > And as far as I know this is how Intel recommends to handle this.
> 
> That's just ridiculous. Can you send some hate-mail to Intel and tell
> them what a bad idea this is? Half a millisecond is an eternity for a
> CPU. What if the device is blocked only for 10 microseconds? Then it
> will waste time by spending 490 microseconds idly.
> 
> Software engineers recognized that polling is a bad idea half a century
> ago. Why can't Intel do this right?
> 
> Or does MFX have some sort of async mode that works without polling?
 
Intel doesn´t recommend 500ms, it´s 1 ms according to the sample.
But, the FFMpeg decoder and encoder were changed to 500ms some time ago : 
https://github.com/FFmpeg/FFmpeg/commit/947c2aa4567782be64411a953a5b294976463e19

I agree with the comments from Ivan, this doesn´t happen in a normal scenario.
And I never get this state at all in all my tests.
But I can change it back to 1ms, not sure if this makes sense.

Btw, thanks again for your review. 

> ___
> 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] Added QSV based VPP filter - second try

2015-11-05 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Sven Dueking
> Gesendet: Montag, 2. November 2015 10:33
> An: 'FFmpeg development discussions and patches'
> Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter - second
> try
> 
> 
> 
> > -Ursprüngliche Nachricht-
> > Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> > von Carl Eugen Hoyos
> > Gesendet: Donnerstag, 29. Oktober 2015 18:39
> > An: ffmpeg-devel@ffmpeg.org
> > Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter -
> > second try
> >
> > Sven Dueking  nablet.com> writes:
> >
> > > Please find attached my second attempt to add Intel´s VPP to
> FFMpeg.
> > > As requested, the patch includes a documentation file
> >
> > I don't know much about how the documentation works but why isn't
> this
> > part of the filter documentation and how are users supposed to find
> it?
> 
> Hi Carl,
> 
> I was unsure how to add the documentation, that´s why I asked this
> before.
> Will merge my changes into the filter documentation.
> 
> >
> > > +AV_PIX_FMT_RGB32,
> >
> > The Intel documentation for RGB4 reads:
> > "ARGB in that order, A channel is 8 MSBs"
> > Making this AV_PIX_FMT_ARGB imo
> > But I'm probably wrong again...
> 
> https://software.intel.com/sites/default/files/mediasdk-man.pdf
> 
> RGB4
> Thirty-two-bit RGB color format. Also known as RGB32
> 
> MFX_FOURCC_RGB4 : RGB4 (RGB32) color planes
> 
> This matches the define in the latest SDK
> 
> MFX_FOURCC_RGB4 = MFX_MAKEFOURCC('R','G','B','4'),/*
> RGB32 */
> 
> As far as I know older versions of mfxstructures.h have such comment as
> you mentioned.
> 
> Anyway, according to the sample
> 
>case MFX_FOURCC_RGB4:
> ptr->G = ptr->B + 1;
> ptr->R = ptr->B + 2;
> ptr->A = ptr->B + 3;
> 
> it´s BGRA (and the output is fine using BRGA and "bad" using ARGB).
> 
> >
> > > +if (inlink->format == AV_PIX_FMT_YUV420P)
> > > +vpp->pVppParam->vpp.In.FourCC = MFX_FOURCC_YV12;
> > > +else if (inlink->format == AV_PIX_FMT_YUV422P)
> > > +vpp->pVppParam->vpp.In.FourCC = MFX_FOURCC_YUY2;
> > > +else if (inlink->format == AV_PIX_FMT_NV12)
> > > +vpp->pVppParam->vpp.In.FourCC = MFX_FOURCC_NV12;
> > > +else
> > > +vpp->pVppParam->vpp.In.FourCC = MFX_FOURCC_RGB4;
> >
> > Did you consider to add BGR4 and ARGB16 in the future?
> 
> No, VPP doesn´t support ARGB16.
> 
> >
> > > +unsigned int bits_per_pixel =
> > > + get_bpp(vpp->pVppParam->vpp.In.FourCC);
> >
> > See below.
> >
> > > +width = (unsigned int) FFALIGN(vpp->pVppParam->vpp.In.Width,
> > 32);
> > > +height = (unsigned int) FFALIGN(vpp->pVppParam->vpp.In.Height,
> > > + 32);
> >
> > Are the casts necessary or useful?
> 
> Nope ;)
> 
> >
> > > +vpp->in_surface = av_mallocz(sizeof(mfxFrameSurface1) *
> > > vpp->num_surfaces_in);
> >
> > This looks wrong to me, I believe you want to allocate
> num_surfaces_in
> > pointers, not structs. (Sorry if I miss
> > somthing.)
> 
> You are correct, thanks !
> 
> >
> > > +return -1;
> >
> > ENOMEM.
> >
> > > +for (i = 0; i < vpp->num_surfaces_in; i++)
> > > +vpp->in_surface[i] = NULL;
> >
> > This is unnecessary if you use mallocz() as you do.
> >
> > > +for (i = 0; i < vpp->num_surfaces_in; i++) {
> > > +vpp->in_surface[i] = av_mallocz(sizeof(mfxFrameSurface1));
> > > +
> > > +if (!vpp->in_surface[i])
> > > +return -1;
> >
> > ENOMEM but this leaks memory, you have to free everything else on
> > failure.
> > (same below for out_surface)
> >
> > > +bits_per_pixel = 12;
> >
> > Imo, remove the variable and use get_bpp() once and "12" on the
> second
> > usage.
> >
> 
> Also ok.
> 
> Many thanks for your feedback !

Hi all,

Attached an updated version of the VPP filter.

Thanks,
Sven

> 
> > Carl Eugen
> > ___
> > 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


0001-added-QSV-VPP-filter.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter - second try

2015-11-05 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von wm4
> Gesendet: Donnerstag, 5. November 2015 12:19
> An: ffmpeg-devel@ffmpeg.org
> Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter - second
> try
> 
> On Thu, 5 Nov 2015 11:18:38 +0100
> "Sven Dueking" <s...@nablet.com> wrote:
> 
> > From 0fe140c8204b4e09f577358b02295b76c2b5f3be Mon Sep 17 00:00:00
> 2001
> > From: Sven Dueking <s...@nablet.com>
> > Date: Thu, 5 Nov 2015 09:26:43 +
> > Subject: [PATCH] added QSV VPP filter
> >
> > ---
> >  configure|   1 +
> >  doc/filters.texi | 174 
> >  libavfilter/Makefile |   1 +
> >  libavfilter/allfilters.c |   1 +
> >  libavfilter/vf_qsv_vpp.c | 722
> > +++
> >  5 files changed, 899 insertions(+)
> >  create mode 100644 libavfilter/vf_qsv_vpp.c
> >
> > diff --git a/configure b/configure
> > index f770534..65cf013 100755
> > --- a/configure
> > +++ b/configure
> > @@ -2843,6 +2843,7 @@ super2xsai_filter_deps="gpl"
> >  tinterlace_filter_deps="gpl"
> >  vidstabdetect_filter_deps="libvidstab"
> >  vidstabtransform_filter_deps="libvidstab"
> > +vppqsv_filter_deps="libmfx"
> >  pixfmts_super2xsai_test_deps="super2xsai_filter"
> >  tinterlace_merge_test_deps="tinterlace_filter"
> >  tinterlace_pad_test_deps="tinterlace_filter"
> > diff --git a/doc/filters.texi b/doc/filters.texi index
> > 15ea77a..a3bf66c 100644
> > --- a/doc/filters.texi
> > +++ b/doc/filters.texi
> > @@ -9089,6 +9089,180 @@ qp=2+2*sin(PI*qp)  @end example  @end itemize
> >
> > +@section vppqsv
> > +
> > +The VPP library is part of the Intel® Media SDK and exposes the
> media acceleration capabilities of Intel® platforms.
> > +
> > +Specifically, this library performs the following conversions:
> > +
> > +@itemize
> > +@item
> > +@emph{Color Conversion}: is the process of changing one type of
> color-encoded signal into another.
> > +VPP supports several input color formats and NV12 as output format.
> > +
> > +@verbatim
> > +Format Type |
> > +
> -
> > +Input (uncompressed)| YV12, NV12, YUY2, RGB4 (RGB 32-
> bit)
> > +
> -
> > +Output (uncompressed)   | NV12
> > +@end verbatim
> > +
> > +@item
> > +@emph{Scaling}: is the process of resizing an image.
> > +An image size can be changed in several ways, VPP uses a separable
> > +8-tap poly-phase scaling filter with adaptive filter ringing
> suppression.
> > +
> > +@item
> > +@emph{Deinterlacing}: is the process of converting interlaced video
> into a non-interlaced form.
> > +VPP uses a motion adaptive based deinterlacing algorithm.
> > +
> > +@verbatim
> > +Input Frame Rate (FPS) |  Output Frame Rate (FPS)
> > +   Interlaced  |   Progressive
> > +   |  23.976  |  25  |  29.97  |  30  |  50  |
> > +59.94  |  60
> > +
> -
> > +  29.97| Inverse  |  | |  |  |
> |
> > +   | Telecine |  |x|  |  |
> |
> > +
> -
> > +   50  |  |   x  | |  |   x  |
> |
> > +
> -
> > +  59.94|  |  |x|  |  |
> x|
> > +
> -
> > +   60  |  |  | |   x  |  |
> |x
> > +
> > +x indicates a supported function
> > +@end verbatim
> > +
> > +@item
> > +@emph{Denoising}: is the process of removing noise from a video
> signal.
> > +VPP uses a motion detection based temporal (adaptive to noise
> > +history) and spatial (edge/ texture preserved) denoiser.
> > +The spatial video denoiser is applied to each frame individually and
> > +the temporal video denoiser to reduce noise between frames.
> > +
> > +@

Re: [FFmpeg-devel] Intel QuickSync Video

2015-11-05 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Sevan Gelici
> Gesendet: Freitag, 6. November 2015 00:42
> An: ffmpeg-devel@ffmpeg.org
> Betreff: [FFmpeg-devel] Intel QuickSync Video
> 
> Hello,
> 
> I try to transcode with quick sync, but it doesn't work.
> I did follow:  https://ffmpeg.org/general.html#Intel-QuickSync-Video
> 
> 
> When i use this command:
> ./ffmpeg -y  -fflags +genpts -loglevel warning  -probesize 1000 -
> analyzeduration 1500 -i
> "udp://@:4012?fifo_size=100_nonfatal=1" -map 0:0 -map 0:1
> -strict -2 -dn -vcodec  h264_qsv -preset veryfast -profile:v baseline -
> level 3.0 -acodec aac -b:v 1000k -r 25  -b:a 128k -minrate 200k -
> maxrate 1200k -bufsize 1200k -vf scale=720:576 -aspect 16:9  -ar 48000
> -ac 2  -f flv rtmp://192.168.0.131/rtmp/test1
> 
> I get this error
> [h264_qsv @ 0x3017580] Error initializing an internal MFX session Error
> while opening encoder for output stream #0:0 - maybe incorrect
> parameters such as bit_rate, rate, width or height
> 
> How can I solve this please?

Can you provide uncut ffmpeg output from the failure? Does it work from file to 
file transcoding ?
> ___
> 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] Added QSV based VPP filter - second try

2015-11-02 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Carl Eugen Hoyos
> Gesendet: Donnerstag, 29. Oktober 2015 18:39
> An: ffmpeg-devel@ffmpeg.org
> Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter - second
> try
> 
> Sven Dueking  nablet.com> writes:
> 
> > Please find attached my second attempt to add Intel´s VPP to FFMpeg.
> > As requested, the patch includes a documentation file
> 
> I don't know much about how the documentation works but why isn't this
> part of the filter documentation and how are users supposed to find it?

Hi Carl,

I was unsure how to add the documentation, that´s why I asked this before.
Will merge my changes into the filter documentation.

> 
> > +AV_PIX_FMT_RGB32,
> 
> The Intel documentation for RGB4 reads:
> "ARGB in that order, A channel is 8 MSBs"
> Making this AV_PIX_FMT_ARGB imo
> But I'm probably wrong again...

https://software.intel.com/sites/default/files/mediasdk-man.pdf

RGB4
Thirty-two-bit RGB color format. Also known as RGB32

MFX_FOURCC_RGB4 : RGB4 (RGB32) color planes

This matches the define in the latest SDK

MFX_FOURCC_RGB4 = MFX_MAKEFOURCC('R','G','B','4'),/* RGB32 */

As far as I know older versions of mfxstructures.h have such comment as you 
mentioned.

Anyway, according to the sample

   case MFX_FOURCC_RGB4:
ptr->G = ptr->B + 1;
ptr->R = ptr->B + 2;
ptr->A = ptr->B + 3;

it´s BGRA (and the output is fine using BRGA and "bad" using ARGB).

> 
> > +if (inlink->format == AV_PIX_FMT_YUV420P)
> > +vpp->pVppParam->vpp.In.FourCC = MFX_FOURCC_YV12;
> > +else if (inlink->format == AV_PIX_FMT_YUV422P)
> > +vpp->pVppParam->vpp.In.FourCC = MFX_FOURCC_YUY2;
> > +else if (inlink->format == AV_PIX_FMT_NV12)
> > +vpp->pVppParam->vpp.In.FourCC = MFX_FOURCC_NV12;
> > +else
> > +vpp->pVppParam->vpp.In.FourCC = MFX_FOURCC_RGB4;
> 
> Did you consider to add BGR4 and ARGB16 in the future?

No, VPP doesn´t support ARGB16.

> 
> > +unsigned int bits_per_pixel =
> > + get_bpp(vpp->pVppParam->vpp.In.FourCC);
> 
> See below.
> 
> > +width = (unsigned int) FFALIGN(vpp->pVppParam->vpp.In.Width,
> 32);
> > +height = (unsigned int) FFALIGN(vpp->pVppParam->vpp.In.Height,
> > + 32);
> 
> Are the casts necessary or useful?

Nope ;)

> 
> > +vpp->in_surface = av_mallocz(sizeof(mfxFrameSurface1) *
> > vpp->num_surfaces_in);
> 
> This looks wrong to me, I believe you want to allocate
> num_surfaces_in pointers, not structs. (Sorry if I miss
> somthing.)

You are correct, thanks !

> 
> > +return -1;
> 
> ENOMEM.
> 
> > +for (i = 0; i < vpp->num_surfaces_in; i++)
> > +vpp->in_surface[i] = NULL;
> 
> This is unnecessary if you use mallocz() as you do.
> 
> > +for (i = 0; i < vpp->num_surfaces_in; i++) {
> > +vpp->in_surface[i] = av_mallocz(sizeof(mfxFrameSurface1));
> > +
> > +if (!vpp->in_surface[i])
> > +return -1;
> 
> ENOMEM but this leaks memory, you have to free
> everything else on failure.
> (same below for out_surface)
> 
> > +bits_per_pixel = 12;
> 
> Imo, remove the variable and use get_bpp() once
> and "12" on the second usage.
> 

Also ok.

Many thanks for your feedback !

> Carl Eugen
> ___
> 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] Added QSV based VPP filter - second try

2015-10-29 Thread Sven Dueking
Hi all,

Please find attached my second attempt to add Intel´s VPP to FFMpeg. 
As requested, the patch includes a documentation file
(patch checker shows some warnings here, but I am not sure if they needs to
be fixed).

Again, looking forward to get feedback … and I am nervous ;).

Thanks,
Sven


0001-added-QSV-VPP-filter.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavcodec/qsv.c: Re-design session control and internal allocation

2015-10-26 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Hendrik Leppkes
> Gesendet: Donnerstag, 22. Oktober 2015 17:56
> An: FFmpeg development discussions and patches
> Betreff: Re: [FFmpeg-devel] [PATCH] libavcodec/qsv.c: Re-design session
> control and internal allocation
> 
> On Wed, Oct 14, 2015 at 11:47 AM, Hendrik Leppkes 
> wrote:
> > On Wed, Oct 7, 2015 at 7:07 PM, Ivan Uskov 
> wrote:
> >> Hello wm4,
> >>
> >> Wednesday, October 7, 2015, 7:40:45 PM, you wrote:
> >>
> >> w> There's no automagic way to get this done.
> >>
> >> w> Hardware accelerators like vaapi and vdpau need the same thing.
> >> w> These have special APIs to set an API context on the decoder.
> Some
> >> w> APIs use hwaccel_context, vdpau uses av_vdpau_bind_context().
> >>
> >> w> The hwaccel_context pointer is untyped (just a void*), and what
> it
> >> w> means is implicit to the hwaccel or the decoder that is used. It
> >> w> could point to some sort of qsv state, which will have to be
> >> w> explicitly allocated and set by the API user (which might be
> ffmpeg.c).
> >> So  if  I will implement something like ffmpeg_qsv.c (using
> ffmpeg_vdpau.c as
> >> example)   and   extend  the  hwaccels[]  into  ffmpeg_opt.c  by
> corresponded
> >> qsv entries it  would  be the acceptable solution, correct?
> >>
> >> w> For filters there is no such thing yet. New API would have to be
> >> w> created. For filters in particular, we will have to make sure
> that
> >> w> the API isn't overly qsv-specific, and that it is extendable to
> >> w> other APIs (like for example vaapi or vdpau).
> >> Ok,   if   VPP  could be the  issue  I  would  like  to  get
> working  direct
> >> link qsv_decoder-qsv_encoder first.
> >>
> >
> > Libav has a patch that does exactly this, allow direct QSV->QSV
> > transcoding with help of some utility code in ffmpeg.c/avconv.c You
> > might want to look at that instead of re-inventing it. That'll help
> > make everyones live easier, as I'll just merge it when the time
> comes,
> > and the codebases don't diverge too drastically.
> >
> 
> This functionality has been merged now. It works for some samples.
> You can try to use it with a command line like this:
> 
> ffmpeg -hwaccel qsv -c:v h264_qsv -i h264.ts -c:v h264_qsv output.mkv
> 
> This will transcode using a QSV->QSV pipeline, no copying to system
> memory, and about 2.5x faster on my IVB laptop.
> 
> However, its broken on a lot of more complex H264 files, you'll get
> errors like get_buffer() failed - this is because our qsvdec behaves
> rather strangely, and instead of buffering input data when needed, it
> buffers output surfaces, which is not ideal, since it bloats up the
> memory usage an the number of surfaces required explodes into infinity.
> I know how to fix it - just restore the decoder to the same buffering
> model as it originally used, buffer input data instead of output
> surfaces. Unless someone else wants to fix it, I'll simply do it in the
> next week or so.

Hi Henrik,

Let me know if you need help to fix that, sounds like a good chance to learn 
more about the workflow. 
But, this could also result in extra work to double check my code. So, what do 
you think ?

Best,
Sven

> 
> - Hendrik
> ___
> 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] Added QSV based VPP filter

2015-10-22 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Carl Eugen Hoyos
> Gesendet: Mittwoch, 14. Oktober 2015 12:43
> An: FFmpeg development discussions and patches
> Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter
> 
> On Wednesday 14 October 2015 10:07:04 am Sven Dueking wrote:
> > Hi all,
> >
> > The attached patches adds the VPP as filter module to FFMpeg.
> > Looking forward to get feedback.
> 
> Just a few comments, I expect you will get a comment explaining what
> you can't do;-) (Sorry for the partly broken quotation.)
> 
> In any case, please merge both patches, they are not independent.
> 
> >
> > Many thanks,
> > Sven
> 
> > From d09cff6d868bd2a0fd87e3906f8808638809494b Mon Sep 17 00:00:00
> 2001
> > From: Sven Dueking <s...@nablet.com>
> > Date: Wed, 14 Oct 2015 08:13:38 +0100
> > Subject: [PATCH 1/2] added QSV based VPP filter
> >
> > ---
> >  libavfilter/vf_qsv_vpp.c | 686
> > +++ 1 file changed, 686
> > insertions(+)
> >  create mode 100644 libavfilter/vf_qsv_vpp.c
> >
> > diff --git a/libavfilter/vf_qsv_vpp.c b/libavfilter/vf_qsv_vpp.c new
> > file mode 100644 index 000..629913e
> > --- /dev/null
> > +++ b/libavfilter/vf_qsv_vpp.c
> > @@ -0,0 +1,686 @@
> > +/*
> > + * Intel MediaSDK Quick Sync Video VPP filter
> > + *
> > + * copyright (c) 2015 Sven Dueking
> > + *
> > + * This file is part of FFmpeg.
> > + *
> > + * Libav is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU Lesser General Public
> > + * License as published by the Free Software Foundation; either
> > + * version 2.1 of the License, or (at your option) any later
> version.
> > + *
> > + * Libav is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> > + * Lesser General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU Lesser General Public
> > + * License along with Libav; if not, write to the Free Software
> > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> > 02110-1301 USA + */
> > +
> > +#include 
> > +#include 
> > +
> > +#include "avfilter.h"
> > +#include "internal.h"
> > +#include "formats.h"
> > +
> > +#include "libavutil/avassert.h"
> > +#include "libavutil/opt.h"
> > +#include "libavutil/time.h"
> > +#include "libavutil/avstring.h"
> > +#include "libavutil/error.h"
> > +#include "libavcodec/avcodec.h"
> > +#include "libavcodec/qsv_internal.h"
> > +
> > +#include 
> > +
> > +#include "avfilter.h"
> > +#include "formats.h"
> > +#include "internal.h"
> > +#include "video.h"
> > +#include "libavutil/eval.h"
> > +#include "libavutil/avstring.h"
> > +#include "libavutil/internal.h"
> > +#include "libavutil/libm.h"
> > +#include "libavutil/imgutils.h"
> > +#include "libavutil/mathematics.h"
> > +#include "libavutil/opt.h"
> > +#include "libavutil/pixfmt.h"
> 
> Are they all necessary?
> 
> > +
> > +/**
> > + * ToDo :
> > + *
> > + * - handle empty extbuffers
> > + * - cropping
> > + * - allocate number of surfaces depending modules and number of b
> > +frames  */
> > +
> > +#define VPP_ZERO_MEMORY(VAR){ memset(, 0, sizeof(VAR));
> }
> 
> I don't think this is more readable, but that may only be me.
> 
> > +#define VPP_ALIGN16(value)  (((value + 15) >> 4) << 4)
> //
> > round up to a multiple of 16 +#define VPP_ALIGN32(value)
> (((value
> > + 31) >> 5) << 5)  // round up to a multiple of 32 +#define
> 
> Isn't this FFALIGN()?
> 
> > VPP_CHECK_POINTER(P, ...)   {if (!(P)) {return __VA_ARGS__;}} +
> > +// number of video enhancement filters (denoise, procamp, detail,
> > video_analysis, image stab) +#define ENH_FILTERS_COUNT   5
> > +
> > +typedef struct {
> > +const AVClass *class;
> > +
> > +AVFilterContext *ctx;
> > +
> > +mfxSession session;
> > +QSVSession internal_qs;
> >

Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter

2015-10-22 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Hendrik Leppkes
> Gesendet: Donnerstag, 22. Oktober 2015 14:00
> An: FFmpeg development discussions and patches
> Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter
> 
> On Thu, Oct 22, 2015 at 1:29 PM, Sven Dueking <s...@nablet.com> wrote:
> >
> >
> >> -Ursprüngliche Nachricht-
> >> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im
> Auftrag
> >> von Carl Eugen Hoyos
> >> Gesendet: Mittwoch, 14. Oktober 2015 12:43
> >> An: FFmpeg development discussions and patches
> >> Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter
> >>
> >> On Wednesday 14 October 2015 10:07:04 am Sven Dueking wrote:
> >> > Hi all,
> >> >
> >> > The attached patches adds the VPP as filter module to FFMpeg.
> >> > Looking forward to get feedback.
> >>
> >> Just a few comments, I expect you will get a comment explaining what
> >> you can't do;-) (Sorry for the partly broken quotation.)
> >>
> >> In any case, please merge both patches, they are not independent.
> >>
> >> >
> >> > Many thanks,
> >> > Sven
> >>
> >> > From d09cff6d868bd2a0fd87e3906f8808638809494b Mon Sep 17 00:00:00
> >> 2001
> >> > From: Sven Dueking <s...@nablet.com>
> >> > Date: Wed, 14 Oct 2015 08:13:38 +0100
> >> > Subject: [PATCH 1/2] added QSV based VPP filter
> >> >
> >> > ---
> >> >  libavfilter/vf_qsv_vpp.c | 686
> >> > +++ 1 file changed,
> 686
> >> > insertions(+)
> >> >  create mode 100644 libavfilter/vf_qsv_vpp.c
> >> >
> >> > diff --git a/libavfilter/vf_qsv_vpp.c b/libavfilter/vf_qsv_vpp.c
> >> > new file mode 100644 index 000..629913e
> >> > --- /dev/null
> >> > +++ b/libavfilter/vf_qsv_vpp.c
> >> > @@ -0,0 +1,686 @@
> >> > +/*
> >> > + * Intel MediaSDK Quick Sync Video VPP filter
> >> > + *
> >> > + * copyright (c) 2015 Sven Dueking
> >> > + *
> >> > + * This file is part of FFmpeg.
> >> > + *
> >> > + * Libav is free software; you can redistribute it and/or
> >> > + * modify it under the terms of the GNU Lesser General Public
> >> > + * License as published by the Free Software Foundation; either
> >> > + * version 2.1 of the License, or (at your option) any later
> >> version.
> >> > + *
> >> > + * Libav is distributed in the hope that it will be useful,
> >> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> >> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> >> > + GNU
> >> > + * Lesser General Public License for more details.
> >> > + *
> >> > + * You should have received a copy of the GNU Lesser General
> >> > + Public
> >> > + * License along with Libav; if not, write to the Free Software
> >> > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> >> > 02110-1301 USA + */
> >> > +
> >> > +#include 
> >> > +#include 
> >> > +
> >> > +#include "avfilter.h"
> >> > +#include "internal.h"
> >> > +#include "formats.h"
> >> > +
> >> > +#include "libavutil/avassert.h"
> >> > +#include "libavutil/opt.h"
> >> > +#include "libavutil/time.h"
> >> > +#include "libavutil/avstring.h"
> >> > +#include "libavutil/error.h"
> >> > +#include "libavcodec/avcodec.h"
> >> > +#include "libavcodec/qsv_internal.h"
> >> > +
> >> > +#include 
> >> > +
> >> > +#include "avfilter.h"
> >> > +#include "formats.h"
> >> > +#include "internal.h"
> >> > +#include "video.h"
> >> > +#include "libavutil/eval.h"
> >> > +#include "libavutil/avstring.h"
> >> > +#include "libavutil/internal.h"
> >> > +#include "libavutil/libm.h"
> >> > +#include "libavutil/imgutils.h"
> >> > +#include "libavutil/mathematics.h"
> >> > +#include "libavu

Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter

2015-10-22 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Michael Niedermayer
> Gesendet: Donnerstag, 22. Oktober 2015 17:39
> An: FFmpeg development discussions and patches
> Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter
> 
> On Wed, Oct 21, 2015 at 11:26:30AM +0200, Sven Dueking wrote:
> >
> >
> > > -Ursprüngliche Nachricht-
> > > Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im
> > > Auftrag von Moritz Barsnick
> > > Gesendet: Mittwoch, 14. Oktober 2015 11:23
> > > An: FFmpeg development discussions and patches
> > > Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter
> > >
> > > On Wed, Oct 14, 2015 at 10:07:04 +0200, Sven Dueking wrote:
> > > > The attached patches adds the VPP as filter module to FFMpeg.
> > > > Looking forward to get feedback.
> > >
> > > doc/filters.texi?
> > >
> > > (Sorry, those who know what vpp is might get along fine with this,
> > > but I couldn't even quicky find out...)
> >
> > Hi Moritz,
> >
> > Documentation attached. Is it ok to provide this as separate file ?
> 
> Please always provide "git am" compatible patches with commit message
> and author.
> Also Documentation should be added by the same patch that adds the code
> to be documented unless that was already commited (thats not critical
> but preferred)
> 
> Thanks
> 

OK, thanks.
> 
> >
> > Thanks for checking.
> >
> > Best,
> > Sven
> > >
> > > Moritz
> > > ___
> > > 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
> 
> 
> --
> 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

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


Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter

2015-10-22 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Hendrik Leppkes
> Gesendet: Donnerstag, 22. Oktober 2015 14:26
> An: FFmpeg development discussions and patches
> Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter
> 
> On Thu, Oct 22, 2015 at 2:20 PM, Sven Dueking <s...@nablet.com> wrote:
> >
> >
> >> -Ursprüngliche Nachricht-
> >> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im
> Auftrag
> >> von Sven Dueking
> >> Gesendet: Donnerstag, 22. Oktober 2015 14:03
> >> An: 'FFmpeg development discussions and patches'
> >> Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter
> >>
> >>
> >>
> >> > -Ursprüngliche Nachricht-
> >> > Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im
> >> > Auftrag von Hendrik Leppkes
> >> > Gesendet: Donnerstag, 22. Oktober 2015 14:00
> >> > An: FFmpeg development discussions and patches
> >> > Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter
> >> >
> >> > On Thu, Oct 22, 2015 at 1:29 PM, Sven Dueking <s...@nablet.com>
> >> wrote:
> >> > >
> >> > >
> >> > >> -Ursprüngliche Nachricht-
> >> > >> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im
> >> > Auftrag
> >> > >> von Carl Eugen Hoyos
> >> > >> Gesendet: Mittwoch, 14. Oktober 2015 12:43
> >> > >> An: FFmpeg development discussions and patches
> >> > >> Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter
> >> > >>
> >> > >> On Wednesday 14 October 2015 10:07:04 am Sven Dueking wrote:
> >> > >> > Hi all,
> >> > >> >
> >> > >> > The attached patches adds the VPP as filter module to FFMpeg.
> >> > >> > Looking forward to get feedback.
> >> > >>
> >> > >> Just a few comments, I expect you will get a comment explaining
> >> > >> what you can't do;-) (Sorry for the partly broken quotation.)
> >> > >>
> >> > >> In any case, please merge both patches, they are not
> independent.
> >> > >>
> >> > >> >
> >> > >> > Many thanks,
> >> > >> > Sven
> >> > >>
> >> > >> > From d09cff6d868bd2a0fd87e3906f8808638809494b Mon Sep 17
> >> 00:00:00
> >> > >> 2001
> >> > >> > From: Sven Dueking <s...@nablet.com>
> >> > >> > Date: Wed, 14 Oct 2015 08:13:38 +0100
> >> > >> > Subject: [PATCH 1/2] added QSV based VPP filter
> >> > >> >
> >> > >> > ---
> >> > >> >  libavfilter/vf_qsv_vpp.c | 686
> >> > >> > +++ 1 file
> >> > >> > +++ changed,
> >> > 686
> >> > >> > insertions(+)
> >> > >> >  create mode 100644 libavfilter/vf_qsv_vpp.c
> >> > >> >
> >> > >> > diff --git a/libavfilter/vf_qsv_vpp.c
> >> > >> > b/libavfilter/vf_qsv_vpp.c new file mode 100644 index
> >> > >> > 000..629913e
> >> > >> > --- /dev/null
> >> > >> > +++ b/libavfilter/vf_qsv_vpp.c
> >> > >> > @@ -0,0 +1,686 @@
> >> > >> > +/*
> >> > >> > + * Intel MediaSDK Quick Sync Video VPP filter
> >> > >> > + *
> >> > >> > + * copyright (c) 2015 Sven Dueking
> >> > >> > + *
> >> > >> > + * This file is part of FFmpeg.
> >> > >> > + *
> >> > >> > + * Libav is free software; you can redistribute it and/or
> >> > >> > + * modify it under the terms of the GNU Lesser General
> Public
> >> > >> > + * License as published by the Free Software Foundation;
> >> > >> > +either
> >> > >> > + * version 2.1 of the License, or (at your option) any later
> >> > >> version.
> >> > >> > + *
> >> > >> > + * Libav is distributed in the hope that it will be useful,
> >> > >> > + * but WITHOUT ANY WARRANTY; without even 

Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter

2015-10-22 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Sven Dueking
> Gesendet: Donnerstag, 22. Oktober 2015 14:03
> An: 'FFmpeg development discussions and patches'
> Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter
> 
> 
> 
> > -Ursprüngliche Nachricht-
> > Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> > von Hendrik Leppkes
> > Gesendet: Donnerstag, 22. Oktober 2015 14:00
> > An: FFmpeg development discussions and patches
> > Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter
> >
> > On Thu, Oct 22, 2015 at 1:29 PM, Sven Dueking <s...@nablet.com>
> wrote:
> > >
> > >
> > >> -Ursprüngliche Nachricht-
> > >> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im
> > Auftrag
> > >> von Carl Eugen Hoyos
> > >> Gesendet: Mittwoch, 14. Oktober 2015 12:43
> > >> An: FFmpeg development discussions and patches
> > >> Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter
> > >>
> > >> On Wednesday 14 October 2015 10:07:04 am Sven Dueking wrote:
> > >> > Hi all,
> > >> >
> > >> > The attached patches adds the VPP as filter module to FFMpeg.
> > >> > Looking forward to get feedback.
> > >>
> > >> Just a few comments, I expect you will get a comment explaining
> > >> what you can't do;-) (Sorry for the partly broken quotation.)
> > >>
> > >> In any case, please merge both patches, they are not independent.
> > >>
> > >> >
> > >> > Many thanks,
> > >> > Sven
> > >>
> > >> > From d09cff6d868bd2a0fd87e3906f8808638809494b Mon Sep 17
> 00:00:00
> > >> 2001
> > >> > From: Sven Dueking <s...@nablet.com>
> > >> > Date: Wed, 14 Oct 2015 08:13:38 +0100
> > >> > Subject: [PATCH 1/2] added QSV based VPP filter
> > >> >
> > >> > ---
> > >> >  libavfilter/vf_qsv_vpp.c | 686
> > >> > +++ 1 file changed,
> > 686
> > >> > insertions(+)
> > >> >  create mode 100644 libavfilter/vf_qsv_vpp.c
> > >> >
> > >> > diff --git a/libavfilter/vf_qsv_vpp.c b/libavfilter/vf_qsv_vpp.c
> > >> > new file mode 100644 index 000..629913e
> > >> > --- /dev/null
> > >> > +++ b/libavfilter/vf_qsv_vpp.c
> > >> > @@ -0,0 +1,686 @@
> > >> > +/*
> > >> > + * Intel MediaSDK Quick Sync Video VPP filter
> > >> > + *
> > >> > + * copyright (c) 2015 Sven Dueking
> > >> > + *
> > >> > + * This file is part of FFmpeg.
> > >> > + *
> > >> > + * Libav is free software; you can redistribute it and/or
> > >> > + * modify it under the terms of the GNU Lesser General Public
> > >> > + * License as published by the Free Software Foundation; either
> > >> > + * version 2.1 of the License, or (at your option) any later
> > >> version.
> > >> > + *
> > >> > + * Libav is distributed in the hope that it will be useful,
> > >> > + * but WITHOUT ANY WARRANTY; without even the implied warranty
> > >> > + of
> > >> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
> the
> > >> > + GNU
> > >> > + * Lesser General Public License for more details.
> > >> > + *
> > >> > + * You should have received a copy of the GNU Lesser General
> > >> > + Public
> > >> > + * License along with Libav; if not, write to the Free Software
> > >> > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
> MA
> > >> > 02110-1301 USA + */
> > >> > +
> > >> > +#include 
> > >> > +#include 
> > >> > +
> > >> > +#include "avfilter.h"
> > >> > +#include "internal.h"
> > >> > +#include "formats.h"
> > >> > +
> > >> > +#include "libavutil/avassert.h"
> > >> > +#include "libavutil/opt.h"
> > >> > +#include "libavutil/time.h"
> > >> > +#include "libavutil/avstring.h"
> > >> > +#include "libavutil/error.h&q

Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter

2015-10-21 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Moritz Barsnick
> Gesendet: Mittwoch, 14. Oktober 2015 11:23
> An: FFmpeg development discussions and patches
> Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter
> 
> On Wed, Oct 14, 2015 at 10:07:04 +0200, Sven Dueking wrote:
> > The attached patches adds the VPP as filter module to FFMpeg.
> > Looking forward to get feedback.
> 
> doc/filters.texi?
> 
> (Sorry, those who know what vpp is might get along fine with this, but
> I couldn't even quicky find out...)

Hi Moritz,

Documentation attached. Is it ok to provide this as separate file ? 

Thanks for checking.

Best,
Sven
> 
> Moritz
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


ffmpeg-qsv_vpp.texi
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter

2015-10-14 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Carl Eugen Hoyos
> Gesendet: Mittwoch, 14. Oktober 2015 12:43
> An: FFmpeg development discussions and patches
> Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter
> 
> On Wednesday 14 October 2015 10:07:04 am Sven Dueking wrote:
> > Hi all,
> >
> > The attached patches adds the VPP as filter module to FFMpeg.
> > Looking forward to get feedback.
> 
> Just a few comments, I expect you will get a comment explaining what
> you can't do;-) (Sorry for the partly broken quotation.)
> 
> In any case, please merge both patches, they are not independent.
> 
> >
> > Many thanks,
> > Sven
> 
> > From d09cff6d868bd2a0fd87e3906f8808638809494b Mon Sep 17 00:00:00
> 2001
> > From: Sven Dueking <s...@nablet.com>
> > Date: Wed, 14 Oct 2015 08:13:38 +0100
> > Subject: [PATCH 1/2] added QSV based VPP filter
> >
> > ---
> >  libavfilter/vf_qsv_vpp.c | 686
> > +++ 1 file changed, 686
> > insertions(+)
> >  create mode 100644 libavfilter/vf_qsv_vpp.c
> >
> > diff --git a/libavfilter/vf_qsv_vpp.c b/libavfilter/vf_qsv_vpp.c new
> > file mode 100644 index 000..629913e
> > --- /dev/null
> > +++ b/libavfilter/vf_qsv_vpp.c
> > @@ -0,0 +1,686 @@
> > +/*
> > + * Intel MediaSDK Quick Sync Video VPP filter
> > + *
> > + * copyright (c) 2015 Sven Dueking
> > + *
> > + * This file is part of FFmpeg.
> > + *
> > + * Libav is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU Lesser General Public
> > + * License as published by the Free Software Foundation; either
> > + * version 2.1 of the License, or (at your option) any later
> version.
> > + *
> > + * Libav is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> > + * Lesser General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU Lesser General Public
> > + * License along with Libav; if not, write to the Free Software
> > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> > 02110-1301 USA + */
> > +
> > +#include 
> > +#include 
> > +
> > +#include "avfilter.h"
> > +#include "internal.h"
> > +#include "formats.h"
> > +
> > +#include "libavutil/avassert.h"
> > +#include "libavutil/opt.h"
> > +#include "libavutil/time.h"
> > +#include "libavutil/avstring.h"
> > +#include "libavutil/error.h"
> > +#include "libavcodec/avcodec.h"
> > +#include "libavcodec/qsv_internal.h"
> > +
> > +#include 
> > +
> > +#include "avfilter.h"
> > +#include "formats.h"
> > +#include "internal.h"
> > +#include "video.h"
> > +#include "libavutil/eval.h"
> > +#include "libavutil/avstring.h"
> > +#include "libavutil/internal.h"
> > +#include "libavutil/libm.h"
> > +#include "libavutil/imgutils.h"
> > +#include "libavutil/mathematics.h"
> > +#include "libavutil/opt.h"
> > +#include "libavutil/pixfmt.h"
> 
> Are they all necessary?
> 
> > +
> > +/**
> > + * ToDo :
> > + *
> > + * - handle empty extbuffers
> > + * - cropping
> > + * - allocate number of surfaces depending modules and number of b
> > +frames  */
> > +
> > +#define VPP_ZERO_MEMORY(VAR){ memset(, 0, sizeof(VAR));
> }
> 
> I don't think this is more readable, but that may only be me.
> 
> > +#define VPP_ALIGN16(value)  (((value + 15) >> 4) << 4)
> //
> > round up to a multiple of 16 +#define VPP_ALIGN32(value)
> (((value
> > + 31) >> 5) << 5)  // round up to a multiple of 32 +#define
> 
> Isn't this FFALIGN()?
> 
> > VPP_CHECK_POINTER(P, ...)   {if (!(P)) {return __VA_ARGS__;}} +
> > +// number of video enhancement filters (denoise, procamp, detail,
> > video_analysis, image stab) +#define ENH_FILTERS_COUNT   5
> > +
> > +typedef struct {
> > +const AVClass *class;
> > +
> > +AVFilterContext *ctx;
> > +
> > +mfxSession session;
> > +QSVSession internal_qs;
> >

Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter

2015-10-14 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Carl Eugen Hoyos
> Gesendet: Mittwoch, 14. Oktober 2015 14:41
> An: ffmpeg-devel@ffmpeg.org
> Betreff: Re: [FFmpeg-devel] [PATCH] Added QSV based VPP filter
> 
> Carl Eugen Hoyos  ag.or.at> writes:
> 
> > > +AV_PIX_FMT_RGB32 ,
> >
> > Trailing whitespace that cannot be committed to our repo,
> 
> There is no trailing whitespace, just an (unintended?) whitespace,
> sorry.
> 
> > please use tools/patcheck.
> 
> This is still a good idea!

Agree :)

> 
> Carl Eugen
> 
> ___
> 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] qsvenc.c: use query function to catch all kind of setting issues

2015-10-01 Thread Sven Dueking


> -Ursprüngliche Nachricht-
> Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> von Michael Niedermayer
> Gesendet: Mittwoch, 30. September 2015 22:47
> An: FFmpeg development discussions and patches
> Betreff: Re: [FFmpeg-devel] [PATCH] qsvenc.c: use query function to
> catch all kind of setting issues
> 
> On Wed, Sep 30, 2015 at 04:19:15PM +0200, Sven Dueking wrote:
> > From 86ddf1095bfd557324f6eeb24d94cbd0a6818c10 Mon Sep 17 00:00:00
> 2001
> > From: Sven Dueking <s...@nablet.com>
> > Date: Wed, 30 Sep 2015 16:06:02 +0200
> > Subject: [FFmpeg-devel] [PATCH] qsvenc.c: use query function to catch
> > all kind of setting issues
> >
> > ---
> >  libavcodec/qsvenc.c | 8 
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index
> > 1013fe1..55140e1 100644
> > --- a/libavcodec/qsvenc.c
> > +++ b/libavcodec/qsvenc.c
> > @@ -264,6 +264,14 @@ int ff_qsv_enc_init(AVCodecContext *avctx,
> > QSVEncContext *q)
> >  if (ret < 0)
> >  return ret;
> >
> > +ret = MFXVideoENCODE_Query(q->session, >param,>param);
> > +if (MFX_WRN_PARTIAL_ACCELERATION==ret) {
> > +av_log(avctx, AV_LOG_WARNING, "Encoder will work with
> partial
> > + HW
> > acceleration\n");
> > +} else if (ret < 0) {
> 
> Applying: qsvenc.c: use query function to catch all kind of setting
> issues
> fatal: corrupt patch at line 10

Sorry, no idea what went wrong ... anyway - patch attached.

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


0001-use-query-to-catch-all-kind-of-setting-issues.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] qsvenc.c: use query function to catch all kind of setting issues

2015-09-30 Thread Sven Dueking
From 86ddf1095bfd557324f6eeb24d94cbd0a6818c10 Mon Sep 17 00:00:00 2001
From: Sven Dueking <s...@nablet.com>
Date: Wed, 30 Sep 2015 16:06:02 +0200
Subject: [FFmpeg-devel] [PATCH] qsvenc.c: use query function to catch all
kind of setting issues

---
 libavcodec/qsvenc.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 1013fe1..55140e1 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -264,6 +264,14 @@ int ff_qsv_enc_init(AVCodecContext *avctx,
QSVEncContext *q)
 if (ret < 0)
 return ret;
 
+ret = MFXVideoENCODE_Query(q->session, >param,>param);
+if (MFX_WRN_PARTIAL_ACCELERATION==ret) {
+av_log(avctx, AV_LOG_WARNING, "Encoder will work with partial HW
acceleration\n");
+} else if (ret < 0) {
+av_log(avctx, AV_LOG_ERROR, "Error %d querying encoder params\n",
ret);
+return ff_qsv_error(ret);
+}
+
 ret = MFXVideoENCODE_QueryIOSurf(q->session, >param, >req);
 if (ret < 0) {
 av_log(avctx, AV_LOG_ERROR, "Error querying the encoding
parameters\n");
-- 
1.9.5.msysgit.1


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


Re: [FFmpeg-devel] [PATCH] QSV : Added look ahead rate control mode

2015-08-27 Thread Sven Dueking
 -Ursprüngliche Nachricht-
 Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
 von Sven Dueking
 Gesendet: Freitag, 21. August 2015 10:18
 An: ffmpeg-devel@ffmpeg.org
 Cc: Sven Dueking
 Betreff: [FFmpeg-devel] [PATCH] QSV : Added look ahead rate control
 mode
 
 From: Sven Dueking s...@nablet.com
 
 ---
  libavcodec/qsvenc.c  | 31 +--
  libavcodec/qsvenc.h  |  8 
  libavcodec/qsvenc_h264.c | 12 
  3 files changed, 49 insertions(+), 2 deletions(-)
 
 diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index
 1532258..1aeab03 100644
 --- a/libavcodec/qsvenc.c
 +++ b/libavcodec/qsvenc.c
 @@ -107,8 +107,16 @@ static int init_video_param(AVCodecContext *avctx,
 QSVEncContext *q)
  q-param.mfx.RateControlMethod = MFX_RATECONTROL_CBR;
  ratecontrol_desc = constant bitrate (CBR);
  } else if (!avctx-rc_max_rate) {
 -q-param.mfx.RateControlMethod = MFX_RATECONTROL_AVBR;
 -ratecontrol_desc = average variable bitrate (AVBR);
 +#if QSV_VERSION_ATLEAST(1,7)
 +if (q-look_ahead) {
 +q-param.mfx.RateControlMethod = MFX_RATECONTROL_LA;
 +ratecontrol_desc = lookahead (LA);
 +} else
 +#endif
 +{
 +q-param.mfx.RateControlMethod = MFX_RATECONTROL_AVBR;
 +ratecontrol_desc = average variable bitrate (AVBR);
 +}
  } else {
  q-param.mfx.RateControlMethod = MFX_RATECONTROL_VBR;
  ratecontrol_desc = variable bitrate (VBR); @@ -132,6 +140,9
 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
 
  break;
  case MFX_RATECONTROL_AVBR:
 +#if QSV_VERSION_ATLEAST(1,7)
 +case MFX_RATECONTROL_LA:
 +#endif
  q-param.mfx.TargetKbps  = avctx-bit_rate / 1000;
  q-param.mfx.Convergence = q-avbr_convergence;
  q-param.mfx.Accuracy= q-avbr_accuracy;
 @@ -151,6 +162,22 @@ static int init_video_param(AVCodecContext *avctx,
 QSVEncContext *q)
 
  q-extparam[0] = (mfxExtBuffer *)q-extco;
 
 +#if QSV_VERSION_ATLEAST(1,6)
 +q-extco2.Header.BufferId  = MFX_EXTBUFF_CODING_OPTION2;
 +q-extco2.Header.BufferSz  = sizeof(q-extco2);
 +
 +#if QSV_VERSION_ATLEAST(1,7)
 +// valid value range is from 10 to 100 inclusive
 +// to instruct the encoder to use the default value this
 should be set to zero
 +q-extco2.LookAheadDepth= q-look_ahead_depth != 0 ?
 FFMAX(10, q-look_ahead_depth) : 0;
 +#endif
 +#if QSV_VERSION_ATLEAST(1,8)
 +q-extco2.LookAheadDS   = q-look_ahead_downsampling;
 +#endif
 +
 +q-extparam[1] = (mfxExtBuffer *)q-extco2;
 +
 +#endif
  q-param.ExtParam= q-extparam;
  q-param.NumExtParam = FF_ARRAY_ELEMS(q-extparam);
  }
 diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h index
 2316488..2a21f82 100644
 --- a/libavcodec/qsvenc.h
 +++ b/libavcodec/qsvenc.h
 @@ -50,7 +50,12 @@ typedef struct QSVEncContext {
  mfxFrameAllocRequest req;
 
  mfxExtCodingOption  extco;
 +#if QSV_VERSION_ATLEAST(1,6)
 +mfxExtCodingOption2 extco2;
 +mfxExtBuffer *extparam[2];
 +#else
  mfxExtBuffer *extparam[1];
 +#endif
 
  AVFifoBuffer *async_fifo;
 
 @@ -62,6 +67,9 @@ typedef struct QSVEncContext {
  int avbr_accuracy;
  int avbr_convergence;
  int pic_timing_sei;
 +int look_ahead;
 +int look_ahead_depth;
 +int look_ahead_downsampling;
 
  char *load_plugins;
  } QSVEncContext;
 diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c index
 b15f6b2..b569efe 100644
 --- a/libavcodec/qsvenc_h264.c
 +++ b/libavcodec/qsvenc_h264.c
 @@ -71,6 +71,18 @@ static const AVOption options[] = {
  { avbr_convergence, Convergence of the AVBR ratecontrol,
 OFFSET(qsv.avbr_convergence), AV_OPT_TYPE_INT, { .i64 = 0 }, 0,
 INT_MAX, VE },
  { pic_timing_sei,Insert picture timing SEI with
 pic_struct_syntax element, OFFSET(qsv.pic_timing_sei),
 AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
 
 +#if QSV_VERSION_ATLEAST(1,7)
 +{ look_ahead,   Use VBR algorithm with look ahead,
 OFFSET(qsv.look_ahead),   AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE
 },
 +{ look_ahead_depth, Depth of look ahead in number frames,
 +OFFSET(qsv.look_ahead_depth), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 100,
 VE
 +}, #endif
 +
 +#if QSV_VERSION_ATLEAST(1,8)
 +{ look_ahead_downsampling, NULL,
 OFFSET(qsv.look_ahead_downsampling), AV_OPT_TYPE_INT, { .i64 =
 MFX_LOOKAHEAD_DS_UNKNOWN }, MFX_LOOKAHEAD_DS_UNKNOWN,
 MFX_LOOKAHEAD_DS_2x, VE, look_ahead_downsampling },
 +{ unknown, NULL, 0, AV_OPT_TYPE_CONST, { .i64 =
 MFX_LOOKAHEAD_DS_UNKNOWN }, INT_MIN, INT_MAX, VE,
 look_ahead_downsampling },
 +{ off, NULL, 0, AV_OPT_TYPE_CONST, { .i64 =
 MFX_LOOKAHEAD_DS_OFF }, INT_MIN, INT_MAX, VE,
 look_ahead_downsampling },
 +{ 2x , NULL, 0, AV_OPT_TYPE_CONST, { .i64

[FFmpeg-devel] [PATCH] QSV : Added look ahead rate control mode

2015-08-21 Thread Sven Dueking
From: Sven Dueking s...@nablet.com

---
 libavcodec/qsvenc.c  | 31 +--
 libavcodec/qsvenc.h  |  8 
 libavcodec/qsvenc_h264.c | 12 
 3 files changed, 49 insertions(+), 2 deletions(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 1532258..1aeab03 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -107,8 +107,16 @@ static int init_video_param(AVCodecContext *avctx, 
QSVEncContext *q)
 q-param.mfx.RateControlMethod = MFX_RATECONTROL_CBR;
 ratecontrol_desc = constant bitrate (CBR);
 } else if (!avctx-rc_max_rate) {
-q-param.mfx.RateControlMethod = MFX_RATECONTROL_AVBR;
-ratecontrol_desc = average variable bitrate (AVBR);
+#if QSV_VERSION_ATLEAST(1,7)
+if (q-look_ahead) {
+q-param.mfx.RateControlMethod = MFX_RATECONTROL_LA;
+ratecontrol_desc = lookahead (LA);
+} else
+#endif
+{
+q-param.mfx.RateControlMethod = MFX_RATECONTROL_AVBR;
+ratecontrol_desc = average variable bitrate (AVBR);
+}
 } else {
 q-param.mfx.RateControlMethod = MFX_RATECONTROL_VBR;
 ratecontrol_desc = variable bitrate (VBR);
@@ -132,6 +140,9 @@ static int init_video_param(AVCodecContext *avctx, 
QSVEncContext *q)
 
 break;
 case MFX_RATECONTROL_AVBR:
+#if QSV_VERSION_ATLEAST(1,7)
+case MFX_RATECONTROL_LA:
+#endif
 q-param.mfx.TargetKbps  = avctx-bit_rate / 1000;
 q-param.mfx.Convergence = q-avbr_convergence;
 q-param.mfx.Accuracy= q-avbr_accuracy;
@@ -151,6 +162,22 @@ static int init_video_param(AVCodecContext *avctx, 
QSVEncContext *q)
 
 q-extparam[0] = (mfxExtBuffer *)q-extco;
 
+#if QSV_VERSION_ATLEAST(1,6)
+q-extco2.Header.BufferId  = MFX_EXTBUFF_CODING_OPTION2;
+q-extco2.Header.BufferSz  = sizeof(q-extco2);
+
+#if QSV_VERSION_ATLEAST(1,7)
+// valid value range is from 10 to 100 inclusive
+// to instruct the encoder to use the default value this should be set 
to zero
+q-extco2.LookAheadDepth= q-look_ahead_depth != 0 ? FFMAX(10, 
q-look_ahead_depth) : 0;
+#endif
+#if QSV_VERSION_ATLEAST(1,8)
+q-extco2.LookAheadDS   = q-look_ahead_downsampling;
+#endif
+
+q-extparam[1] = (mfxExtBuffer *)q-extco2;
+
+#endif
 q-param.ExtParam= q-extparam;
 q-param.NumExtParam = FF_ARRAY_ELEMS(q-extparam);
 }
diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
index 2316488..2a21f82 100644
--- a/libavcodec/qsvenc.h
+++ b/libavcodec/qsvenc.h
@@ -50,7 +50,12 @@ typedef struct QSVEncContext {
 mfxFrameAllocRequest req;
 
 mfxExtCodingOption  extco;
+#if QSV_VERSION_ATLEAST(1,6)
+mfxExtCodingOption2 extco2;
+mfxExtBuffer *extparam[2];
+#else
 mfxExtBuffer *extparam[1];
+#endif
 
 AVFifoBuffer *async_fifo;
 
@@ -62,6 +67,9 @@ typedef struct QSVEncContext {
 int avbr_accuracy;
 int avbr_convergence;
 int pic_timing_sei;
+int look_ahead;
+int look_ahead_depth;
+int look_ahead_downsampling;
 
 char *load_plugins;
 } QSVEncContext;
diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
index b15f6b2..b569efe 100644
--- a/libavcodec/qsvenc_h264.c
+++ b/libavcodec/qsvenc_h264.c
@@ -71,6 +71,18 @@ static const AVOption options[] = {
 { avbr_convergence, Convergence of the AVBR ratecontrol, 
OFFSET(qsv.avbr_convergence), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
 { pic_timing_sei,Insert picture timing SEI with pic_struct_syntax 
element, OFFSET(qsv.pic_timing_sei), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
 
+#if QSV_VERSION_ATLEAST(1,7)
+{ look_ahead,   Use VBR algorithm with look ahead,
OFFSET(qsv.look_ahead),   AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
+{ look_ahead_depth, Depth of look ahead in number frames, 
OFFSET(qsv.look_ahead_depth), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 100, VE },
+#endif
+
+#if QSV_VERSION_ATLEAST(1,8)
+{ look_ahead_downsampling, NULL, OFFSET(qsv.look_ahead_downsampling), 
AV_OPT_TYPE_INT, { .i64 = MFX_LOOKAHEAD_DS_UNKNOWN }, MFX_LOOKAHEAD_DS_UNKNOWN, 
MFX_LOOKAHEAD_DS_2x, VE, look_ahead_downsampling },
+{ unknown, NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 
MFX_LOOKAHEAD_DS_UNKNOWN }, INT_MIN, INT_MAX, VE, look_ahead_downsampling 
},
+{ off, NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 
MFX_LOOKAHEAD_DS_OFF }, INT_MIN, INT_MAX, VE, look_ahead_downsampling 
},
+{ 2x , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 
MFX_LOOKAHEAD_DS_2x  }, INT_MIN, INT_MAX, VE, look_ahead_downsampling 
},
+#endif
+
 { profile, NULL, OFFSET(qsv.profile), AV_OPT_TYPE_INT, { .i64 = 
MFX_PROFILE_UNKNOWN }, 0, INT_MAX, VE, profile },
 { unknown , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_UNKNOWN 
 }, INT_MIN, INT_MAX, VE, profile },
 { baseline, NULL, 0, AV_OPT_TYPE_CONST, { .i64

Re: [FFmpeg-devel] [PATCH] Added PicTiming SEI

2015-08-19 Thread Sven Dueking


 -Ursprüngliche Nachricht-
 Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
 von Michael Niedermayer
 Gesendet: Mittwoch, 19. August 2015 13:51
 An: FFmpeg development discussions and patches
 Betreff: Re: [FFmpeg-devel] [PATCH] Added PicTiming SEI
 
 On Wed, Aug 19, 2015 at 09:17:40AM +0100, Sven Dueking wrote:
  From: Sven Dueking s...@nablet.com
 
  ---
   libavcodec/qsvenc.c  | 3 +++
   libavcodec/qsvenc.h  | 1 +
   libavcodec/qsvenc_h264.c | 1 +
   3 files changed, 5 insertions(+)
 
 applied
 
 thanks

Thanks, I will add a couple of other settings this week, do you prefer a
patch for each setting or is it ok add more than one setting ? 
 
 [...]
 --
 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
 
 The bravest are surely those who have the clearest vision of what is
 before them, glory and danger alike, and yet notwithstanding go out to
 meet it. -- Thucydides

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


[FFmpeg-devel] [PATCH] Added PicTiming SEI

2015-08-19 Thread Sven Dueking
From: Sven Dueking s...@nablet.com

---
 libavcodec/qsvenc.c  | 3 +++
 libavcodec/qsvenc.h  | 1 +
 libavcodec/qsvenc_h264.c | 1 +
 3 files changed, 5 insertions(+)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 57f5fe4..6f97240 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -146,6 +146,9 @@ static int init_video_param(AVCodecContext *avctx, 
QSVEncContext *q)
 q-extco.CAVLC= avctx-coder_type == FF_CODER_TYPE_VLC 
?
 MFX_CODINGOPTION_ON : 
MFX_CODINGOPTION_UNKNOWN;
 
+q-extco.PicTimingSEI = q-pic_timing_sei ?
+MFX_CODINGOPTION_ON : 
MFX_CODINGOPTION_UNKNOWN;
+
 q-extparam[0] = (mfxExtBuffer *)q-extco;
 
 q-param.ExtParam= q-extparam;
diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
index 19be2aa..2316488 100644
--- a/libavcodec/qsvenc.h
+++ b/libavcodec/qsvenc.h
@@ -61,6 +61,7 @@ typedef struct QSVEncContext {
 int preset;
 int avbr_accuracy;
 int avbr_convergence;
+int pic_timing_sei;
 
 char *load_plugins;
 } QSVEncContext;
diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
index 95396fc..b15f6b2 100644
--- a/libavcodec/qsvenc_h264.c
+++ b/libavcodec/qsvenc_h264.c
@@ -69,6 +69,7 @@ static const AVOption options[] = {
 { idr_interval, Distance (in I-frames) between IDR frames, 
OFFSET(qsv.idr_interval), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
 { avbr_accuracy,Accuracy of the AVBR ratecontrol,
OFFSET(qsv.avbr_accuracy),AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
 { avbr_convergence, Convergence of the AVBR ratecontrol, 
OFFSET(qsv.avbr_convergence), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
+{ pic_timing_sei,Insert picture timing SEI with pic_struct_syntax 
element, OFFSET(qsv.pic_timing_sei), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
 
 { profile, NULL, OFFSET(qsv.profile), AV_OPT_TYPE_INT, { .i64 = 
MFX_PROFILE_UNKNOWN }, 0, INT_MAX, VE, profile },
 { unknown , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_UNKNOWN 
 }, INT_MIN, INT_MAX, VE, profile },
-- 
1.8.3.1

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


[FFmpeg-devel] [PATCH] 0001 - added PicTimingSSEI-libavcodec-qsvenc_h264.c

2015-08-18 Thread Sven Dueking
From: Sven Dueking s...@nablet.com

---
 libavcodec/qsvenc.c  | 3 +++
 libavcodec/qsvenc.h  | 1 +
 libavcodec/qsvenc_h264.c | 1 +
 3 files changed, 5 insertions(+)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index e5d3fa6..52e416c 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -146,6 +146,9 @@ static int init_video_param(AVCodecContext *avctx, 
QSVEncContext *q)
 q-extco.CAVLC= avctx-coder_type == FF_CODER_TYPE_VLC 
?
 MFX_CODINGOPTION_ON : 
MFX_CODINGOPTION_UNKNOWN;
 
+q-extco.PicTimingSEI = q-pic_timing_sei == 1 ?
+   MFX_CODINGOPTION_ON : 
MFX_CODINGOPTION_OFF;
+
 q-extparam[0] = (mfxExtBuffer *)q-extco;
 
 q-param.ExtParam= q-extparam;
diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
index 19be2aa..2316488 100644
--- a/libavcodec/qsvenc.h
+++ b/libavcodec/qsvenc.h
@@ -61,6 +61,7 @@ typedef struct QSVEncContext {
 int preset;
 int avbr_accuracy;
 int avbr_convergence;
+int pic_timing_sei;
 
 char *load_plugins;
 } QSVEncContext;
diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
index 95396fc..bbdaa4d 100644
--- a/libavcodec/qsvenc_h264.c
+++ b/libavcodec/qsvenc_h264.c
@@ -69,6 +69,7 @@ static const AVOption options[] = {
 { idr_interval, Distance (in I-frames) between IDR frames, 
OFFSET(qsv.idr_interval), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
 { avbr_accuracy,Accuracy of the AVBR ratecontrol,
OFFSET(qsv.avbr_accuracy),AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
 { avbr_convergence, Convergence of the AVBR ratecontrol, 
OFFSET(qsv.avbr_convergence), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
+{ pic_timing_sei,Insert picture timing SEI with pic_struct_syntax 
element, OFFSET(qsv.pic_timing_sei), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 
INT_MAX, VE },
 
 { profile, NULL, OFFSET(qsv.profile), AV_OPT_TYPE_INT, { .i64 = 
MFX_PROFILE_UNKNOWN }, 0, INT_MAX, VE, profile },
 { unknown , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_UNKNOWN 
 }, INT_MIN, INT_MAX, VE, profile },
-- 
1.8.3.1

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


Re: [FFmpeg-devel] [PATCH] Changed max bitrate for VBV mode (according to Ivan Uskow)

2015-08-14 Thread Sven Dueking


 -Ursprüngliche Nachricht-
 Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
 von Michael Niedermayer
 Gesendet: Freitag, 14. August 2015 10:32
 An: FFmpeg development discussions and patches
 Betreff: Re: [FFmpeg-devel] [PATCH] Changed max bitrate for VBV mode
 (according to Ivan Uskow)
 
 On Fri, Aug 14, 2015 at 07:37:08AM +0200, Sven Dueking wrote:
 
 
   -Ursprüngliche Nachricht-
   Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im
   Auftrag von Michael Niedermayer
   Gesendet: Donnerstag, 13. August 2015 17:41
   An: FFmpeg development discussions and patches
   Cc: Sven Dueking
   Betreff: Re: [FFmpeg-devel] [PATCH] Changed max bitrate for VBV
 mode
   (according to Ivan Uskow)
  
   On Thu, Aug 13, 2015 at 11:30:45AM +0100, Sven Dueking wrote:
From: Sven Dueking s...@nablet.com
   
---
 libavcodec/qsvenc.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)
   
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index
57f5fe4..b56e4b4 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -118,10 +118,14 @@ static int init_video_param(AVCodecContext
*avctx, QSVEncContext *q)
   
 switch (q-param.mfx.RateControlMethod) {
 case MFX_RATECONTROL_CBR:
+   q-param.mfx.InitialDelayInKB = avctx-
   rc_initial_buffer_occupancy / 1000;
+q-param.mfx.TargetKbps   = avctx-bit_rate / 1000;
+q-param.mfx.MaxKbps  = avctx-bit_rate / 1000;
+break;
 case MFX_RATECONTROL_VBR:
 q-param.mfx.InitialDelayInKB = avctx-
   rc_initial_buffer_occupancy / 1000;
 q-param.mfx.TargetKbps   = avctx-bit_rate / 1000;
-q-param.mfx.MaxKbps  = avctx-bit_rate / 1000;
+q-param.mfx.MaxKbps  = avctx-rc_max_rate /
 1000;
  
   why is rc_max_rate not used for MFX_RATECONTROL_CBR ?
 
  Hi Michael,
 
  Ivan is on vacation and I did the fix according to his last command :
 
  This correct for MFX_RATECONTROL_CBR but a bug for
 MFX_RATECONTROL_VBR.
  Will fixed later. For any case part of ratecontrol setup should be
  re-designed to support more advanced LA rate contol
 
  The Intel Documentation states that :
 
  For variable bitrate control, the MaxKbps parameter specifies the
  maximum bitrate at which the encoded data enters the Video Buffering
  Verifier (VBV) buffer.
 
  And for CBR the target bitrate and max bitrate should be equal to
  archive a bitrate that is near a desired target for streaming (no
  peaks etc.)
 
 In the code there is this:
 
 } else if (avctx-rc_max_rate == avctx-bit_rate) {
 q-param.mfx.RateControlMethod = MFX_RATECONTROL_CBR;
 ratecontrol_desc = constant bitrate (CBR);
 
 assuming thats how CBR is set, the variables are equal and the special
 case is not needed am i missing something ?

No, you are right. I missed that. So max_rate and bit_rate have the same
value..  means you can ignore my patch or keep it for readability.

 
 [...]
 --
 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
 
 The misfortune of the wise is better than the prosperity of the fool.
 -- Epicurus

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


[FFmpeg-devel] Set MaxKpbs to rc_max_rate for CBR and VBR (bitrate is equal to rc_max_rate for CBR)

2015-08-14 Thread Sven Dueking
From ebb8a991dc2f64577266dae66c95131564781a38 Mon Sep 17 00:00:00 2001
From: Sven Dueking s...@nablet.com
Date: Fri, 14 Aug 2015 11:28:00 +0100
Subject: [FFmpeg-devel][PATCH] Set MaxKpbs to rc_max_rate for CBR and VBR
(bitrate is equal
 to rc_max_rate for CBR)

---
 libavcodec/qsvenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 57f5fe4..e5d3fa6 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -121,7 +121,7 @@ static int init_video_param(AVCodecContext *avctx,
QSVEncContext *q)
 case MFX_RATECONTROL_VBR:
 q-param.mfx.InitialDelayInKB = avctx-rc_initial_buffer_occupancy
/ 1000;
 q-param.mfx.TargetKbps   = avctx-bit_rate / 1000;
-q-param.mfx.MaxKbps  = avctx-bit_rate / 1000;
+q-param.mfx.MaxKbps  = avctx-rc_max_rate / 1000;
 break;
 case MFX_RATECONTROL_CQP:
 quant = avctx-global_quality / FF_QP2LAMBDA;
-- 
1.8.3.1


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


[FFmpeg-devel] From: Sven Dueking s...@nablet.com

2015-08-14 Thread Sven Dueking
---
 libavcodec/qsvenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 57f5fe4..af4b5af 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -121,7 +121,7 @@ static int init_video_param(AVCodecContext *avctx, 
QSVEncContext *q)
 case MFX_RATECONTROL_VBR:
 q-param.mfx.InitialDelayInKB = avctx-rc_initial_buffer_occupancy / 
1000;
 q-param.mfx.TargetKbps   = avctx-bit_rate / 1000;
-q-param.mfx.MaxKbps  = avctx-bit_rate / 1000;
+q-param.mfx.MaxKbps  = q-param.mfx.RateControlMethod == 
MFX_RATECONTROL_VBR ? avctx-rc_max_rate / 1000 : avctx-bit_rate / 1000;
 break;
 case MFX_RATECONTROL_CQP:
 quant = avctx-global_quality / FF_QP2LAMBDA;
-- 
1.8.3.1

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


Re: [FFmpeg-devel] From: Sven Dueking s...@nablet.com

2015-08-14 Thread Sven Dueking


 -Ursprüngliche Nachricht-
 Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
 von Michael Niedermayer
 Gesendet: Freitag, 14. August 2015 11:55
 An: FFmpeg development discussions and patches
 Betreff: Re: [FFmpeg-devel] From: Sven Dueking s...@nablet.com
 
 On Fri, Aug 14, 2015 at 10:34:29AM +0100, Sven Dueking wrote:
  ---
   libavcodec/qsvenc.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
 
  diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index
  57f5fe4..af4b5af 100644
  --- a/libavcodec/qsvenc.c
  +++ b/libavcodec/qsvenc.c
  @@ -121,7 +121,7 @@ static int init_video_param(AVCodecContext
 *avctx, QSVEncContext *q)
   case MFX_RATECONTROL_VBR:
   q-param.mfx.InitialDelayInKB = avctx-
 rc_initial_buffer_occupancy / 1000;
   q-param.mfx.TargetKbps   = avctx-bit_rate / 1000;
  -q-param.mfx.MaxKbps  = avctx-bit_rate / 1000;
  +q-param.mfx.MaxKbps  = q-
 param.mfx.RateControlMethod == MFX_RATECONTROL_VBR ? avctx-
 rc_max_rate / 1000 : avctx-bit_rate / 1000;
 
 thats still containing the unneeded CBR special case you can either
 explain why this should be done or remove it
 
 In the code currently MFX_RATECONTROL_CBR implies
 avctx-rc_max_rate == avctx-bit_rate

Correct.

 
 if avctx-rc_max_rate == avctx-bit_rate then either
 avctx-rc_max_rate or avctx-bit_rate can be used interchagable

Correct.

 
 q-param.mfx.MaxKbps = avctx-rc_max_rate
 is the correct code for VBR and CBR

Okay, got it. I should do remove

q-param.mfx.MaxKbps  = avctx-bit_rate / 1000;

and use

q-param.mfx.MaxKbps  = avctx- rc_max_rate / 1000;

for both cases. I will send another patch ...

 
 if rc_max_rate is unequal bit_rate then its not CBR and
 MFX_RATECONTROL_CBR should not be set.

Correct.

 Is any of the statements above wrong, am i missing something ?


Nope, you are right and I should check double check everything the next
time.

 
 
 [...]
 --
 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
 
 Republics decline into democracies and democracies degenerate into
 despotisms. -- Aristotle

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


[FFmpeg-devel] [PATCH] Changed max bitrate for VBV mode (according to Ivan Uskow)

2015-08-13 Thread Sven Dueking
From: Sven Dueking s...@nablet.com

---
 libavcodec/qsvenc.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 57f5fe4..b56e4b4 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -118,10 +118,14 @@ static int init_video_param(AVCodecContext *avctx, 
QSVEncContext *q)
 
 switch (q-param.mfx.RateControlMethod) {
 case MFX_RATECONTROL_CBR:
+   q-param.mfx.InitialDelayInKB = avctx-rc_initial_buffer_occupancy / 
1000;
+q-param.mfx.TargetKbps   = avctx-bit_rate / 1000;
+q-param.mfx.MaxKbps  = avctx-bit_rate / 1000;
+break;
 case MFX_RATECONTROL_VBR:
 q-param.mfx.InitialDelayInKB = avctx-rc_initial_buffer_occupancy / 
1000;
 q-param.mfx.TargetKbps   = avctx-bit_rate / 1000;
-q-param.mfx.MaxKbps  = avctx-bit_rate / 1000;
+q-param.mfx.MaxKbps  = avctx-rc_max_rate / 1000;
 break;
 case MFX_RATECONTROL_CQP:
 quant = avctx-global_quality / FF_QP2LAMBDA;
-- 
1.8.3.1

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


[FFmpeg-devel] [PATCH] Changed max bitrate for VBV mode (according to Ivan Uskow)

2015-08-13 Thread Sven Dueking
From: Sven Dueking s...@nablet.com

---
 libavcodec/qsvenc.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 57f5fe4..b56e4b4 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -118,10 +118,14 @@ static int init_video_param(AVCodecContext *avctx, 
QSVEncContext *q)
 
 switch (q-param.mfx.RateControlMethod) {
 case MFX_RATECONTROL_CBR:
+   q-param.mfx.InitialDelayInKB = avctx-rc_initial_buffer_occupancy / 
1000;
+q-param.mfx.TargetKbps   = avctx-bit_rate / 1000;
+q-param.mfx.MaxKbps  = avctx-bit_rate / 1000;
+break;
 case MFX_RATECONTROL_VBR:
 q-param.mfx.InitialDelayInKB = avctx-rc_initial_buffer_occupancy / 
1000;
 q-param.mfx.TargetKbps   = avctx-bit_rate / 1000;
-q-param.mfx.MaxKbps  = avctx-bit_rate / 1000;
+q-param.mfx.MaxKbps  = avctx-rc_max_rate / 1000;
 break;
 case MFX_RATECONTROL_CQP:
 quant = avctx-global_quality / FF_QP2LAMBDA;
-- 
1.8.3.1

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


Re: [FFmpeg-devel] [PATCH] Changed max bitrate for VBV mode (according to Ivan Uskow)

2015-08-13 Thread Sven Dueking


 -Ursprüngliche Nachricht-
 Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
 von Michael Niedermayer
 Gesendet: Donnerstag, 13. August 2015 17:41
 An: FFmpeg development discussions and patches
 Cc: Sven Dueking
 Betreff: Re: [FFmpeg-devel] [PATCH] Changed max bitrate for VBV mode
 (according to Ivan Uskow)
 
 On Thu, Aug 13, 2015 at 11:30:45AM +0100, Sven Dueking wrote:
  From: Sven Dueking s...@nablet.com
 
  ---
   libavcodec/qsvenc.c | 6 +-
   1 file changed, 5 insertions(+), 1 deletion(-)
 
  diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index
  57f5fe4..b56e4b4 100644
  --- a/libavcodec/qsvenc.c
  +++ b/libavcodec/qsvenc.c
  @@ -118,10 +118,14 @@ static int init_video_param(AVCodecContext
  *avctx, QSVEncContext *q)
 
   switch (q-param.mfx.RateControlMethod) {
   case MFX_RATECONTROL_CBR:
  +   q-param.mfx.InitialDelayInKB = avctx-
 rc_initial_buffer_occupancy / 1000;
  +q-param.mfx.TargetKbps   = avctx-bit_rate / 1000;
  +q-param.mfx.MaxKbps  = avctx-bit_rate / 1000;
  +break;
   case MFX_RATECONTROL_VBR:
   q-param.mfx.InitialDelayInKB = avctx-
 rc_initial_buffer_occupancy / 1000;
   q-param.mfx.TargetKbps   = avctx-bit_rate / 1000;
  -q-param.mfx.MaxKbps  = avctx-bit_rate / 1000;
  +q-param.mfx.MaxKbps  = avctx-rc_max_rate / 1000;
 
 why is rc_max_rate not used for MFX_RATECONTROL_CBR ?

Hi Michael,

Ivan is on vacation and I did the fix according to his last command : 

This correct for MFX_RATECONTROL_CBR but a bug for MFX_RATECONTROL_VBR.
Will fixed later. For any case part of ratecontrol setup should be
re-designed to support more advanced LA rate contol

The Intel Documentation states that : 

For variable bitrate control, the MaxKbps parameter specifies the maximum
bitrate at which the encoded data enters the Video Buffering Verifier (VBV)
buffer. 

And for CBR the target bitrate and max bitrate should be equal to archive a
bitrate that is near a desired target for streaming (no peaks etc.)

Btw, sorry for sending the patch twice
 
 [...]
 --
 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
 
 There will always be a question for which you do not know the correct
 answer.

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