Bug#822555: ffmpeg: please compile with --enable-libtesseract

2016-09-26 Thread Bálint Réczey
Hi Sebastian,

2016-09-24 21:56 GMT+02:00 Sebastian Ramacher :
> Hi
>
> On 2016-09-07 03:33:38, Bálint Réczey wrote:
>> Control: tags -1 confirmed patch
>>
>> Hi Jan,
>>
>> 2016-04-25 12:43 GMT+02:00 Jan Gerber :
>> > Package: ffmpeg
>> > Version: 7:3.0.1-3
>> > Severity: wishlist
>> >
>> > Dear Maintainer,
>> >
>> > FFmpeg 3.0 introduced a new ocr filter that depends on libtesseract.
>> > Would be nice to see this enabled in Debian.
>>
>> I have prepared a patch which may be enough.
>> It needs testing however. Sebastian, what do you think?
>
> I'm not a huge fan of adding more -extra flavors [1], but the patch looks 
> okayish.
> The dh_auto_build-arch override may need to be updated, though.

It seems to still work well since libavfilter is recompiled properly.
The package also works, it performs OCR.

I have tested it using the image and script from here:
http://ffmpeg-users.933282.n4.nabble.com/How-to-use-ocr-filter-td4672454.html

ffprobe -show_entries frame_tags=lavfi.ocr.text -f lavfi -i "movie=img.png,ocr"

One also need to install tesseract-ocr-eng to make it work.

Pushing the commit to ffmpeg.git.

Cheers,
Balint



Bug#822555: ffmpeg: please compile with --enable-libtesseract

2016-09-24 Thread Sebastian Ramacher
Hi

On 2016-09-07 03:33:38, Bálint Réczey wrote:
> Control: tags -1 confirmed patch
> 
> Hi Jan,
> 
> 2016-04-25 12:43 GMT+02:00 Jan Gerber :
> > Package: ffmpeg
> > Version: 7:3.0.1-3
> > Severity: wishlist
> >
> > Dear Maintainer,
> >
> > FFmpeg 3.0 introduced a new ocr filter that depends on libtesseract.
> > Would be nice to see this enabled in Debian.
> 
> I have prepared a patch which may be enough.
> It needs testing however. Sebastian, what do you think?

I'm not a huge fan of adding more -extra flavors [1], but the patch looks 
okayish.
The dh_auto_build-arch override may need to be updated, though.

Cheers

[1] If we wouldn't have had libavcodec-extra for libav, I'd even drop the
libavcodec-extra flavor.
-- 
Sebastian Ramacher


signature.asc
Description: PGP signature


Bug#822555: ffmpeg: please compile with --enable-libtesseract

2016-09-06 Thread Bálint Réczey
Control: tags -1 confirmed patch

Hi Jan,

2016-04-25 12:43 GMT+02:00 Jan Gerber :
> Package: ffmpeg
> Version: 7:3.0.1-3
> Severity: wishlist
>
> Dear Maintainer,
>
> FFmpeg 3.0 introduced a new ocr filter that depends on libtesseract.
> Would be nice to see this enabled in Debian.

I have prepared a patch which may be enough.
It needs testing however. Sebastian, what do you think?

Maybe we could enable some other features as well.

Cheers,
Balint
From 72f545c2900bf65ea44e4f9465b08332c4b0610e Mon Sep 17 00:00:00 2001
From: Balint Reczey 
Date: Tue, 6 Sep 2016 14:34:25 +0200
Subject: [PATCH] Enable OCR using Tesseract in libavfilter-extra*

Closes: 822555
---
 debian/control  | 54 -
 debian/libavfilter-extra6.install   |  1 +
 debian/libavfilter-extra6.install.powerpc   |  2 ++
 debian/libavfilter-extra6.lintian-overrides |  9 +
 debian/rules| 19 +-
 5 files changed, 74 insertions(+), 11 deletions(-)
 create mode 100644 debian/libavfilter-extra6.install
 create mode 100644 debian/libavfilter-extra6.install.powerpc
 create mode 100644 debian/libavfilter-extra6.lintian-overrides

diff --git a/debian/control b/debian/control
index e7bf9d7..2841992 100644
--- a/debian/control
+++ b/debian/control
@@ -68,6 +68,8 @@ Build-Depends:
  libavc1394-dev [linux-any],
 # autodetected: indev 'jack'
  libjack-jackd2-dev,
+# missing dependency of libtesseract-dev #836849
+ libleptonica-dev,
 # autodetected for the tiff decoder
  liblzma-dev,
 # --enable-libmodplug
@@ -108,6 +110,8 @@ Build-Depends:
  libspeex-dev,
 # --enable-libssh
  libssh-gcrypt-dev,
+# --enable-libtesseract (used only in -extra flavor)
+ libtesseract-dev,
 # --enable-libtheora
  libtheora-dev,
 # --enable-libtwolame
@@ -370,13 +374,61 @@ Description: FFmpeg library containing media filters - runtime files
  .
  This package contains the runtime files.
 
+Package: libavfilter-extra6
+Architecture: any
+Section: libs
+Priority: extra
+Multi-Arch: same
+Conflicts: libavfilter6
+Provides: libavfilter-extra
+Pre-Depends:
+ ${misc:Pre-Depends}
+Depends:
+ ${shlibs:Depends},
+ ${misc:Depends}
+Description: FFmpeg library with extra media filters - runtime files
+ FFmpeg is the leading multimedia framework, able to decode, encode, transcode,
+ mux, demux, stream, filter and play pretty much anything that humans and
+ machines have created. It supports the most obscure ancient formats up to the
+ cutting edge.
+ .
+ This library provides a generic audio/video filtering framework containing
+ several filters, sources and sinks.
+ .
+ This package replaces the libavfilter6 package and contains the
+ following additional filters:
+ .
+  * Optical Character Recognition (uses Tesseract)
+ .
+ Because this package links against libraries that are licensed under
+ Apache License 2.0, the resulting binaries are distributed under the
+ GPL version 3 or later.
+
+Package: libavfilter-extra
+Architecture: all
+Section: metapackages
+Priority: extra
+Multi-Arch: foreign
+Depends:
+ libavfilter-extra6,
+ ${misc:Depends}
+Description: FFmpeg library with extra filters (metapackage)
+ FFmpeg is the leading multimedia framework, able to decode, encode, transcode,
+ mux, demux, stream, filter and play pretty much anything that humans and
+ machines have created. It supports the most obscure ancient formats up to the
+ cutting edge.
+ .
+ This metapackage depends on the latest version of the libavfilter variant
+ that offers additional filter support. Application packages can depend
+ on it if they require or suggest this variant in a robust manner.
+
 Package: libavfilter-dev
 Architecture: any
 Section: libdevel
 Multi-Arch: same
 Depends:
  libavcodec-dev (= ${binary:Version}),
- libavfilter6 (= ${binary:Version}),
+ libavfilter6 (= ${binary:Version}) | libavfilter-extra6 (= ${binary:Version}),
  libavformat-dev (= ${binary:Version}),
  libavresample-dev (= ${binary:Version}),
  libavutil-dev (= ${binary:Version}),
diff --git a/debian/libavfilter-extra6.install b/debian/libavfilter-extra6.install
new file mode 100644
index 000..1b2648c
--- /dev/null
+++ b/debian/libavfilter-extra6.install
@@ -0,0 +1 @@
+usr/lib/*/libavfilter.so.*
diff --git a/debian/libavfilter-extra6.install.powerpc b/debian/libavfilter-extra6.install.powerpc
new file mode 100644
index 000..628ec8f
--- /dev/null
+++ b/debian/libavfilter-extra6.install.powerpc
@@ -0,0 +1,2 @@
+usr/lib/*/libavfilter.so.*
+usr/lib/*/*/libavfilter.so.*
diff --git a/debian/libavfilter-extra6.lintian-overrides b/debian/libavfilter-extra6.lintian-overrides
new file mode 100644
index 000..5e6db9b
--- /dev/null
+++ b/debian/libavfilter-extra6.lintian-overrides
@@ -0,0 +1,9 @@
+# According to Debian policy [1], non position independent code is permitted
+# in a shared library on i386 and position independent code may have a
+# performance penalty, especially on i386.
+# 

Bug#822555: ffmpeg: please compile with --enable-libtesseract

2016-04-25 Thread Jan Gerber
Package: ffmpeg
Version: 7:3.0.1-3
Severity: wishlist

Dear Maintainer,

FFmpeg 3.0 introduced a new ocr filter that depends on libtesseract.
Would be nice to see this enabled in Debian.

Thanks for packaging ffmpeg,
j

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.5.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages ffmpeg depends on:
ii  libavcodec57 7:3.0.1-3
ii  libavdevice577:3.0.1-3
ii  libavfilter6 7:3.0.1-3
ii  libavformat577:3.0.1-3
ii  libavresample3   7:3.0.1-3
ii  libavutil55  7:3.0.1-3
ii  libc62.22-7
ii  libpostproc547:3.0.1-3
ii  libsdl1.2debian  1.2.15+dfsg1-4
ii  libswresample2   7:3.0.1-3
ii  libswscale4  7:3.0.1-3
ii  libvdpau11.1.1-3
ii  libx11-6 2:1.6.3-1

ffmpeg recommends no packages.

Versions of packages ffmpeg suggests:
pn  ffmpeg-doc  

-- no debconf information