Re: [FFmpeg-devel] [PATCH] nvenc: Propagate desired number of reference frames.

2015-01-23 Thread Philip Langdale

On 2015-01-23 01:54, Timo Rothenpieler wrote:
+ctx-encode_config.encodeCodecConfig.h264Config.maxNumRefFrames = 
avctx-refs;


avctx-refs should propably be checked for = 0.

I'm not sure if maxNumRefFrames means the exact same thing as
avctx-refs, but the comment in the nvenc header isn't exactly clear
about that.


nvidia's encoder implementation does this mapping.


This would also forward the ffmpeg default, 1, to nvenc, instead of
the nvenc default, 0, which lets the driver decide what is best. I'm
not sure if this is desireable and how much it affects the quality.


Depends on what your consistency goal is. As long as 0 can be forwarded,
then you can always set it to 0 explicitly to request auto - and you can
argue that ffmpeg consistency (default ref frames of 1 is respected by 
all

encoders) is desirable.

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


Re: [FFmpeg-devel] Question about supported_fps in libavutil/timecode.c::check_fps

2015-01-23 Thread jon morley

Patch attached for consideration.

On 1/23/15 8:03 AM, jon morley wrote:

Currently check_fps has the following logic:

static int check_fps(int fps)
{
 int i;
 static const int supported_fps[] = {24, 25, 30, 48, 50, 60};

 for (i = 0; i  FF_ARRAY_ELEMS(supported_fps); i++)
 if (fps == supported_fps[i])
 return 0;
 return -1;
}

I am starting to see more and more movies with fps rates in excess of
this list from modified GoPro files and other raw camera sources.

I was originally adding more entries as the sources came rolling in
because I could not see any issue in how this was getting called later
with that approach.

I still don't see the drawback of adding more, but I am tired of adding
a new rate every time I encounter one in the wild. I was curious if it
wouldn't make more sense to change the logic to the following:

static int check_fps(int fps)
{
 int i;
 static const int supported_fps_bases[] = {24, 25, 30};

 for (i = 0; i  FF_ARRAY_ELEMS(supported_fps_bases); i++)
 if (fps % supported_fps_bases[i] == 0)
 return 0;
 return -1;
}

If that makes sense to you, then I will submit a patch. Please let me
know if I have overlooked some other usage/meaning of check_fps that I
am overlooking.

Thanks,
Jon
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
From 73e5339ec76305d34214b5e84dc5a38673f784b7 Mon Sep 17 00:00:00 2001
From: Jon Morley j...@tweaksoftware.com
Date: Fri, 23 Jan 2015 08:43:33 -0800
Subject: [PATCH] libavutil/timecode.c: Extend check_fps logic to handle high
 frame rates

QuickTime sources continue to push higher and higher frame rates. This
change moves away from explictly testing incoming fps values towards
ensuring the incoming value is evenly divisable by 24, 25, or 30.
---
 libavutil/timecode.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavutil/timecode.c b/libavutil/timecode.c
index 1dfd040..c10895c 100644
--- a/libavutil/timecode.c
+++ b/libavutil/timecode.c
@@ -141,10 +141,10 @@ char *av_timecode_make_mpeg_tc_string(char *buf, uint32_t 
tc25bit)
 static int check_fps(int fps)
 {
 int i;
-static const int supported_fps[] = {24, 25, 30, 48, 50, 60};
+static const int supported_fps_bases[] = {24, 25, 30};
 
-for (i = 0; i  FF_ARRAY_ELEMS(supported_fps); i++)
-if (fps == supported_fps[i])
+for (i = 0; i  FF_ARRAY_ELEMS(supported_fps_bases); i++)
+if (fps % supported_fps_bases[i] == 0)
 return 0;
 return -1;
 }
-- 
1.8.5.2 (Apple Git-48)

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


[FFmpeg-devel] [PATCH] lavc/libopenjpegenc: move opj_setup_encoder to libopenjpeg_encode_frame

2015-01-23 Thread Jean First
if the openjpeg parameter tcp_rates is not 0 ( using the ffmpeg 
compression_level option ) 
every 2nd image per thread is badly encoded. By moving the opj_setup_encoder 
function from
libopenjpeg_encode_init to libopenjpeg_encode_frame this can be prevented.

This fixes ticket #3754.

Signed-off-by: Jean First jeanfi...@gmail.com
---
 libavcodec/libopenjpegenc.c | 19 ---
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c
index 66633f4..4039663 100644
--- a/libavcodec/libopenjpegenc.c
+++ b/libavcodec/libopenjpegenc.c
@@ -233,14 +233,6 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext 
*avctx)
 err = AVERROR(EINVAL);
 goto fail;
 }
-opj_setup_encoder(ctx-compress, ctx-enc_params, ctx-image);
-
-ctx-stream = opj_cio_open((opj_common_ptr) ctx-compress, NULL, 0);
-if (!ctx-stream) {
-av_log(avctx, AV_LOG_ERROR, Error creating the cio stream\n);
-err = AVERROR(ENOMEM);
-goto fail;
-}
 
 avctx-coded_frame = av_frame_alloc();
 if (!avctx-coded_frame) {
@@ -257,8 +249,6 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext 
*avctx)
 return 0;
 
 fail:
-opj_cio_close(ctx-stream);
-ctx-stream = NULL;
 opj_destroy_compress(ctx-compress);
 ctx-compress = NULL;
 opj_image_destroy(ctx-image);
@@ -569,7 +559,14 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, 
AVPacket *pkt,
 return -1;
 }
 
-cio_seek(stream, 0);
+opj_setup_encoder(compress, ctx-enc_params, image);
+
+stream = opj_cio_open((opj_common_ptr) compress, NULL, 0);
+if (!stream) {
+av_log(avctx, AV_LOG_ERROR, Error creating the cio stream\n);
+return AVERROR(ENOMEM);
+}
+
 if (!opj_encode(compress, stream, image, NULL)) {
 av_log(avctx, AV_LOG_ERROR, Error during the opj encode\n);
 return -1;
-- 
2.2.2

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


Re: [FFmpeg-devel] [PATCH] lavc/libopenjpegenc: move opj_setup_encoder to libopenjpeg_encode_frame

2015-01-23 Thread Michael Niedermayer
On Fri, Jan 23, 2015 at 11:34:35PM +0100, Michael Niedermayer wrote:
 On Fri, Jan 23, 2015 at 09:58:41PM +0100, Jean First wrote:
  if the openjpeg parameter tcp_rates is not 0 ( using the ffmpeg 
  compression_level option ) 
  every 2nd image per thread is badly encoded. By moving the 
  opj_setup_encoder function from
  libopenjpeg_encode_init to libopenjpeg_encode_frame this can be prevented.
  
  This fixes ticket #3754.
 
 how can this be reproduced ?

note, ive tried:
ffmpeg -i matrixbench_mpeg2.mpg -an -compression_level 1 -vframes 30 -threads 1 
-compression_level 1 -vcodec libopenjpeg test.nut

and that results in grayscale only output before as well as after
the patch

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad


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


Re: [FFmpeg-devel] dshow crossbar support PATCH es

2015-01-23 Thread Michael Niedermayer
On Fri, Jan 23, 2015 at 07:06:39AM -0700, Roger Pack wrote:
 OK I have made modifications to the dshow source so that it adds the
 ability to specify capture device by more unique name, capture pin
 by name, crossbar device support [this is basically any capture source
 with multiple inputs--definitely the most requested feature to date]
 and ability to use combined video+audio sources for both video and
 audio.
 It can be found on the github rdp/ffmpeg dshow_crossbar branch
 https://github.com/rdp/ffmpeg/tree/dshow_crossbar
 I'm not sure what the convention is (I was told last time to just
 mention a branch that could be merged?)  Let me know if anything else
 is needed.

as you are the maintainer of the dshow code, nothing else is needed
if you want a dshow branch merged, it will be merged

code merged

thanks

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

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.


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


Re: [FFmpeg-devel] [PATCH] lavc/libopenjpegenc: move opj_setup_encoder to libopenjpeg_encode_frame

2015-01-23 Thread Michael Niedermayer
On Fri, Jan 23, 2015 at 09:58:41PM +0100, Jean First wrote:
 if the openjpeg parameter tcp_rates is not 0 ( using the ffmpeg 
 compression_level option ) 
 every 2nd image per thread is badly encoded. By moving the opj_setup_encoder 
 function from
 libopenjpeg_encode_init to libopenjpeg_encode_frame this can be prevented.
 
 This fixes ticket #3754.

how can this be reproduced ?


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

You can kill me, but you cannot change the truth.


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


Re: [FFmpeg-devel] [PATCH] lavc/libopenjpegenc: move opj_setup_encoder to libopenjpeg_encode_frame

2015-01-23 Thread Michael Niedermayer
On Fri, Jan 23, 2015 at 11:57:26PM +0100, Jean First wrote:
 On Fri Jan 23 2015 23:39:21 GMT+0100 (CET), Michael Niedermayer wrote:
 On Fri, Jan 23, 2015 at 11:34:35PM +0100, Michael Niedermayer wrote:
 On Fri, Jan 23, 2015 at 09:58:41PM +0100, Jean First wrote:
 if the openjpeg parameter tcp_rates is not 0 ( using the ffmpeg 
 compression_level option )
 every 2nd image per thread is badly encoded. By moving the 
 opj_setup_encoder function from
 libopenjpeg_encode_init to libopenjpeg_encode_frame this can be prevented.
 
 This fixes ticket #3754.
 how can this be reproduced ?
 note, ive tried:
 ffmpeg -i matrixbench_mpeg2.mpg -an -compression_level 1 -vframes 30 
 -threads 1 -compression_level 1 -vcodec libopenjpeg test.nut
 
 and that results in grayscale only output before as well as after
 the patch
 
 you can try with:
 
 ffmpeg -i matrixbench_mpeg2.mpg -pix_fmt xyz12 -format:v jp2
 -profile:v cinema2k -cinema_mode 2k_24 -prog_order cprl
 -numresolution 6 -numlayers 1 -compression_level 2 -threads 1
 test-%05d.j2c
 
 and change the value for -compression_level

ok, bugfix confirmed

patch applied

thanks

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

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch


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


Re: [FFmpeg-devel] [PATCH] Port mp=eq/eq2 to FFmpeg

2015-01-23 Thread Stefano Sabatini
On date Wednesday 2015-01-21 20:38:20 +0530, Arwa Arif encoded:
 
  I still expect that eq and eq2 should have the same performances,
  since the adjust callback is set depending on the parameter values. So
  we should have a single eq filter.
 
  Please investigate about why you get different benchmark values.
 
 
 I used this command: ffmpeg -benchmark -i  matrixbench_mpeg2.mpg -vf mp=eq2
 -f null -
 And everytime I am running this command, I am getting a different result
 even for the same input and same filter.
 

 So, I tried using the time.h library for getting the time, the results for
 eq and eq2 are 37.71 and 35.56 seconds respectively.

Please show the patch adding time.h benchmarks (in general making
things easily reproduce helps *a lot* the tester and the reviewer).

time.h usually works by creating log messages about the specific code
segment called performance, it doesn't affect global execution time,
so it looks like your benchmark was probably misguided.

 I don't know why eq is coming out to be slower than eq2. (In fact, eq2 is
 accessing more functions than eq).
-- 
FFmpeg = Fascinating and Fundamental Miracolous Philosofic Enlightened Guru
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] web/download: Change main snapshot url to point to github

2015-01-23 Thread Paul B Mahol
On 1/23/15, Michael Niedermayer michae...@gmx.at wrote:
 The url did just end at a 403 - Snapshots not allowed

 We also could point to ffmpeg.org, but the snapshots there are upto 24h old
 with the current cronjob
 ---
  src/download |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)


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


[FFmpeg-devel] [PATCH] nvenc: Propagate desired number of reference frames.

2015-01-23 Thread Philip Langdale
Signed-off-by: Philip Langdale phil...@overt.org
---
 libavcodec/nvenc.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index c52beb7..e68bbe9 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -614,6 +614,11 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
 memcpy(ctx-encode_config, preset_config.presetCfg, 
sizeof(ctx-encode_config));
 ctx-encode_config.version = NV_ENC_CONFIG_VER;
 
+if (avctx-refs = 0) {
+/* 0 means let the hardware decide */
+ctx-encode_config.encodeCodecConfig.h264Config.maxNumRefFrames = 
avctx-refs;
+}
+
 /* 0 is intra-only, 1 is I/P only, 2 is one B Frame, 3 two B frames, and 
so on. */
 ctx-encode_config.frameIntervalP = avctx-max_b_frames + 1;
 
-- 
2.1.0

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


Re: [FFmpeg-devel] [PATCH] nvenc: Propagate desired number of reference frames.

2015-01-23 Thread Timo Rothenpieler

+ctx-encode_config.encodeCodecConfig.h264Config.maxNumRefFrames = 
avctx-refs;


avctx-refs should propably be checked for = 0.

I'm not sure if maxNumRefFrames means the exact same thing as 
avctx-refs, but the comment in the nvenc header isn't exactly clear 
about that.


This would also forward the ffmpeg default, 1, to nvenc, instead of the 
nvenc default, 0, which lets the driver decide what is best. I'm not 
sure if this is desireable and how much it affects the quality.




Timo



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


Re: [FFmpeg-devel] [PATCH] nvenc: Propagate desired number of reference frames.

2015-01-23 Thread Christophe Gisquet
Hi,

2015-01-23 10:54 GMT+01:00 Timo Rothenpieler t...@rothenpieler.org:
 This would also forward the ffmpeg default, 1, to nvenc, instead of the
 nvenc default, 0, which lets the driver decide what is best. I'm not sure if
 this is desireable and how much it affects the quality.

In that case, why not set ffmpeg's default to 0, which would mean
auto. As 0 is not possible as soon as inter frames are used, this is
easily identifiable. Unfortunately, all affected encoders using it (ie
except nvenc, which would use the same convention) must be modified to
detect and change that 0 back to 1.

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


Re: [FFmpeg-devel] [PATCH] Decoder for CEA-608 and World System Teletext [WIP]

2015-01-23 Thread wm4
On Fri, 23 Jan 2015 04:42:22 +0100
Michael Niedermayer michae...@gmx.at wrote:

 diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
 index 99467bb..6a0fb5b 100644
 --- a/libavcodec/avcodec.h
 +++ b/libavcodec/avcodec.h
 @@ -503,11 +503,13 @@ enum AVCodecID {
  AV_CODEC_ID_SSA,
  AV_CODEC_ID_MOV_TEXT,
  AV_CODEC_ID_HDMV_PGS_SUBTITLE,
 -AV_CODEC_ID_DVB_TELETEXT,
 +AV_CODEC_ID_DVB_VBI,

Breaks everything, including API and ABI. I guess that's why the patch
is WIP?

Also, taking a brief look, it would probably good to replace these
many pages of code for charset conversion switch()es with tables.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] web/download: Change main snapshot url to point to github

2015-01-23 Thread Clément Bœsch
On Fri, Jan 23, 2015 at 03:31:28AM +0100, Michael Niedermayer wrote:
 The url did just end at a 403 - Snapshots not allowed
 
 We also could point to ffmpeg.org, but the snapshots there are upto 24h old
 with the current cronjob
 ---
  src/download |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/download b/src/download
 index 20c42f8..4e56bc1 100644
 --- a/src/download
 +++ b/src/download
 @@ -197,7 +197,7 @@
  div class=pull-lefta 
 href=git://source.ffmpeg.org/ffmpeg.gitgit://source.ffmpeg.org/ffmpeg.git/a/div
  div class=pull-right
a class=btn btn-success 
 href=http://git.videolan.org/?p=ffmpeg.git;Browse/a
 -  a class=btn btn-success 
 href=http://git.videolan.org/?p=ffmpeg.git;a=snapshot;h=HEAD;sf=tgz;Snapshot/a
 +  a class=btn btn-success 
 href=https://github.com/FFmpeg/FFmpeg/tarball/master;Snapshot (github)/a
  /div
/td
tdMain FFmpeg Git repository/td

Above we have snapshot and git snapshot pointing on ffmpeg.org, this would
be inconsistent. Also below we can see this snapshot URL from github. I
would suggest dropping the snapshot button altogether or using the
24h-delay one. After all, the ffmpeg.org source and git snapshot are
available above, and the github snapshot as well below.

[...]

-- 
Clément B.


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