Re: [FFmpeg-devel] GSOC 2018 qualification task.

2018-04-19 Thread ANURAG SINGH IIT BHU
Hello Sir,

I do understand that just 56 lines were inserted but sir 621 lines were
deleted which were of no use for hellosubs and it included functons like
expand_text(), expand_function() and other which were being called by the
drawtext filter but not needed by the hellosubs filter as the text and
operation to perform was predetermined. So sir skipping unnecessary
functions should make the code a bit faster.

I am really looking forward to build my project proposal of speech to text
subtitle generation filter under your guidance and contribute to ffmpeg as
it will be helpful for a large number of users,and it is an important
opportunity for me as a student as well. I am dedicated to learn and I am
confident that with your guidance we can do it.


Thanks and regards,
Anurag Singh











‌

On Thu, Apr 19, 2018 at 10:48 PM, Michael Niedermayer <
mich...@niedermayer.cc> wrote:

> On Wed, Apr 18, 2018 at 02:45:36PM +0530, ANURAG SINGH IIT BHU wrote:
> > Hello Sir,
> >
> > I have implemented the suggested changes, now the filter does not break
> > builds, also now it works for all inputs and
>
> You are still removing the Copyright statments from the filter you copy
>
> --- libavfilter/vf_drawtext.c   2018-04-17 14:20:30.340366781 +0200
> +++ libavfilter/vf_hellosubs.c  2018-04-19 17:51:48.371572589 +0200
> @@ -1,8 +1,4 @@
>  /*
> - * Copyright (c) 2011 Stefano Sabatini
> - * Copyright (c) 2010 S.N. Hemanth Meenakshisundaram
> - * Copyright (c) 2003 Gustavo Sverzut Barbieri 
> - *
>   * This file is part of FFmpeg.
>   *
>   * FFmpeg is free software; you can redistribute it and/or
>
> the newly added code has 960 lines
> only 56 of these lines are not in vf_drawtext.c
>
> diff -wbu libavfilter/vf_drawtext.c libavfilter/vf_hellosubs.c |diffstat
>  vf_hellosubs.c |  677 --
> ---
>  1 file changed, 56 insertions(+), 621 deletions(-)
>
> wc libavfilter/vf_hellosubs.c
>   960   32438 libavfilter/vf_hellosubs.c
>
> From these 56 some are changes of the filter name and context name
>
> The remaining changes are reviewed below, I attempted to format
> this so the code is readable.
>
>
> - * drawtext filter, based on the original vhook/drawtext.c
> - * filter by Gustavo Sverzut Barbieri
> + * Libfreetype subtitles burning filter.
> + * @see{http://www.matroska.org/technical/specs/subtitles/ssa.html}
>
> The SSA link has nothing to do with the code based on drawtext
>
>
> @@ -207,3 +181,2 @@
> -{"text","set text", OFFSET(text),
>  AV_OPT_TYPE_STRING, {.str=NULL},  CHAR_MIN, CHAR_MAX, FLAGS},
> -{"textfile","set text file",OFFSET(textfile),
>  AV_OPT_TYPE_STRING, {.str=NULL},  CHAR_MIN, CHAR_MAX, FLAGS},
> -{"fontcolor",   "set foreground color", OFFSET(fontcolor.rgba),
>  AV_OPT_TYPE_COLOR,  {.str="black"}, CHAR_MIN, CHAR_MAX, FLAGS},
> +{"text","set text", OFFSET(text),
>  AV_OPT_TYPE_STRING, {.str="Hello world"},  CHAR_MIN, CHAR_MAX, FLAGS},
> +{"fontcolor",   "set foreground color", OFFSET(fontcolor.rgba),
>  AV_OPT_TYPE_COLOR,  {.str="white"}, CHAR_MIN, CHAR_MAX, FLAGS},
> @@ -217,5 +185,3 @@
> -{"fontsize","set font size",OFFSET(fontsize_expr),
> AV_OPT_TYPE_STRING, {.str=NULL},  CHAR_MIN, CHAR_MAX , FLAGS},
> -{"x",   "set x expression", OFFSET(x_expr),
>  AV_OPT_TYPE_STRING, {.str="0"},   CHAR_MIN, CHAR_MAX, FLAGS},
> -{"y",   "set y expression", OFFSET(y_expr),
>  AV_OPT_TYPE_STRING, {.str="0"},   CHAR_MIN, CHAR_MAX, FLAGS},
> -{"shadowx", "set shadow x offset",  OFFSET(shadowx),
> AV_OPT_TYPE_INT,{.i64=0}, INT_MIN,  INT_MAX , FLAGS},
> -{"shadowy", "set shadow y offset",  OFFSET(shadowy),
> AV_OPT_TYPE_INT,{.i64=0}, INT_MIN,  INT_MAX , FLAGS},
> +{"fontsize","set font size",OFFSET(fontsize_expr),
> AV_OPT_TYPE_STRING, {.str="h/20"},  CHAR_MIN, CHAR_MAX , FLAGS},
> +{"x",   "set x expression", OFFSET(x_expr),
>  AV_OPT_TYPE_STRING, {.str="w/2.7"},   CHAR_MIN, CHAR_MAX, FLAGS},
> +{"y",   "set y expression", OFFSET(y_expr),
>  AV_OPT_TYPE_STRING, {.str="h/1.3"},   CHAR_MIN, CHAR_MAX, FLAGS},
>
> ...
>
> +static int generatehellosub(AVFilterContext *ctx, AVBPrint *bp)
>
>  {
>  DrawTextContext *s = ctx->priv;
>  double pts = s->var_values[VAR_T];

Re: [FFmpeg-devel] GSOC 2018 qualification task.

2018-04-18 Thread ANURAG SINGH IIT BHU
Hello Sir,

I have implemented the suggested changes, now the filter does not break
builds, also now it works for all inputs and

ffplay -f lavfi -i testsrc -vf hellosubs

works.

Sir I think passing the text using metadata to drawtext filter would not be
an efficient way in terms of time as drawtext filter calls a number of
functions which are not needed by the hellosubs filter, functions like
expand_text(), expand_func() etc, i.e drawtext filter is of 1525 lines
where as  hellosubs is more than 1/3 rd  times less in lines. and sir for
realtime subtitles I think we should emphasise more on reducing the time
taken by the filter to remove lag.


Thanks and regards,
Anurag Singh




On Mon, Apr 16, 2018 at 11:57 AM, ANURAG SINGH IIT BHU <
anurag.singh.ph...@iitbhu.ac.in> wrote:

>
>
>
> Hello sir,
>
> Okay I'll implement the suggested changes and make sure that the filter
> does not break build without libfreetype.
>
> Thanks and regards
> Anurag Singh.
>
>
> On Mon, Apr 16, 2018 at 12:49 AM, Michael Niedermayer <
> mich...@niedermayer.cc> wrote:
>
>> On Sun, Apr 15, 2018 at 07:36:09PM +0530, ANURAG SINGH IIT BHU wrote:
>> > Hello Sir,
>> >
>> > I have implemented the adviced changes for the hellosubs filter for the
>> > qualification task which writes Hello World time on frames, now the
>> filter
>> > does not uses libavformat, and it uses libfreetype to draw over video
>> > frames. I have attached the complete patch.
>> >
>> > libfretype and libfontconfig should be enabled to run the filter.
>> > (libfontconfig if no font file is provided.)
>> >
>> > Command to run the filter
>> > ffmpeg -i  -vf hellosubs 
>> >
>> > Thanks and regards,
>> > Anurag Singh.
>> >
>> >
>> >
>> >
>> >
>> > ‌
>> >
>> > On Fri, Apr 13, 2018 at 9:39 AM, ANURAG SINGH IIT BHU <
>> > anurag.singh.ph...@iitbhu.ac.in> wrote:
>> >
>> > > Thank you sir, I'll implement the suggested reviews as soon as
>> possible.
>> > >
>> > >
>> > >
>> > >
>> > > ‌
>> > >
>> > > On Fri, Apr 13, 2018 at 4:04 AM, Michael Niedermayer <
>> > > mich...@niedermayer.cc> wrote:
>> > >
>> > >> On Fri, Apr 13, 2018 at 02:13:53AM +0530, ANURAG SINGH IIT BHU wrote:
>> > >> > Hello,
>> > >> > I have implemented the reviews mentioned on previous patch, now
>> there
>> > >> is no
>> > >> > need to provide any subtitle file to the filter, I am attaching the
>> > >> > complete patch of the hellosubs filter.
>> > >> >
>> > >> > Command to run the filter
>> > >> > ffmpeg -i  -vf hellosubs= helloout.mp4
>> > >> >
>> > >> >
>> > >> > Thanks and regards,
>> > >> > Anurag Singh.
>> > >> >
>> > >> >
>> > >> > ‌
>> > >> >
>> > >> > On Tue, Apr 10, 2018 at 4:55 AM, Rostislav Pehlivanov <
>> > >> atomnu...@gmail.com>
>> > >> > wrote:
>> > >> >
>> > >> > > On 9 April 2018 at 19:10, Paul B Mahol  wrote:
>> > >> > >
>> > >> > > > On 4/9/18, Rostislav Pehlivanov  wrote:
>> > >> > > > > On 9 April 2018 at 03:59, ANURAG SINGH IIT BHU <
>> > >> > > > > anurag.singh.ph...@iitbhu.ac.in> wrote:
>> > >> > > > >
>> > >> > > > >> This mail is regarding the qualification task assigned to
>> me for
>> > >> the
>> > >> > > > >> GSOC project
>> > >> > > > >> in FFmpeg for automatic real-time subtitle generation using
>> > >> speech to
>> > >> > > > text
>> > >> > > > >> translation ML model.
>> > >> > > > >>
>> > >> > > > >
>> > >> > > > > i really don't think lavfi is the correct place for such
>> code,
>> > >> nor that
>> > >> > > > the
>> > >> > > > > project's repo should contain such code at all.
>> > >> > > > > This would need to be in another repo and a separate library.
>> > >> > > >
>> > >> > > > Why? Are

Re: [FFmpeg-devel] GSOC 2018 qualification task.

2018-04-15 Thread ANURAG SINGH IIT BHU
Hello sir,

Okay I'll implement the suggested changes and make sure that the filter
does not break build without libfreetype.

Thanks and regards
Anurag Singh.


On Mon, Apr 16, 2018 at 12:49 AM, Michael Niedermayer <
mich...@niedermayer.cc> wrote:

> On Sun, Apr 15, 2018 at 07:36:09PM +0530, ANURAG SINGH IIT BHU wrote:
> > Hello Sir,
> >
> > I have implemented the adviced changes for the hellosubs filter for the
> > qualification task which writes Hello World time on frames, now the
> filter
> > does not uses libavformat, and it uses libfreetype to draw over video
> > frames. I have attached the complete patch.
> >
> > libfretype and libfontconfig should be enabled to run the filter.
> > (libfontconfig if no font file is provided.)
> >
> > Command to run the filter
> > ffmpeg -i  -vf hellosubs 
> >
> > Thanks and regards,
> > Anurag Singh.
> >
> >
> >
> >
> >
> > ‌
> >
> > On Fri, Apr 13, 2018 at 9:39 AM, ANURAG SINGH IIT BHU <
> > anurag.singh.ph...@iitbhu.ac.in> wrote:
> >
> > > Thank you sir, I'll implement the suggested reviews as soon as
> possible.
> > >
> > >
> > >
> > >
> > > ‌
> > >
> > > On Fri, Apr 13, 2018 at 4:04 AM, Michael Niedermayer <
> > > mich...@niedermayer.cc> wrote:
> > >
> > >> On Fri, Apr 13, 2018 at 02:13:53AM +0530, ANURAG SINGH IIT BHU wrote:
> > >> > Hello,
> > >> > I have implemented the reviews mentioned on previous patch, now
> there
> > >> is no
> > >> > need to provide any subtitle file to the filter, I am attaching the
> > >> > complete patch of the hellosubs filter.
> > >> >
> > >> > Command to run the filter
> > >> > ffmpeg -i  -vf hellosubs= helloout.mp4
> > >> >
> > >> >
> > >> > Thanks and regards,
> > >> > Anurag Singh.
> > >> >
> > >> >
> > >> > ‌
> > >> >
> > >> > On Tue, Apr 10, 2018 at 4:55 AM, Rostislav Pehlivanov <
> > >> atomnu...@gmail.com>
> > >> > wrote:
> > >> >
> > >> > > On 9 April 2018 at 19:10, Paul B Mahol  wrote:
> > >> > >
> > >> > > > On 4/9/18, Rostislav Pehlivanov  wrote:
> > >> > > > > On 9 April 2018 at 03:59, ANURAG SINGH IIT BHU <
> > >> > > > > anurag.singh.ph...@iitbhu.ac.in> wrote:
> > >> > > > >
> > >> > > > >> This mail is regarding the qualification task assigned to me
> for
> > >> the
> > >> > > > >> GSOC project
> > >> > > > >> in FFmpeg for automatic real-time subtitle generation using
> > >> speech to
> > >> > > > text
> > >> > > > >> translation ML model.
> > >> > > > >>
> > >> > > > >
> > >> > > > > i really don't think lavfi is the correct place for such code,
> > >> nor that
> > >> > > > the
> > >> > > > > project's repo should contain such code at all.
> > >> > > > > This would need to be in another repo and a separate library.
> > >> > > >
> > >> > > > Why? Are you against ocr filter too?
> > >> > > >
> > >> > >
> > >> > > The OCR filter uses libtessract so I'm fine with it. Like I said,
> as
> > >> long
> > >> > > as the actual code to do it is in an external library I don't
> mind.
> > >> > > Mozilla recently released Deep Speech (
> https://github.com/mozilla/
> > >> > > DeepSpeech)
> > >> > > which does pretty much exactly speech to text and is considered to
> > >> have the
> > >> > > most accurate one out there. Someone just needs to convert the
> > >> tensorflow
> > >> > > code to something more usable.
> > >> > > ___
> > >> > > ffmpeg-devel mailing list
> > >> > > ffmpeg-devel@ffmpeg.org
> > >> > > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > >> > >
> > >>
> > >> >  Makefile   |1
> > >> >  allfilters.c   |1
> > >> &g

Re: [FFmpeg-devel] GSOC 2018 qualification task.

2018-04-15 Thread ANURAG SINGH IIT BHU
Hello Sir,

I have implemented the adviced changes for the hellosubs filter for the
qualification task which writes Hello World time on frames, now the filter
does not uses libavformat, and it uses libfreetype to draw over video
frames. I have attached the complete patch.

libfretype and libfontconfig should be enabled to run the filter.
(libfontconfig if no font file is provided.)

Command to run the filter
ffmpeg -i  -vf hellosubs 

Thanks and regards,
Anurag Singh.





‌

On Fri, Apr 13, 2018 at 9:39 AM, ANURAG SINGH IIT BHU <
anurag.singh.ph...@iitbhu.ac.in> wrote:

> Thank you sir, I'll implement the suggested reviews as soon as possible.
>
>
>
>
> ‌
>
> On Fri, Apr 13, 2018 at 4:04 AM, Michael Niedermayer <
> mich...@niedermayer.cc> wrote:
>
>> On Fri, Apr 13, 2018 at 02:13:53AM +0530, ANURAG SINGH IIT BHU wrote:
>> > Hello,
>> > I have implemented the reviews mentioned on previous patch, now there
>> is no
>> > need to provide any subtitle file to the filter, I am attaching the
>> > complete patch of the hellosubs filter.
>> >
>> > Command to run the filter
>> > ffmpeg -i  -vf hellosubs= helloout.mp4
>> >
>> >
>> > Thanks and regards,
>> > Anurag Singh.
>> >
>> >
>> > ‌
>> >
>> > On Tue, Apr 10, 2018 at 4:55 AM, Rostislav Pehlivanov <
>> atomnu...@gmail.com>
>> > wrote:
>> >
>> > > On 9 April 2018 at 19:10, Paul B Mahol  wrote:
>> > >
>> > > > On 4/9/18, Rostislav Pehlivanov  wrote:
>> > > > > On 9 April 2018 at 03:59, ANURAG SINGH IIT BHU <
>> > > > > anurag.singh.ph...@iitbhu.ac.in> wrote:
>> > > > >
>> > > > >> This mail is regarding the qualification task assigned to me for
>> the
>> > > > >> GSOC project
>> > > > >> in FFmpeg for automatic real-time subtitle generation using
>> speech to
>> > > > text
>> > > > >> translation ML model.
>> > > > >>
>> > > > >
>> > > > > i really don't think lavfi is the correct place for such code,
>> nor that
>> > > > the
>> > > > > project's repo should contain such code at all.
>> > > > > This would need to be in another repo and a separate library.
>> > > >
>> > > > Why? Are you against ocr filter too?
>> > > >
>> > >
>> > > The OCR filter uses libtessract so I'm fine with it. Like I said, as
>> long
>> > > as the actual code to do it is in an external library I don't mind.
>> > > Mozilla recently released Deep Speech (https://github.com/mozilla/
>> > > DeepSpeech)
>> > > which does pretty much exactly speech to text and is considered to
>> have the
>> > > most accurate one out there. Someone just needs to convert the
>> tensorflow
>> > > code to something more usable.
>> > > ___
>> > > ffmpeg-devel mailing list
>> > > ffmpeg-devel@ffmpeg.org
>> > > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>> > >
>>
>> >  Makefile   |1
>> >  allfilters.c   |1
>> >  vf_hellosubs.c |  513 ++
>> +++
>> >  3 files changed, 515 insertions(+)
>> > 2432f100fddb7ec84e771be8282d4b66e3d1f50a
>> 0001-avfilter-add-hellosubs-filter.patch
>> > From ac0e09d431ea68aebfaef6e2ed0b450e76d473d9 Mon Sep 17 00:00:00 2001
>> > From: ddosvulnerability 
>> > Date: Thu, 12 Apr 2018 22:06:43 +0530
>> > Subject: [PATCH] avfilter: add hellosubs filter.
>> >
>> > ---
>> >  libavfilter/Makefile   |   1 +
>> >  libavfilter/allfilters.c   |   1 +
>> >  libavfilter/vf_hellosubs.c | 513 ++
>> +++
>> >  3 files changed, 515 insertions(+)
>> >  create mode 100644 libavfilter/vf_hellosubs.c
>> >
>> > diff --git a/libavfilter/Makefile b/libavfilter/Makefile
>> > index a90ca30..770b1b5 100644
>> > --- a/libavfilter/Makefile
>> > +++ b/libavfilter/Makefile
>> > @@ -331,6 +331,7 @@ OBJS-$(CONFIG_SSIM_FILTER)   +=
>> vf_ssim.o framesync.o
>> >  OBJS-$(CONFIG_STEREO3D_FILTER)   += vf_stereo3d.o
>> >  OBJS-$(CONFIG_STREAMSELECT_FILTER)   += f_streamselect.o
>> framesync.o

Re: [FFmpeg-devel] GSOC 2018 qualification task.

2018-04-12 Thread ANURAG SINGH IIT BHU
Thank you sir, I'll implement the suggested reviews as soon as possible.




‌

On Fri, Apr 13, 2018 at 4:04 AM, Michael Niedermayer  wrote:

> On Fri, Apr 13, 2018 at 02:13:53AM +0530, ANURAG SINGH IIT BHU wrote:
> > Hello,
> > I have implemented the reviews mentioned on previous patch, now there is
> no
> > need to provide any subtitle file to the filter, I am attaching the
> > complete patch of the hellosubs filter.
> >
> > Command to run the filter
> > ffmpeg -i  -vf hellosubs= helloout.mp4
> >
> >
> > Thanks and regards,
> > Anurag Singh.
> >
> >
> > ‌
> >
> > On Tue, Apr 10, 2018 at 4:55 AM, Rostislav Pehlivanov <
> atomnu...@gmail.com>
> > wrote:
> >
> > > On 9 April 2018 at 19:10, Paul B Mahol  wrote:
> > >
> > > > On 4/9/18, Rostislav Pehlivanov  wrote:
> > > > > On 9 April 2018 at 03:59, ANURAG SINGH IIT BHU <
> > > > > anurag.singh.ph...@iitbhu.ac.in> wrote:
> > > > >
> > > > >> This mail is regarding the qualification task assigned to me for
> the
> > > > >> GSOC project
> > > > >> in FFmpeg for automatic real-time subtitle generation using
> speech to
> > > > text
> > > > >> translation ML model.
> > > > >>
> > > > >
> > > > > i really don't think lavfi is the correct place for such code, nor
> that
> > > > the
> > > > > project's repo should contain such code at all.
> > > > > This would need to be in another repo and a separate library.
> > > >
> > > > Why? Are you against ocr filter too?
> > > >
> > >
> > > The OCR filter uses libtessract so I'm fine with it. Like I said, as
> long
> > > as the actual code to do it is in an external library I don't mind.
> > > Mozilla recently released Deep Speech (https://github.com/mozilla/
> > > DeepSpeech)
> > > which does pretty much exactly speech to text and is considered to
> have the
> > > most accurate one out there. Someone just needs to convert the
> tensorflow
> > > code to something more usable.
> > > ___
> > > ffmpeg-devel mailing list
> > > ffmpeg-devel@ffmpeg.org
> > > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > >
>
> >  Makefile   |1
> >  allfilters.c   |1
> >  vf_hellosubs.c |  513 ++
> +++
> >  3 files changed, 515 insertions(+)
> > 2432f100fddb7ec84e771be8282d4b66e3d1f50a  0001-avfilter-add-hellosubs-
> filter.patch
> > From ac0e09d431ea68aebfaef6e2ed0b450e76d473d9 Mon Sep 17 00:00:00 2001
> > From: ddosvulnerability 
> > Date: Thu, 12 Apr 2018 22:06:43 +0530
> > Subject: [PATCH] avfilter: add hellosubs filter.
> >
> > ---
> >  libavfilter/Makefile   |   1 +
> >  libavfilter/allfilters.c   |   1 +
> >  libavfilter/vf_hellosubs.c | 513 ++
> +++
> >  3 files changed, 515 insertions(+)
> >  create mode 100644 libavfilter/vf_hellosubs.c
> >
> > diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> > index a90ca30..770b1b5 100644
> > --- a/libavfilter/Makefile
> > +++ b/libavfilter/Makefile
> > @@ -331,6 +331,7 @@ OBJS-$(CONFIG_SSIM_FILTER)   +=
> vf_ssim.o framesync.o
> >  OBJS-$(CONFIG_STEREO3D_FILTER)   += vf_stereo3d.o
> >  OBJS-$(CONFIG_STREAMSELECT_FILTER)   += f_streamselect.o
> framesync.o
> >  OBJS-$(CONFIG_SUBTITLES_FILTER)  += vf_subtitles.o
> > +OBJS-$(CONFIG_HELLOSUBS_FILTER)  += vf_hellosubs.o
> >  OBJS-$(CONFIG_SUPER2XSAI_FILTER) += vf_super2xsai.o
> >  OBJS-$(CONFIG_SWAPRECT_FILTER)   += vf_swaprect.o
> >  OBJS-$(CONFIG_SWAPUV_FILTER) += vf_swapuv.o
> > diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> > index 6eac828..a008908 100644
> > --- a/libavfilter/allfilters.c
> > +++ b/libavfilter/allfilters.c
> > @@ -322,6 +322,7 @@ extern AVFilter ff_vf_ssim;
> >  extern AVFilter ff_vf_stereo3d;
> >  extern AVFilter ff_vf_streamselect;
> >  extern AVFilter ff_vf_subtitles;
> > +extern AVFilter ff_vf_hellosubs;
> >  extern AVFilter ff_vf_super2xsai;
> >  extern AVFilter ff_vf_swaprect;
> >  extern AVFilter ff_vf_swapuv;
> > diff --git a/libavfilter/vf_hellosubs.c b/libavfilter/vf_hellosubs.c
> > new file mode 1

Re: [FFmpeg-devel] GSOC 2018 qualification task.

2018-04-12 Thread ANURAG SINGH IIT BHU
Hello,
I have implemented the reviews mentioned on previous patch, now there is no
need to provide any subtitle file to the filter, I am attaching the
complete patch of the hellosubs filter.

Command to run the filter
ffmpeg -i  -vf hellosubs= helloout.mp4


Thanks and regards,
Anurag Singh.


‌

On Tue, Apr 10, 2018 at 4:55 AM, Rostislav Pehlivanov 
wrote:

> On 9 April 2018 at 19:10, Paul B Mahol  wrote:
>
> > On 4/9/18, Rostislav Pehlivanov  wrote:
> > > On 9 April 2018 at 03:59, ANURAG SINGH IIT BHU <
> > > anurag.singh.ph...@iitbhu.ac.in> wrote:
> > >
> > >> This mail is regarding the qualification task assigned to me for the
> > >> GSOC project
> > >> in FFmpeg for automatic real-time subtitle generation using speech to
> > text
> > >> translation ML model.
> > >>
> > >
> > > i really don't think lavfi is the correct place for such code, nor that
> > the
> > > project's repo should contain such code at all.
> > > This would need to be in another repo and a separate library.
> >
> > Why? Are you against ocr filter too?
> >
>
> The OCR filter uses libtessract so I'm fine with it. Like I said, as long
> as the actual code to do it is in an external library I don't mind.
> Mozilla recently released Deep Speech (https://github.com/mozilla/
> DeepSpeech)
> which does pretty much exactly speech to text and is considered to have the
> most accurate one out there. Someone just needs to convert the tensorflow
> code to something more usable.
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
From ac0e09d431ea68aebfaef6e2ed0b450e76d473d9 Mon Sep 17 00:00:00 2001
From: ddosvulnerability 
Date: Thu, 12 Apr 2018 22:06:43 +0530
Subject: [PATCH] avfilter: add hellosubs filter.

---
 libavfilter/Makefile   |   1 +
 libavfilter/allfilters.c   |   1 +
 libavfilter/vf_hellosubs.c | 513 +
 3 files changed, 515 insertions(+)
 create mode 100644 libavfilter/vf_hellosubs.c

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index a90ca30..770b1b5 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -331,6 +331,7 @@ OBJS-$(CONFIG_SSIM_FILTER)   += vf_ssim.o framesync.o
 OBJS-$(CONFIG_STEREO3D_FILTER)   += vf_stereo3d.o
 OBJS-$(CONFIG_STREAMSELECT_FILTER)   += f_streamselect.o framesync.o
 OBJS-$(CONFIG_SUBTITLES_FILTER)  += vf_subtitles.o
+OBJS-$(CONFIG_HELLOSUBS_FILTER)  += vf_hellosubs.o
 OBJS-$(CONFIG_SUPER2XSAI_FILTER) += vf_super2xsai.o
 OBJS-$(CONFIG_SWAPRECT_FILTER)   += vf_swaprect.o
 OBJS-$(CONFIG_SWAPUV_FILTER) += vf_swapuv.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 6eac828..a008908 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -322,6 +322,7 @@ extern AVFilter ff_vf_ssim;
 extern AVFilter ff_vf_stereo3d;
 extern AVFilter ff_vf_streamselect;
 extern AVFilter ff_vf_subtitles;
+extern AVFilter ff_vf_hellosubs;
 extern AVFilter ff_vf_super2xsai;
 extern AVFilter ff_vf_swaprect;
 extern AVFilter ff_vf_swapuv;
diff --git a/libavfilter/vf_hellosubs.c b/libavfilter/vf_hellosubs.c
new file mode 100644
index 000..b994050
--- /dev/null
+++ b/libavfilter/vf_hellosubs.c
@@ -0,0 +1,513 @@
+/*
+ * Copyright (c) 2011 Baptiste Coudurier
+ * Copyright (c) 2011 Stefano Sabatini
+ * Copyright (c) 2012 Clément Bœsch
+ *
+ * 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
+ */
+
+/**
+ * @file
+ * Libass hellosubs burning filter.
+ *
+ 
+ */
+
+#include 
+
+#include "config.h"
+#if CONFIG_SUBTITLES_FILTER
+# include "libavcodec/avcodec.h"
+# include "libavformat/avformat.h"
+#endif
+#include "libavutil/avstring.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/opt.h"
+#include "libavutil/parseutils.h"
+#include "drawutils.h"
+#include "avfilter.h"
+#include "internal.h"
+#i

[FFmpeg-devel] GSOC 2018 qualification task.

2018-04-08 Thread ANURAG SINGH IIT BHU
This mail is regarding the qualification task assigned to me for the
GSOC project
in FFmpeg for automatic real-time subtitle generation using speech to text
translation ML model. My assigned task by Michael sir was writing a
ffmpeg-libavfilter filter which outputs a "Hello World minute: sec"
subtitle each second.

I have built a libavfilter filter named "hellosubs" using the existing
subtitle filter. hellosubs filter accepts a video file as input, along with
any subtitle file of any supported subtitle format of FFmpeg with any
number of enteries(>0), any entries i.e any random subtitle file, as an
argument and writes "Hello World minute: sec" subtitle each second on the
video.

>From 38fcf8c80f71a4186f03f33c9272b707390add67 Mon Sep 17 00:00:00 2001
From: ddosvulnerability 
Date: Fri, 6 Apr 2018 11:30:17 +0530
Subject: [PATCH] avfilter: add hellosub filter.

---

 libavfilter/Makefile   |   1 +
 libavfilter/allfilters.c   |   1 +
 libavfilter/vf_hellosubs.c | 463
+
 3 files changed, 465 insertions(+)
 create mode 100644 libavfilter/vf_hellosubs.c


diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index a90ca30..770b1b5 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -331,6 +331,7 @@ OBJS-$(CONFIG_SSIM_FILTER)   +=
vf_ssim.o framesync.o
 OBJS-$(CONFIG_STEREO3D_FILTER)   += vf_stereo3d.o
 OBJS-$(CONFIG_STREAMSELECT_FILTER)   += f_streamselect.o
framesync.o
 OBJS-$(CONFIG_SUBTITLES_FILTER)  += vf_subtitles.o
+OBJS-$(CONFIG_HELLOSUBS_FILTER)  += vf_hellosubs.o
 OBJS-$(CONFIG_SUPER2XSAI_FILTER) += vf_super2xsai.o
 OBJS-$(CONFIG_SWAPRECT_FILTER)   += vf_swaprect.o
 OBJS-$(CONFIG_SWAPUV_FILTER) += vf_swapuv.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 6eac828..a008908 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -322,6 +322,7 @@ extern AVFilter ff_vf_ssim;
 extern AVFilter ff_vf_stereo3d;
 extern AVFilter ff_vf_streamselect;
 extern AVFilter ff_vf_subtitles;
+extern AVFilter ff_vf_hellosubs;
 extern AVFilter ff_vf_super2xsai;
 extern AVFilter ff_vf_swaprect;
 extern AVFilter ff_vf_swapuv;
diff --git a/libavfilter/vf_hellosubs.c b/libavfilter/vf_hellosubs.c
new file mode 100644
index 000..7ba3a0e
--- /dev/null
+++ b/libavfilter/vf_hellosubs.c
@@ -0,0 +1,463 @@
+/*
+ * Copyright (c) 2011 Baptiste Coudurier
+ * Copyright (c) 2011 Stefano Sabatini
+ * Copyright (c) 2012 Clément Bœsch
+ *
+ * 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
+ */
+
+/**
+ * @file
+ * Libass hellosubs burning filter.
+ *
+ * @see{http://www.matroska.org/technical/specs/hellosubs/ssa.html}
+ */
+
+#include 
+
+#include "config.h"
+#if CONFIG_SUBTITLES_FILTER
+# include "libavcodec/avcodec.h"
+# include "libavformat/avformat.h"
+#endif
+#include "libavutil/avstring.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/opt.h"
+#include "libavutil/parseutils.h"
+#include "drawutils.h"
+#include "avfilter.h"
+#include "internal.h"
+#include "formats.h"
+#include "video.h"
+#include 
+
+typedef struct AssContext {
+const AVClass *class;
+ASS_Library  *library;
+ASS_Renderer *renderer;
+ASS_Track*track;
+char *filename;
+char *fontsdir;
+char *charenc;
+char *force_style;
+int stream_index;
+int alpha;
+uint8_t rgba_map[4];
+int pix_step[4];   ///< steps per pixel for each plane of the
main output
+int original_w, original_h;
+int shaping;
+FFDrawContext draw;
+} AssContext;
+
+#define OFFSET(x) offsetof(AssContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+
+#define COMMON_OPTIONS \
+{"filename",   "set the filename of file to
read", OFFSET(filename),   AV_OPT_TYPE_STRING,
{.str = NULL},  CHAR_MIN, CHAR_MAX, FLAGS }, \
+{"f",  "set the filename of file to
read", OFFSET(filename),   AV_OPT_TYPE_STRING,
{.str = NULL},  CHAR_MIN, CHAR_MAX, FLAGS }, \
+{"original_size",  "set the size of the original video (used to scale
fonts)", OFFSET(original_w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL},
CHAR_MIN, CHAR_MAX, FLAGS }, \
+{"fontsdir", 

[FFmpeg-devel] FFmpeg filter for real time captioning.

2018-04-06 Thread ANURAG SINGH IIT BHU
How to write a ffmpeg-libavfilter filter which outputs a "Hello World
minute:sec" subtitle each second.The filter should produce packets/frames
of subtitles in a AVMEDIA_TYPE_SUBTITLE stream output from the avfilter.The
output from the filter should be passed through the filter chain back into
the application (ffmpeg*.c).


‌
 Sent with Mailtrack

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