Re: [FFmpeg-devel] [PATCH] avfilter: add EIA-608 line extractor

2017-01-24 Thread Paul B Mahol
On 1/23/17, Marton Balint  wrote:
>
> On Mon, 23 Jan 2017, Paul B Mahol wrote:
>
>> On 1/17/17, Paul B Mahol  wrote:
>>> Signed-off-by: Dave Rice 
>>> Signed-off-by: Paul B Mahol 
>>> ---
>>>  doc/filters.texi|  70 
>>>  libavfilter/Makefile|   1 +
>>>  libavfilter/allfilters.c|   1 +
>>>  libavfilter/vf_readeia608.c | 268
>>> 
>>>  4 files changed, 340 insertions(+)
>>>  create mode 100644 libavfilter/vf_readeia608.c
>>>
>>
>> Gonna push this soon.
>
> You may consider using the bit slicer only from libzvbi, I have used it
> for teletext in libavdevice/decklink_dec.cpp, in the
> teletext_data_unit_from_vbi_data function.
>
> I have copied the initialization variables from the zvbi source
> raw_decoder.c, maybe you can do the same with CC.

IMHO, its too limited.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/h264dec: Fix regression with "make fate-h264-attachment-631 THREADS=8"

2017-01-24 Thread Michael Niedermayer
On Tue, Jan 24, 2017 at 07:32:02AM +0100, wm4 wrote:
> On Tue, 24 Jan 2017 00:38:15 +0100
> Michael Niedermayer  wrote:
> 
> > This treats the case of no slices like no frames which it basically is.
> > 
> > The field is added to the context as other nal related fields are also there
> > and passing the has_slices field per *arguments is ugly and not consistent
> > 
> > Found-by: ubitux
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/h264dec.c | 6 --
> >  libavcodec/h264dec.h | 2 ++
> >  tests/fate/h264.mak  | 2 +-
> >  3 files changed, 7 insertions(+), 3 deletions(-)
> > 
> > diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
> > index 4ecaec267c..41e6ce458c 100644
> > --- a/libavcodec/h264dec.c
> > +++ b/libavcodec/h264dec.c
> > @@ -607,6 +607,7 @@ static int decode_nal_units(H264Context *h, const 
> > uint8_t *buf, int buf_size)
> >  int idr_cleared=0;
> >  int i, ret = 0;
> >  
> > +h->has_slice = 0;
> >  h->nal_unit_type= 0;
> >  
> >  h->max_contexts = h->nb_slice_ctx;
> > @@ -672,6 +673,7 @@ again:
> >  h->has_recovery_point = 1;
> >  case H264_NAL_SLICE:
> >  sl->gb = nal->gb;
> > +h->has_slice = 1;
> >  
> >  if ((err = ff_h264_decode_slice_header(h, sl, nal)))
> >  break;
> > @@ -839,7 +841,7 @@ end:
> >  }
> >  #endif /* CONFIG_ERROR_RESILIENCE */
> >  /* clean up */
> > -if (h->cur_pic_ptr && !h->droppable) {
> > +if (h->cur_pic_ptr && !h->droppable && h->has_slice) {
> >  ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
> >h->picture_structure == 
> > PICT_BOTTOM_FIELD);
> >  }
> > @@ -1055,7 +1057,7 @@ static int h264_decode_frame(AVCodecContext *avctx, 
> > void *data,
> >  return send_next_delayed_frame(h, pict, got_frame, buf_index);
> >  }
> >  
> > -if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS) && !h->cur_pic_ptr) {
> > +if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS) && (!h->cur_pic_ptr || 
> > !h->has_slice)) {
> >  if (avctx->skip_frame >= AVDISCARD_NONREF ||
> >  buf_size >= 4 && !memcmp("Q264", buf, 4))
> >  return buf_size;
> > diff --git a/libavcodec/h264dec.h b/libavcodec/h264dec.h
> > index c8b7e663b3..fa5c98ee90 100644
> > --- a/libavcodec/h264dec.h
> > +++ b/libavcodec/h264dec.h
> > @@ -446,6 +446,8 @@ typedef struct H264Context {
> >  int nal_ref_idc;
> >  int nal_unit_type;
> >  
> > +int has_slice;  ///< slice NAL is found in the packet, set by 
> > decode_nal_units, its state does not need to be preserved outside 
> > h264_decode_frame()
> > +
> >  /**
> >   * Used to parse AVC variant of H.264
> >   */
> > diff --git a/tests/fate/h264.mak b/tests/fate/h264.mak
> > index d40681f9c9..1f6e5f3947 100644
> > --- a/tests/fate/h264.mak
> > +++ b/tests/fate/h264.mak
> > @@ -424,7 +424,7 @@ fate-h264-extreme-plane-pred: CMD = 
> > framemd5 -i $(TARGET_SAM
> >  fate-h264-interlace-crop: CMD = framecrc -i 
> > $(TARGET_SAMPLES)/h264/interlaced_crop.mp4 -vframes 3
> >  fate-h264-brokensps-2580: CMD = framecrc -i 
> > $(TARGET_SAMPLES)/h264/brokensps.flv -vf format=yuv420p,scale=w=192:h=144 
> > -sws_flags bitexact+bilinear
> >  fate-h264-xavc-4389:  CMD = framecrc -i 
> > $(TARGET_SAMPLES)/h264/SonyXAVC_LongGOP_green_pixelation_early_Frames.MXF 
> > -pix_fmt yuv422p10le
> > -fate-h264-attachment-631: CMD = framecrc -i 
> > $(TARGET_SAMPLES)/h264/attachment631-small.mp4 -an -max_error_rate 0.95
> > +fate-h264-attachment-631: CMD = framecrc -i 
> > $(TARGET_SAMPLES)/h264/attachment631-small.mp4 -an -max_error_rate 0.96
> 
> Any reason for this part of the change? It looks to me like the patch
> is only fixing some regressed logic.

by treating that case like "no frame" there are more errors returned
and this needs an update or the fate test will fail

ill apply this as ubitux wants it in for merge work:
 michaelni: could you push that one btw?

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

Never trust a computer, one day, it may think you are the virus. -- Compn


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


Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: improve to write m3u8 head block

2017-01-24 Thread Steven Liu
Steven Liu 于2017年1月23日 周一下午5:29写道:

> Signed-off-by: Steven Liu 
> ---
>  libavformat/hlsenc.c | 34 +++---
>  1 file changed, 15 insertions(+), 19 deletions(-)
>
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index f070bc3..df482ac 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -659,6 +659,19 @@ static void set_http_options(AVDictionary **options,
> HLSContext *c)
>  av_dict_set(options, "method", c->method, 0);
>  }
>
> +static void write_m3u8_head_block(HLSContext *hls, AVIOContext *out, int
> version,
> +  int target_duration, int64_t sequence)
> +{
> +avio_printf(out, "#EXTM3U\n");
> +avio_printf(out, "#EXT-X-VERSION:%d\n", version);
> +if (hls->allowcache == 0 || hls->allowcache == 1) {
> +avio_printf(out, "#EXT-X-ALLOW-CACHE:%s\n", hls->allowcache == 0
> ? "NO" : "YES");
> +}
> +avio_printf(out, "#EXT-X-TARGETDURATION:%d\n", target_duration);
> +avio_printf(out, "#EXT-X-MEDIA-SEQUENCE:%"PRId64"\n", sequence);
> +av_log(hls, AV_LOG_VERBOSE, "EXT-X-MEDIA-SEQUENCE:%"PRId64"\n",
> sequence);
> +}
> +
>  static int hls_window(AVFormatContext *s, int last)
>  {
>  HLSContext *hls = s->priv_data;
> @@ -698,21 +711,13 @@ static int hls_window(AVFormatContext *s, int last)
>  }
>
>  hls->discontinuity_set = 0;
> -avio_printf(out, "#EXTM3U\n");
> -avio_printf(out, "#EXT-X-VERSION:%d\n", version);
> -if (hls->allowcache == 0 || hls->allowcache == 1) {
> -avio_printf(out, "#EXT-X-ALLOW-CACHE:%s\n", hls->allowcache == 0
> ? "NO" : "YES");
> -}
> -avio_printf(out, "#EXT-X-TARGETDURATION:%d\n", target_duration);
> -avio_printf(out, "#EXT-X-MEDIA-SEQUENCE:%"PRId64"\n", sequence);
> +write_m3u8_head_block(hls, out, version, target_duration, sequence);
>  if (hls->pl_type == PLAYLIST_TYPE_EVENT) {
>  avio_printf(out, "#EXT-X-PLAYLIST-TYPE:EVENT\n");
>  } else if (hls->pl_type == PLAYLIST_TYPE_VOD) {
>  avio_printf(out, "#EXT-X-PLAYLIST-TYPE:VOD\n");
>  }
>
> -av_log(s, AV_LOG_VERBOSE, "EXT-X-MEDIA-SEQUENCE:%"PRId64"\n",
> -   sequence);
>  if((hls->flags & HLS_DISCONT_START) && sequence==hls->start_sequence
> && hls->discontinuity_set==0 ){
>  avio_printf(out, "#EXT-X-DISCONTINUITY\n");
>  hls->discontinuity_set = 1;
> @@ -774,16 +779,7 @@ static int hls_window(AVFormatContext *s, int last)
>  if( hls->vtt_m3u8_name ) {
>  if ((ret = s->io_open(s, &sub_out, hls->vtt_m3u8_name,
> AVIO_FLAG_WRITE, &options)) < 0)
>  goto fail;
> -avio_printf(sub_out, "#EXTM3U\n");
> -avio_printf(sub_out, "#EXT-X-VERSION:%d\n", version);
> -if (hls->allowcache == 0 || hls->allowcache == 1) {
> -avio_printf(sub_out, "#EXT-X-ALLOW-CACHE:%s\n",
> hls->allowcache == 0 ? "NO" : "YES");
> -}
> -avio_printf(sub_out, "#EXT-X-TARGETDURATION:%d\n",
> target_duration);
> -avio_printf(sub_out, "#EXT-X-MEDIA-SEQUENCE:%"PRId64"\n",
> sequence);
> -
> -av_log(s, AV_LOG_VERBOSE, "EXT-X-MEDIA-SEQUENCE:%"PRId64"\n",
> -   sequence);
> +write_m3u8_head_block(hls, sub_out, version, target_duration,
> sequence);
>
>  for (en = hls->segments; en; en = en->next) {
>  avio_printf(sub_out, "#EXTINF:%f,\n", en->duration);
> --
> 2.10.1 (Apple Git-78)
>
>
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Pushed

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


Re: [FFmpeg-devel] [PATCH] ffmpeg_opt.c: Introduce a -vstats_version option and document the existing -vstats format.

2017-01-24 Thread Moritz Barsnick
On Mon, Jan 23, 2017 at 18:25:45 -0800, Sasi Inguva wrote:

> +@item -vstats_version @var{file}
 ^ @var{int}

> +++ b/ffmpeg.c
> @@ -1347,6 +1347,7 @@ static void do_video_stats(OutputStream *ost, int 
> frame_size)
>  enc = ost->enc_ctx;
>  if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
>  frame_number = ost->st->nb_frames;
> +
>  fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number,

Totally useless and unrelated change.

> +"Version of the vstats format to use."},
^ for consistency, this probably shouldn't be a capital letter.

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


Re: [FFmpeg-devel] [PATCH] ffmpeg_opt.c: Introduce a -vstats_version option and document the existing -vstats format.

2017-01-24 Thread Moritz Barsnick
On Tue, Jan 24, 2017 at 15:45:27 +0100, Moritz Barsnick wrote:
> On Mon, Jan 23, 2017 at 18:25:45 -0800, Sasi Inguva wrote:
> 
> > +@item -vstats_version @var{file}
>  ^ @var{int}
> 
> > +++ b/ffmpeg.c
> > @@ -1347,6 +1347,7 @@ static void do_video_stats(OutputStream *ost, int 
> > frame_size)
> >  enc = ost->enc_ctx;
> >  if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
> >  frame_number = ost->st->nb_frames;
> > +
> >  fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number,
> 
> Totally useless and unrelated change.

Actually, I think you lost your change which makes actual use of the
variable vstats_version to allow two different outputs!
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] ffmpeg_opt.c: Introduce a -vstats_version option and document the existing -vstats format.

2017-01-24 Thread Sasi Inguva
I have it in a separate patch. Sorry about the newline.

On Tue, Jan 24, 2017 at 6:47 AM, Moritz Barsnick  wrote:

> On Tue, Jan 24, 2017 at 15:45:27 +0100, Moritz Barsnick wrote:
> > On Mon, Jan 23, 2017 at 18:25:45 -0800, Sasi Inguva wrote:
> >
> > > +@item -vstats_version @var{file}
> >  ^ @var{int}
> >
> > > +++ b/ffmpeg.c
> > > @@ -1347,6 +1347,7 @@ static void do_video_stats(OutputStream *ost,
> int frame_size)
> > >  enc = ost->enc_ctx;
> > >  if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
> > >  frame_number = ost->st->nb_frames;
> > > +
> > >  fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number,
> >
> > Totally useless and unrelated change.
>
> Actually, I think you lost your change which makes actual use of the
> variable vstats_version to allow two different outputs!
> ___
> 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] xalg xdcam isom ticket #6099

2017-01-24 Thread compn
patch for #6099
https://trac.ffmpeg.org/ticket/6099

while i was looking, it seems there is also an avlg codec isom, but i see only 
one result in google so i did not add it.

{ AV_CODEC_ID_H264, MKTAG('a', 'v', 'l', 'g') }, /* Panasonic P2 AVC-LongG */

i would prefer we added avlg as well, even if we don't have samples.

-compn

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


[FFmpeg-devel] [PATCH] ffmpeg_opt.c: Introduce a -vstats_version option and document the existing -vstats format.

2017-01-24 Thread Sasi Inguva
Signed-off-by: Sasi Inguva 
---
 doc/ffmpeg.texi | 4 
 ffmpeg.h| 1 +
 ffmpeg_opt.c| 3 +++
 3 files changed, 8 insertions(+)

diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index b56bdbe261..cdea1a271f 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -636,6 +636,10 @@ Calculate PSNR of compressed frames.
 Dump video coding statistics to @file{vstats_HHMMSS.log}.
 @item -vstats_file @var{file}
 Dump video coding statistics to @var{file}.
+@item -vstats_version @var{file}
+Specifies which version of the vstats format to use. If version is 1, format is
+
+@code{frame= %5d q= %2.1f PSNR= %6.2f f_size= %6d s_size= %8.0fkB time= %0.3f 
br= %7.1fkbits/s avg_br= %7.1fkbits/s}
 @item -top[:@var{stream_specifier}] @var{n} (@emph{output,per-stream})
 top=1/bottom=0/auto=-1 field first
 @item -dc @var{precision}
diff --git a/ffmpeg.h b/ffmpeg.h
index 75bf50ec29..458bb8a3dc 100644
--- a/ffmpeg.h
+++ b/ffmpeg.h
@@ -597,6 +597,7 @@ extern char *videotoolbox_pixfmt;
 
 extern int filter_nbthreads;
 extern int filter_complex_nbthreads;
+extern int vstats_version;
 
 extern const AVIOInterruptCB int_cb;
 
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index a1c02fc29b..b1a62e8620 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -121,6 +121,7 @@ int frame_bits_per_raw_sample = 0;
 float max_error_rate  = 2.0/3;
 int filter_nbthreads = 0;
 int filter_complex_nbthreads = 0;
+int vstats_version = 1;
 
 
 static int intra_only = 0;
@@ -3547,6 +3548,8 @@ const OptionDef options[] = {
 "dump video coding statistics to file" },
 { "vstats_file",  OPT_VIDEO | HAS_ARG | OPT_EXPERT ,   
  { .func_arg = opt_vstats_file },
 "dump video coding statistics to file", "file" },
+{ "vstats_version",  OPT_VIDEO | OPT_INT | HAS_ARG | OPT_EXPERT ,  
  { &vstats_version },
+"Version of the vstats format to use."},
 { "vf",   OPT_VIDEO | HAS_ARG  | OPT_PERFILE | OPT_OUTPUT, 
  { .func_arg = opt_video_filters },
 "set video filters", "filter_graph" },
 { "intra_matrix", OPT_VIDEO | HAS_ARG | OPT_EXPERT  | OPT_STRING | 
OPT_SPEC |
-- 
2.11.0.483.g087da7b7c-goog

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


[FFmpeg-devel] [PATCH] avformat: add Scenarist Closed Captions demuxer

2017-01-24 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavformat/Makefile |   1 +
 libavformat/allformats.c |   1 +
 libavformat/sccdec.c | 166 +++
 3 files changed, 168 insertions(+)
 create mode 100644 libavformat/sccdec.c

diff --git a/libavformat/Makefile b/libavformat/Makefile
index f30bc94..a458402 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -434,6 +434,7 @@ OBJS-$(CONFIG_SAMI_DEMUXER)  += samidec.o 
subtitles.o
 OBJS-$(CONFIG_SAP_DEMUXER)   += sapdec.o
 OBJS-$(CONFIG_SAP_MUXER) += sapenc.o
 OBJS-$(CONFIG_SBG_DEMUXER)   += sbgdec.o
+OBJS-$(CONFIG_SCC_DEMUXER)   += sccdec.o subtitles.o
 OBJS-$(CONFIG_SDP_DEMUXER)   += rtsp.o
 OBJS-$(CONFIG_SDR2_DEMUXER)  += sdr2.o
 OBJS-$(CONFIG_SDS_DEMUXER)   += sdsdec.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index e30305b..45140f4 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -273,6 +273,7 @@ void av_register_all(void)
 REGISTER_DEMUXER (SAMI, sami);
 REGISTER_MUXDEMUX(SAP,  sap);
 REGISTER_DEMUXER (SBG,  sbg);
+REGISTER_DEMUXER (SCC,  scc);
 REGISTER_DEMUXER (SDP,  sdp);
 REGISTER_DEMUXER (SDR2, sdr2);
 REGISTER_DEMUXER (SDS,  sds);
diff --git a/libavformat/sccdec.c b/libavformat/sccdec.c
new file mode 100644
index 000..4d22908
--- /dev/null
+++ b/libavformat/sccdec.c
@@ -0,0 +1,166 @@
+/*
+ * SCC subtitle demuxer
+ * Copyright (c) 2017 Paul B Mahol
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg 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.
+ *
+ * FFmpeg 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avformat.h"
+#include "internal.h"
+#include "subtitles.h"
+#include "libavutil/bprint.h"
+#include "libavutil/intreadwrite.h"
+
+typedef struct SCCContext {
+FFDemuxSubtitlesQueue q;
+} SCCContext;
+
+static int scc_probe(AVProbeData *p)
+{
+char buf[128];
+FFTextReader tr;
+
+ff_text_init_buf(&tr, p->buf, p->buf_size);
+
+while (ff_text_peek_r8(&tr) == '\r' || ff_text_peek_r8(&tr) == '\n')
+ff_text_r8(&tr);
+
+if (ff_subtitles_read_line(&tr, buf, sizeof(buf)) < 0)
+return 0;
+
+if (!memcmp(buf, "Scenarist_SCC V1.0", 18))
+return AVPROBE_SCORE_MAX;
+
+return 0;
+}
+
+static int convert(uint8_t x)
+{
+if (x >= 'a')
+x -= 87;
+else if (x >= 'A')
+x -= 55;
+else
+x -= '0';
+return x;
+}
+
+static int scc_read_header(AVFormatContext *s)
+{
+SCCContext *scc = s->priv_data;
+AVStream *st = avformat_new_stream(s, NULL);
+char line[4096];
+uint8_t out[4096];
+FFTextReader tr;
+int ret = 0;
+
+ff_text_init_avio(s, &tr, s->pb);
+
+if (!st)
+return AVERROR(ENOMEM);
+avpriv_set_pts_info(st, 64, 1, 1000);
+st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
+st->codecpar->codec_id   = AV_CODEC_ID_EIA_608;
+
+while (!ff_text_eof(&tr)) {
+const int64_t pos = ff_text_pos(&tr);
+ptrdiff_t len = ff_subtitles_read_line(&tr, line, sizeof(line));
+char *saveptr = NULL, *lline = (char *)&line;
+int hh1, mm1, ss1, fs1, i;
+int64_t ts_start;
+AVPacket *sub;
+
+if (len < 0)
+break;
+
+if (!len || !line[0])
+continue;
+
+if (!strncmp(line, "Scenarist_SCC V1.0", 18))
+continue;
+
+if (len < 12 || sscanf(line, "%d:%d:%d:%d", &hh1, &mm1, &ss1, &fs1) != 
4)
+continue;
+ts_start = (hh1 * 3600LL + mm1 * 60LL + ss1) * 1000LL + fs1 * 33;
+
+lline += 12;
+
+for (i = 0; i < 4095; i += 3) {
+char *ptr = av_strtok(lline, " ", &saveptr);
+char c1, c2, c3, c4;
+
+if (!ptr)
+break;
+
+if (sscanf(ptr, "%c%c%c%c", &c1, &c2, &c3, &c4) != 4)
+break;
+
+lline = NULL;
+out[i+0] = 0xfc;
+out[i+1] = convert(c2) | (convert(c1) << 4);
+out[i+2] = convert(c4) | (convert(c3) << 4);
+}
+out[i] = 0;
+
+sub = ff_subtitles_queue_insert(&scc->q, out, i, 0);
+if (!sub) {
+ret = AVERROR(ENOMEM);
+goto end;
+ 

Re: [FFmpeg-devel] [PATCH] avformat: add Scenarist Closed Captions demuxer

2017-01-24 Thread Clément Bœsch
On Tue, Jan 24, 2017 at 06:43:31PM +0100, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  libavformat/Makefile |   1 +
>  libavformat/allformats.c |   1 +
>  libavformat/sccdec.c | 166 
> +++
>  3 files changed, 168 insertions(+)
>  create mode 100644 libavformat/sccdec.c
> 

Please add a FATE test or I'll likely break it without knowing.

-- 
Clément B.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/8] arm: vp9dsp: Restructure the bpp checks

2017-01-24 Thread Martin Storsjö

On Thu, 19 Jan 2017, Michael Niedermayer wrote:


On Wed, Jan 18, 2017 at 11:45:08PM +0200, Martin Storsjö wrote:

This work is sponsored by, and copyright, Google.

This is more in line with how it will be extended for more bitdepths.
---
 libavcodec/arm/vp9dsp_init_arm.c | 24 +---
 1 file changed, 9 insertions(+), 15 deletions(-)


fate passes with this patchset under qemu arm


Pushed, thanks!

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


Re: [FFmpeg-devel] [PATCH]lavc/svq3: Fail for media key encryption

2017-01-24 Thread Carl Eugen Hoyos
2017-01-23 13:49 GMT+01:00 Carl Eugen Hoyos :

> Attached patch responds to ticket #6094, pure guessing.

Pushed after tests by Piotr.

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


Re: [FFmpeg-devel] [PATCHv2 3/3] avfilter/formats: do not allow unknown layouts in ff_parse_channel_layout if nret is not set

2017-01-24 Thread Marton Balint


On Sun, 22 Jan 2017, Marton Balint wrote:



On Tue, 10 Jan 2017, Marton Balint wrote:



On Mon, 2 Jan 2017, Marton Balint wrote:

Current code returned the number of channels as channel layout in that 

case,

and if nret is not set then unknown layouts are typically not supported.

Also use the common parsing code. Use a temporary workaround to parse an
unknown channel layout such as '13c', after a 1 year grace period only 

'13C'

will work.

Signed-off-by: Marton Balint 
---
libavfilter/formats.c | 26 +++---
libavfilter/tests/formats.c   |  3 +++
tests/ref/fate/filter-formats |  3 +++
3 files changed, 21 insertions(+), 11 deletions(-)



[...]


0 = ff_parse_channel_layout(0001,  1, 1+1+1+1);


Ping...


I will apply the series in a day or two if I get no further comments.



Series applied.

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


Re: [FFmpeg-devel] [PATCH] xalg xdcam isom ticket #6099

2017-01-24 Thread Carl Eugen Hoyos
2017-01-24 17:21 GMT+01:00 compn :
> patch for #6099
> https://trac.ffmpeg.org/ticket/6099

Please push.

> while i was looking, it seems there is also an avlg codec isom, but i see
> only one result in google so i did not add it.
>
> { AV_CODEC_ID_H264, MKTAG('a', 'v', 'l', 'g') }, /* Panasonic P2 AVC-LongG */
>
> i would prefer we added avlg as well, even if we don't have samples.

No objections.

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


Re: [FFmpeg-devel] [PATCH] avformat: add Scenarist Closed Captions demuxer

2017-01-24 Thread Carl Eugen Hoyos
2017-01-24 18:43 GMT+01:00 Paul B Mahol :

> +++ b/libavformat/sccdec.c
> @@ -0,0 +1,166 @@
> +/*
> + * SCC subtitle demuxer

Please mention ticket #4767 in the commit message.

Thank you, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]lavf/rtmpproto: Make bytes_read variables 64bit.

2017-01-24 Thread Carl Eugen Hoyos
2017-01-14 19:22 GMT+01:00 Carl Eugen Hoyos :

> Attached patch is meant to fix ticket #5836, completely untested.

Patch applied.

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


Re: [FFmpeg-devel] [PATCH]lavu/internal: Never use %t and %z on Windows

2017-01-24 Thread Carl Eugen Hoyos
2016-12-20 12:18 GMT+01:00 Carl Eugen Hoyos :
> 2016-12-20 10:37 GMT+01:00 Hendrik Leppkes :
>> On Tue, Dec 20, 2016 at 3:15 AM, Carl Eugen Hoyos  wrote:
>>> Hi!
>>>
>>> Attached patch is supposed to fix an issue reported by Blake Senftner
>>> on libav-user.
>>
>> Sorry, but those guys are just using it wrong. Those format specifiers
>> are perfectly valid in a mingw build, and if you mix different
>> compilers its your responsibility to make sure it doesn't explode, not
>> something we need to fix for them.
>
> Don't we document (for a very long time) how to use mingw libraries
> from Visual Studio?
>
> More important though: Do you believe the patch may break something?
> If not, why do you oppose?

Ping.

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


Re: [FFmpeg-devel] [PATCH]lavf/mov: Export vendor metadata

2017-01-24 Thread Carl Eugen Hoyos
2016-12-12 12:12 GMT+01:00 Carl Eugen Hoyos :

> I saw only after writing this patch that a Google employee has sent
> a more complicated variant of this patch in November (searching for
> a description of the vendor field showed the patch).

Ping for the ffmpeg patch.

I will add audio vendor to the mov patch.

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


Re: [FFmpeg-devel] [PATCH]lavd/v4l2: Do not set frame_set to a negative value

2017-01-24 Thread Carl Eugen Hoyos
2016-12-10 16:49 GMT+01:00 Carl Eugen Hoyos :

> Attached patch fixes a minor bug, displaying a negative bitrate.

Patch applied.

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


[FFmpeg-devel] [PATCH 1/2] avfilter/ebur128: do not allow null ebur128 context in ff_ebur128_relative_threshold

2017-01-24 Thread Marton Balint
The user should supply a proper context.

Fixes Coverity CID 1396246.

Signed-off-by: Marton Balint 
---
 libavfilter/ebur128.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/ebur128.c b/libavfilter/ebur128.c
index a46692e..012df54 100644
--- a/libavfilter/ebur128.c
+++ b/libavfilter/ebur128.c
@@ -599,7 +599,7 @@ int ff_ebur128_relative_threshold(FFEBUR128State * st, 
double *out)
 double relative_threshold;
 size_t above_thresh_counter;
 
-if (st && (st->mode & FF_EBUR128_MODE_I) != FF_EBUR128_MODE_I)
+if ((st->mode & FF_EBUR128_MODE_I) != FF_EBUR128_MODE_I)
 return AVERROR(EINVAL);
 
 ebur128_calc_relative_threshold(st, &above_thresh_counter,
-- 
2.10.2

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


[FFmpeg-devel] [PATCH 2/2] avfilter/ebur128: fix relative threshold calculation for multiple contexts

2017-01-24 Thread Marton Balint
Also disallow NULL contexts.

Fixes Coverity CID 1396273, 1396279.

Signed-off-by: Marton Balint 
---
 libavfilter/ebur128.c | 40 +++-
 1 file changed, 19 insertions(+), 21 deletions(-)

diff --git a/libavfilter/ebur128.c b/libavfilter/ebur128.c
index 012df54..e064c59 100644
--- a/libavfilter/ebur128.c
+++ b/libavfilter/ebur128.c
@@ -519,49 +519,45 @@ FF_EBUR128_ADD_FRAMES(int)
 FF_EBUR128_ADD_FRAMES(float)
 FF_EBUR128_ADD_FRAMES(double)
 
-static int ebur128_calc_relative_threshold(FFEBUR128State * st,
+static void ebur128_sum_relative_threshold(FFEBUR128State * st,
size_t * above_thresh_counter,
double *relative_threshold)
 {
 size_t i;
-*relative_threshold = 0.0;
-*above_thresh_counter = 0;
 
 for (i = 0; i < 1000; ++i) {
 *relative_threshold += st->d->block_energy_histogram[i] *
 histogram_energies[i];
 *above_thresh_counter += st->d->block_energy_histogram[i];
 }
+}
 
+static void ebur128_finalize_relative_threshold(size_t *above_thresh_counter,
+double *relative_threshold)
+{
 if (*above_thresh_counter != 0) {
 *relative_threshold /= (double) *above_thresh_counter;
 *relative_threshold *= RELATIVE_GATE_FACTOR;
 }
-
-return 0;
 }
 
 static int ebur128_gated_loudness(FFEBUR128State ** sts, size_t size,
   double *out)
 {
 double gated_loudness = 0.0;
-double relative_threshold;
-size_t above_thresh_counter;
+double relative_threshold = 0.0;
+size_t above_thresh_counter = 0;
 size_t i, j, start_index;
 
-for (i = 0; i < size; i++) {
-if (sts[i]
-&& (sts[i]->mode & FF_EBUR128_MODE_I) != FF_EBUR128_MODE_I) {
+for (i = 0; i < size; i++)
+if ((sts[i]->mode & FF_EBUR128_MODE_I) != FF_EBUR128_MODE_I)
 return AVERROR(EINVAL);
-}
-}
 
-for (i = 0; i < size; i++) {
-if (!sts[i])
-continue;
-ebur128_calc_relative_threshold(sts[i], &above_thresh_counter,
+for (i = 0; i < size; i++)
+ebur128_sum_relative_threshold(sts[i], &above_thresh_counter,
+   &relative_threshold);
+ebur128_finalize_relative_threshold(&above_thresh_counter,
 &relative_threshold);
-}
 if (!above_thresh_counter) {
 *out = -HUGE_VAL;
 return 0;
@@ -596,14 +592,16 @@ static int ebur128_gated_loudness(FFEBUR128State ** sts, 
size_t size,
 
 int ff_ebur128_relative_threshold(FFEBUR128State * st, double *out)
 {
-double relative_threshold;
-size_t above_thresh_counter;
+double relative_threshold = 0.0;
+size_t above_thresh_counter = 0;
 
 if ((st->mode & FF_EBUR128_MODE_I) != FF_EBUR128_MODE_I)
 return AVERROR(EINVAL);
 
-ebur128_calc_relative_threshold(st, &above_thresh_counter,
-&relative_threshold);
+ebur128_sum_relative_threshold(st, &above_thresh_counter,
+   &relative_threshold);
+ebur128_finalize_relative_threshold(&above_thresh_counter,
+&relative_threshold);
 
 if (!above_thresh_counter) {
 *out = -70.0;
-- 
2.10.2

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


Re: [FFmpeg-devel] GSoC 2017

2017-01-24 Thread Michael Niedermayer
On Mon, Jan 23, 2017 at 03:39:09PM +0100, Michael Niedermayer wrote:
> Hi all
> 
> GSoC 2017 mentor org registration has opened a few days ago
> 
> Our current ideas page lists just a single mentor and single sugestion
> http://trac.ffmpeg.org/wiki/SponsoringPrograms/GSoC/2017
> 
> About the Suggested project
> It is a hard design task which few students would be
> capable to do. I dont know if someone already knows a student who is
> qualified for this and who would be available in FFmpeg GSoC but if not
> I think finding a qualified student will be hard or require some luck
> and success with a less than qualified student unlikely.
> At least thats what my gut feeling says based on past years
> 
> About the number of ideas
> one is not enough, and i think its a waste of time if we apply with
> such short list, i doubt we would be accepted with one idea and one
> mentor
> 
> About the number of mentors
> one is not enough

ok so our page now contains
4 project ideas and 3 mentors
big thanks to the people volunteering and adding them

Can we get a few more ?
Ideal would be numbers similar to previous years
We wont have a student for each idea we list most likely.
If we list just 4 we might have just 1 or 2 students, having a
wider range of ideas to select from would increase the number of
contributions and number of potential new developers joining.

Thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.


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


Re: [FFmpeg-devel] GSoC 2017

2017-01-24 Thread Umair Khan
On Wed, Jan 25, 2017 at 7:45 AM, Michael Niedermayer  wrote:
>
> On Mon, Jan 23, 2017 at 03:39:09PM +0100, Michael Niedermayer wrote:
> > Hi all
> >
> > GSoC 2017 mentor org registration has opened a few days ago
> >
> > Our current ideas page lists just a single mentor and single sugestion
> > http://trac.ffmpeg.org/wiki/SponsoringPrograms/GSoC/2017
> >
> > About the Suggested project
> > It is a hard design task which few students would be
> > capable to do. I dont know if someone already knows a student who is
> > qualified for this and who would be available in FFmpeg GSoC but if not
> > I think finding a qualified student will be hard or require some luck
> > and success with a less than qualified student unlikely.
> > At least thats what my gut feeling says based on past years
> >
> > About the number of ideas
> > one is not enough, and i think its a waste of time if we apply with
> > such short list, i doubt we would be accepted with one idea and one
> > mentor
> >
> > About the number of mentors
> > one is not enough
>
> ok so our page now contains
> 4 project ideas and 3 mentors
> big thanks to the people volunteering and adding them
>
> Can we get a few more ?
> Ideal would be numbers similar to previous years
> We wont have a student for each idea we list most likely.
> If we list just 4 we might have just 1 or 2 students, having a
> wider range of ideas to select from would increase the number of
> contributions and number of potential new developers joining.

One idea would be to finish rest of the ALS codec tasks.
What's remaining is :-
1. Implement RLS LMS mode in the decoder.
2. Get the encoder merged into the main repository.
3. Encoder featureset still lacks support for floating point sample
data encoding.

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


[FFmpeg-devel] GSOC project on "FITS image decoder and encoder"

2017-01-24 Thread Neeraj Kumar
Dear Sir,

I am a final year student at IIT Kanpur, India and GSOC'17 aspirant.

I am very much interested in doing the project mentioned at
https://trac.ffmpeg.org/wiki/SponsoringPrograms/GSoC/2017#
FITSimagedecoderandencoder
But. there is no Qualification Task. I asked the same question on IRC and
got the reply to mail you.

Can you please guide me further or assign some task?

Regards,

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