Re: [FFmpeg-devel] FFmpeg 4.1

2018-10-05 Thread Lou Logan
On Tue, Sep 25, 2018, at 10:50 AM, Lou Logan wrote:
>
> The users on Twitter have been asked for their suggestions. Please let 
> me know a little while before you want to make the release and  I'll 
> post the results here.

Results. Number of likes are in parentheses. Multiple suggestions from a single 
user are presented in one line.

Carl (5)
Dr. Wöhrl (3)
Noether (3)
uncut console output pls (2)
Curie, Meitner, Lovelace, Hopper (1)
[Muhammad ibn Musa] al-Khwarizmi (1)
Wave
Archimedes, Euclid, Thales, Pythagoras, Aristarchus, Eratosthenes, Hipparchus, 
Democritus, Heron
Schrödinger
Hawking
Alan Turing
Cooks
gary the snail
Tesla
Gauss
Chaplin
William Sealy Gosset
Sakharov
Newton, Maxwell, Pythagoras, Archimedes
Satoshi, Merkle



Personally I prefer al-Khwarizmi or Gauss.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat: add H264 and HEVC support in IVF muxer

2018-10-05 Thread Alex Sukhanov
On Mon, Oct 1, 2018 at 11:01 AM  wrote:

> From: Alex Sukhanov 
>
> ---
>  libavformat/ivfenc.c | 50 +---
>  1 file changed, 38 insertions(+), 12 deletions(-)
>
> diff --git a/libavformat/ivfenc.c b/libavformat/ivfenc.c
> index 66441a2a43..6410828533 100644
> --- a/libavformat/ivfenc.c
> +++ b/libavformat/ivfenc.c
> @@ -36,19 +36,29 @@ static int ivf_write_header(AVFormatContext *s)
>  return AVERROR(EINVAL);
>  }
>  par = s->streams[0]->codecpar;
> -if (par->codec_type != AVMEDIA_TYPE_VIDEO ||
> -!(par->codec_id == AV_CODEC_ID_AV1 ||
> -  par->codec_id == AV_CODEC_ID_VP8 ||
> -  par->codec_id == AV_CODEC_ID_VP9)) {
> -av_log(s, AV_LOG_ERROR, "Currently only VP8, VP9 and AV1 are
> supported!\n");
> -return AVERROR(EINVAL);
> -}
>  avio_write(pb, "DKIF", 4);
>  avio_wl16(pb, 0); // version
>  avio_wl16(pb, 32); // header length
> -avio_wl32(pb,
> -  par->codec_id == AV_CODEC_ID_VP9 ? AV_RL32("VP90") :
> -  par->codec_id == AV_CODEC_ID_VP8 ? AV_RL32("VP80") :
> AV_RL32("AV01"));
> +switch (par->codec_id) {
> +  case AV_CODEC_ID_AV1:
> +avio_wl32(pb, AV_RL32("AV01"));
> +break;
> +  case AV_CODEC_ID_H264:
> +avio_wl32(pb, AV_RL32("H264"));
> +break;
> +  case AV_CODEC_ID_HEVC:
> +avio_wl32(pb, AV_RL32("HEVC"));
> +break;
> +  case AV_CODEC_ID_VP8:
> +avio_wl32(pb, AV_RL32("VP80"));
> +break;
> +  case AV_CODEC_ID_VP9:
> +avio_wl32(pb, AV_RL32("VP90"));
> +break;
> +  default:
> +av_log(s, AV_LOG_ERROR, "Currently only AV1, H264, HEVC, VP8 and
> VP9 and AV1 are supported!\n");
> +return AVERROR(EINVAL);
> +}
>  avio_wl16(pb, par->width);
>  avio_wl16(pb, par->height);
>  avio_wl32(pb, s->streams[0]->time_base.den);
> @@ -95,16 +105,32 @@ static int ivf_check_bitstream(struct AVFormatContext
> *s, const AVPacket *pkt)
>  int ret = 1;
>  AVStream *st = s->streams[pkt->stream_index];
>
> -if (st->codecpar->codec_id == AV_CODEC_ID_VP9)
> +if (st->codecpar->codec_id == AV_CODEC_ID_H264) {
> +if (pkt->size >= 5 && AV_RB32(pkt->data) != 0x001 &&
> + (AV_RB24(pkt->data) != 0x01 ||
> +  (st->codecpar->extradata_size > 0 &&
> +   st->codecpar->extradata[0] == 1)))
> +ret = ff_stream_add_bitstream_filter(st, "h264_mp4toannexb",
> NULL);
> +} else if (st->codecpar->codec_id == AV_CODEC_ID_HEVC) {
> +if (pkt->size >= 5 && AV_RB32(pkt->data) != 0x001 &&
> + (AV_RB24(pkt->data) != 0x01 ||
> +  (st->codecpar->extradata_size > 0 &&
> +   st->codecpar->extradata[0] == 1)))
> +ret = ff_stream_add_bitstream_filter(st, "hevc_mp4toannexb",
> NULL);
> +} else if (st->codecpar->codec_id == AV_CODEC_ID_VP9) {
>  ret = ff_stream_add_bitstream_filter(st, "vp9_superframe", NULL);
> +}
>
>  return ret;
>  }
>
>  static const AVCodecTag codec_ivf_tags[] = {
> +{ AV_CODEC_ID_AV1,  MKTAG('A', 'V', '0', '1') },
> +{ AV_CODEC_ID_H264, MKTAG('H', '2', '6', '4') },
> +{ AV_CODEC_ID_HEVC, MKTAG('H', 'E', 'V', 'C') },
>  { AV_CODEC_ID_VP8,  MKTAG('V', 'P', '8', '0') },
>  { AV_CODEC_ID_VP9,  MKTAG('V', 'P', '9', '0') },
> -{ AV_CODEC_ID_AV1,  MKTAG('A', 'V', '0', '1') },
> +
>  { AV_CODEC_ID_NONE, 0 }
>  };
>
> --
> 2.19.0.605.g01d371f741-goog
>
>
Can you please take a look on this patch?
Thank you
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/wmaprodec: improve WMAPRO/XMA gapless output

2018-10-05 Thread Michael Niedermayer
On Wed, Oct 03, 2018 at 11:55:32PM +0200, bananaman...@gmail.com wrote:
> From: bnnm 

Is it intended that this doesnt list a human name ?
(its no problem but jb tends to be unhappy if there are no names in the log
 so i try to ask people if they really intend to not list their name or if
 its a unintended mistake)
 


> 
> Improves trac issue #6722. Fixes truncated XMA output (was missing 128 
> samples) and applies bitstream gapless info (partially for XMA, fully for 
> WMAPRO).
> 
> Applying XMA end_skip would require some extra changes in the XMA 
> multi-stream handling, so end samples are slightly bigger than what should be.
> 
> Compared to MS's decoders, WMAPRO in XWMA are correct, while in ASF (.wma) 
> don't seem to read the last frame, so output is around 128~512 samples 
> smaller (this happens even with gapless disabled and affects other ASF 
> codecs).
> 
> Signed-off-by: bnnm 
> ---
>  libavcodec/wmaprodec.c | 92 
> --
>  1 file changed, 66 insertions(+), 26 deletions(-)

this will need some change to 
TESTwmapro-ism
stddev:0.00 PSNR:143.22 MAXDIFF:1 bytes:   884736/   879952
size: |884736 - 879952| >= 0
Test wmapro-ism failed. Look at tests/data/fate/wmapro-ism.err for details.
make: *** [fate-wmapro-ism] Error 1


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

Democracy is the form of government in which you can choose your dictator


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


Re: [FFmpeg-devel] [PATCH] avcodec/wmadec: fix WMA gapless playback

2018-10-05 Thread Michael Niedermayer
On Fri, Oct 05, 2018 at 07:39:26PM +0200, bananaman...@gmail.com wrote:
> From: bnnm 
> 
> Fixes trac issue #7473.
> 
> Removes encoder delay (skip samples) and writes remaining frame samples after 
> EOF to get correct sample count.
> 
> Output is now accurate vs players that use Microsoft's codecs (Windows Media 
> Format Runtime).
> 
> Tested vs encode>decode WMAv2 with MS's codecs and most sample rate/bit 
> rate/channel/mode combinations in ASF/XWMA. WMAv1 appears to use the same 
> delay, from FFmpeg samples.
> 
> Signed-off-by: bnnm 
> ---
>  libavcodec/wma.h|  2 ++
>  libavcodec/wmadec.c | 34 --
>  2 files changed, 34 insertions(+), 2 deletions(-)

This will/would require several fate tests to be updated
at least these apparently:
make: *** [fate-wmav1-encode] Error 1
make: *** [fate-wmav2-encode] Error 1
make: *** [fate-flcl1905] Error 1


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

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf


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


[FFmpeg-devel] [PATCH] avcodec/wmadec: fix WMA gapless playback

2018-10-05 Thread bananaman255
From: bnnm 

Fixes trac issue #7473.

Removes encoder delay (skip samples) and writes remaining frame samples after 
EOF to get correct sample count.

Output is now accurate vs players that use Microsoft's codecs (Windows Media 
Format Runtime).

Tested vs encode>decode WMAv2 with MS's codecs and most sample rate/bit 
rate/channel/mode combinations in ASF/XWMA. WMAv1 appears to use the same 
delay, from FFmpeg samples.

Signed-off-by: bnnm 
---
 libavcodec/wma.h|  2 ++
 libavcodec/wmadec.c | 34 --
 2 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/libavcodec/wma.h b/libavcodec/wma.h
index 325f03c44b..c80068de80 100644
--- a/libavcodec/wma.h
+++ b/libavcodec/wma.h
@@ -133,6 +133,8 @@ typedef struct WMACodecContext {
 float lsp_pow_m_table2[(1 << LSP_POW_BITS)];
 AVFloatDSPContext *fdsp;
 
+int eof_done; /* decode flag to output remaining samples after EOF */
+
 #ifdef TRACE
 int frame_count;
 #endif /* TRACE */
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index 78b51e5871..d59432d3f1 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -124,6 +124,11 @@ static av_cold int wma_decode_init(AVCodecContext *avctx)
 
 avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
 
+/* Skip WMA encoder delay (>=32000: 4096, >=22050: 2048, >=8000: 1024).
+ * The amount doesn't seem specified in the flags or container (ASF/XWMA),
+ * but can be verified compared to Microsoft codecs' output. */
+avctx->internal->skip_samples = s->frame_len * 2;
+
 return 0;
 }
 
@@ -819,7 +824,29 @@ static int wma_decode_superframe(AVCodecContext *avctx, 
void *data,
 ff_tlog(avctx, "***decode_superframe:\n");
 
 if (buf_size == 0) {
+/* must output one final frame with remaining samples */
+
+if (s->eof_done)
+return 0;
+
+/* get output buffer */
+frame->nb_samples = s->frame_len;
+if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+return ret;
+samples = (float **) frame->extended_data;
+
+/* clean output buffer and copy last IMCDT samples */
+for (i = 0; i < s->avctx->channels; i++) {
+memset(frame->extended_data[i], 0,
+ s->frame_len * sizeof(*s->frame_out[i]));
+
+memcpy(frame->extended_data[i], >frame_out[i][0],
+ s->frame_len * sizeof(*s->frame_out[i]) >> 1);
+}
+
 s->last_superframe_len = 0;
+s->eof_done = 1;
+*got_frame_ptr = 1;
 return 0;
 }
 if (buf_size < avctx->block_align) {
@@ -965,6 +992,9 @@ static av_cold void flush(AVCodecContext *avctx)
 
 s->last_bitoffset  =
 s->last_superframe_len = 0;
+
+s->eof_done = 0;
+avctx->internal->skip_samples = s->frame_len * 2;
 }
 
 #if CONFIG_WMAV1_DECODER
@@ -978,7 +1008,7 @@ AVCodec ff_wmav1_decoder = {
 .close  = ff_wma_end,
 .decode = wma_decode_superframe,
 .flush  = flush,
-.capabilities   = AV_CODEC_CAP_DR1,
+.capabilities   = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
 .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
   AV_SAMPLE_FMT_NONE },
 };
@@ -994,7 +1024,7 @@ AVCodec ff_wmav2_decoder = {
 .close  = ff_wma_end,
 .decode = wma_decode_superframe,
 .flush  = flush,
-.capabilities   = AV_CODEC_CAP_DR1,
+.capabilities   = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
 .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
   AV_SAMPLE_FMT_NONE },
 };
-- 
2.11.0.windows.3

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


Re: [FFmpeg-devel] [FFmpeg-devel, 1/2] lavu/qsv: fix a random hwupload failure regression

2018-10-05 Thread Rogozhkin, Dmitry V
On Sun, 2018-09-30 at 17:15 +0800, Zhong Li wrote:
> Variable 'ret' hasn't been initialized,thus introducing a random
> hwupload failure regression due to qsv session uninitialized.
> 
> Signed-off-by: Zhong Li 
> ---
>  libavutil/hwcontext_qsv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c
> index cb3e184..33e121b 100644
> --- a/libavutil/hwcontext_qsv.c
> +++ b/libavutil/hwcontext_qsv.c
> @@ -861,7 +861,7 @@ static int qsv_transfer_data_to(AVHWFramesContext
> *ctx, AVFrame *dst,
>  
>  mfxSyncPoint sync = NULL;
>  mfxStatus err;
> -int ret;
> +int ret = 0;
>  
>  while (!s->session_upload_init && !s->session_upload && !ret) {
>  #if HAVE_PTHREADS

Works on my side and fixes an issue with hwupload which I saw. Can,
please, this be merged?

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


[FFmpeg-devel] [PATCH] avformat/matroskadec.c: Fix support seek to non keyframes

2018-10-05 Thread Seokjin Hong
Hi.
I finally figured out the reason why all videos on matroska format can't
get last packet.

When I tried to get last video stream packet by seeking, I can't get any
packet.
Please check my example code as below:
// timestamp is bigger than last key_frame timestamp
// for example, if nb_index_entries is equal to 100
// and index_entries[nb_index_entries - 1].timestamp is equal to 1000
// and timestamp is equal to 1010. (please assume that last packet
(non-keyframe) pts is 1040)
av_seek_frame(fmt_ctx, stream_idx, timestamp, AVSEEK_FLAG_ANY |
AVSEEK_FLAG_BACKWORD);
while(av_read_frame(fmt_ctx, ) >=0) {
...
}

av_seek_frame works fine, but matroska_read_seek function always sets
'matroska->skip_to_keyframe = 1' without considering 'flags &
AVSEEK_FLAG_ANY'.

After call av_seek_frame(..., AVSEEK_FLAG_ANY | AVSEEK_FLAG_BACKWORD) and
call av_read_frame, matroska_parse_block function always ends line 3364
(see below)

if (matroska->skip_to_keyframe && track->type !=
MATROSKA_TRACK_TYPE_SUBTITLE) {
if ((int64_t)timecode < (int64_t)matroska->skip_to_timecode)
return res; // line 3364
...
}

It means that matroska_parse_block can't call matroska_parse_frame.
matroska_parse_frame is important because it manufactures packet and puts
packet in packet list by calling ff_packet_list_put function.

So that, I attached patch to fix this bug.
Please check it.

Regards.


--

From 0b35c837ce61d87a4e74865c0d968b258a7c76c3 Mon Sep 17 00:00:00 2001
From: Seokjin Hong 
Date: Sun, 2 Sep 2018 21:37:06 +0900
Subject: [PATCH] avformat/matroskadec.c: Fix support seek to non keyframes

---
 libavformat/matroskadec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index e6793988e1..b66fcec4a5 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -3590,12 +3590,13 @@ static int matroska_read_seek(AVFormatContext *s,
int stream_index,
 matroska->current_id   = 0;
 if (flags & AVSEEK_FLAG_ANY) {
 st->skip_to_keyframe = 0;
+matroska->skip_to_keyframe = 0;
 matroska->skip_to_timecode = timestamp;
 } else {
 st->skip_to_keyframe = 1;
+matroska->skip_to_keyframe = 1;
 matroska->skip_to_timecode = st->index_entries[index].timestamp;
 }
-matroska->skip_to_keyframe = 1;
 matroska->done = 0;
 matroska->num_levels   = 0;
 ff_update_cur_dts(s, st, st->index_entries[index].timestamp);
--
2.17.1
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] prores_ks: use CodecContext for color information if specified

2018-10-05 Thread Paul B Mahol
On 10/5/18, Marc-Antoine ARNAUD  wrote:
> In our case we have some files with bad colorspaces (in HD but with bt601
> colorspace).
> So we use -colorspace, -color_trc, -color_primaries to force the output
> colorspace.
>
> We keep compatibility with "old command line", we get source colorspace if
> nothing is mentionned.
> It work like that for Mpeg2video codec, so we expect to have the same here.

Correct patch should be one that changes frame properties, otherwise
every encoder that uses these properties needs to be updated with extra
lines to maintain.

>
> Marc-Antoine
>
>
> Le jeu. 4 oct. 2018 `a 18:36, Paul B Mahol  a ecrit :
>
>> On 10/4/18, Marc-Antoine ARNAUD  wrote:
>> >
>> >
>>
>> Why?
>>
>> IIRC this patch is not needed.
>> ___
>> 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


Re: [FFmpeg-devel] prores_ks: use CodecContext for color information if specified

2018-10-05 Thread Marc-Antoine ARNAUD
In our case we have some files with bad colorspaces (in HD but with bt601
colorspace).
So we use -colorspace, -color_trc, -color_primaries to force the output
colorspace.

We keep compatibility with "old command line", we get source colorspace if
nothing is mentionned.
It work like that for Mpeg2video codec, so we expect to have the same here.

Marc-Antoine


Le jeu. 4 oct. 2018 à 18:36, Paul B Mahol  a écrit :

> On 10/4/18, Marc-Antoine ARNAUD  wrote:
> >
> >
>
> Why?
>
> IIRC this patch is not needed.
> ___
> 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