Re: [FFmpeg-devel] [PATCH v12] - Added Turing codec interface for ffmpeg
Dear Ali, > Is the Turing Codec interface patch going to be pushed after the fix of flag > problem ? The problem with the static flag is already fixed in the current version of the patch (v12). If you want to test it, you can manually copy the patch and apply it on top of the latest ffmpeg HEAD. Thanks, Saverio ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v12] - Added Turing codec interface for ffmpeg
2017-07-17 14:19 GMT+03:00 Saverio Blasi : > >> Thanks a lot, this makes sense. I thought that flag was compulsory and > therefore we only included linking against libraries in "Libs.private" in > the pc file. I have just pushed a fix to the Turing repo to include that in > the Libs as well. > >> > >> I have tested this and it seems to work fine in my machine and in the > Docker with Ubuntu and debian with and without the flag now. No changes are > needed to the actual patch, it should work as long as you update Turing to > the latest commit. > > > So we have now further tested this extensively in different machines. I > believe the problems with linking against dynamic libraries are solved in v > 12 of the patch. In all our tests the patch works correctly with either > settings of the pkg-config-flags. Could you please help us and confirm that > this is the case? I think this was the only blocker with this latest > version of the patch? > > Thanks, > > Saverio Blasi > Senior Research Engineer > BBC Research & Development > Centre House|56 Wood Lane|London|W12 7SB > > > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > Is the Turing Codec interface patch going to be pushed after the fix of flag problem ? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v12] - Added Turing codec interface for ffmpeg
>> Thanks a lot, this makes sense. I thought that flag was compulsory and >> therefore we only included linking against libraries in "Libs.private" in >> the pc file. I have just pushed a fix to the Turing repo to include that in >> the Libs as well. >> >> I have tested this and it seems to work fine in my machine and in the Docker >> with Ubuntu and debian with and without the flag now. No changes are needed >> to the actual patch, it should work as long as you update Turing to the >> latest commit. So we have now further tested this extensively in different machines. I believe the problems with linking against dynamic libraries are solved in v 12 of the patch. In all our tests the patch works correctly with either settings of the pkg-config-flags. Could you please help us and confirm that this is the case? I think this was the only blocker with this latest version of the patch? Thanks, Saverio Blasi Senior Research Engineer BBC Research & Development Centre House|56 Wood Lane|London|W12 7SB ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v12] - Added Turing codec interface for ffmpeg
>>In other words, it's just an example in the wiki. It's one way to do it, but >>that doesn't mean it's *the* way to do it. Building against dynamic libs is >>certainly much more common if those are (at least for the most part) provided >>by the "system" (distribution or what have you). >> >>Both options must work. Thanks a lot, this makes sense. I thought that flag was compulsory and therefore we only included linking against libraries in "Libs.private" in the pc file. I have just pushed a fix to the Turing repo to include that in the Libs as well. I have tested this and it seems to work fine in my machine and in the Docker with Ubuntu and debian with and without the flag now. No changes are needed to the actual patch, it should work as long as you update Turing to the latest commit. Thanks a lot for your help with this, Saverio ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v12] - Added Turing codec interface for ffmpeg
On Wed, Jul 05, 2017 at 17:42:31 +0100, Derek Buitenhuis wrote: > Passing --static to pkg-config is the de-facto way to build FFmpeg > with static libraries. In other words, it's just an example in the wiki. It's one way to do it, but that doesn't mean it's *the* way to do it. Building against dynamic libs is certainly much more common if those are (at least for the most part) provided by the "system" (distribution or what have you). Both options must work. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v12] - Added Turing codec interface for ffmpeg
On 7/5/2017 5:36 PM, wm4 wrote: > These pkg-config flag additions in the Ubuntu instructions are pretty > unusual. Passing --static to pkg-config is the de-facto way to build FFmpeg with static libraries. - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v12] - Added Turing codec interface for ffmpeg
On Wed, 5 Jul 2017 15:49:53 + Saverio Blasi wrote: > >>2. Not used --pkg-config-flags--static and thus missed including the > >>(unfortunately non-namespaced) embedded boost libraries. > >> > >>I followed the example instructions in > >>https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#ffmpeg (at the top of > >>the page it says "Compile FFmpeg on Ubuntu, Debian, or Mint") for the > >>build. > > I have in fact tried the same steps removing the > --pkg-config-flags="--static" and I could replicate that behaviour. I believe > though that anyone trying to build this following the official instructions > would not incur in this error? > These pkg-config flag additions in the Ubuntu instructions are pretty unusual. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v12] - Added Turing codec interface for ffmpeg
>>2. Not used --pkg-config-flags--static and thus missed including the >>(unfortunately non-namespaced) embedded boost libraries. >> >>I followed the example instructions in >>https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#ffmpeg (at the top of >>the page it says "Compile FFmpeg on Ubuntu, Debian, or Mint") for the build. I have in fact tried the same steps removing the --pkg-config-flags="--static" and I could replicate that behaviour. I believe though that anyone trying to build this following the official instructions would not incur in this error? Any help would be appreciated, I am not sure how to proceed with this. Thank you very much for your time, Saverio ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v12] - Added Turing codec interface for ffmpeg
2. Not used --pkg-config-flags--static and thus missed including the (unfortunately non-namespaced) embedded boost libraries. I followed the example instructions in https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#ffmpeg (at the top of the page it says "Compile FFmpeg on Ubuntu, Debian, or Mint") for the build. Saverio - http://www.bbc.co.uk This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated. If you have received it in error, please delete it from your system. Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. Please note that the BBC monitors e-mails sent or received. Further communication will signify your consent to this. - ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v12] - Added Turing codec interface for ffmpeg
On 7/5/2017 3:56 PM, Saverio Blasi wrote: > RUN cmake -DCMAKE_INSTALL_PREFIX="/source/ffmpeg/ffmpeg_build" .. && \ > make && \ > make install > WORKDIR /source/ffmpeg > COPY 0001-Added-Turing-codec-interface-for-ffmpeg.patch /source/ffmpeg > RUN git apply 0001-Added-Turing-codec-interface-for-ffmpeg.patch && \ > PKG_CONFIG_PATH="/source/ffmpeg/ffmpeg_build/lib/pkgconfig" ./configure > --prefix="/source/ffmpeg/ffmpeg_build" \ > --pkg-config-flags="--static" > --extra-cflags="-I/source/ffmpeg/ffmpeg_build/include" \ > --extra-ldflags="-L/source/ffmpeg/ffmpeg_build/lib" > --bindir="/source/ffmpeg" --enable-gpl --enable-libturing && \ > make It's possible he did two things. He may have 1. Built libturing as a shared library. or 2. Not used --pkg-config-flags--static and thus missed including the (unfortunately non-namespaced) embedded boost libraries. - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v12] - Added Turing codec interface for ffmpeg
>>So I did try to build this, but the ffmpeg configure check apparently fails >>at picking it up and dumps 3.5MB of C++ linker errors into the config.log. >>And I have no idea why it does that. configure actually prints "ERROR: >>libturing not found using pkg-config", but the .pc part seems to be ok, but >>maybe the check_cpp_condition call tries to link. >> >>The first error is: >> >>lib/libturing.a(encode.cpp.o): In function `operator<<(std::ostream&, res idual_coding)': encode.cpp:(.text+0xf6e): undefined reference to `std::basic_ostream >>& std::operator<< >(std::basic_ostream>std::char_traits >&, char const*)' >> >>The .pc file actually contains -lstdc++. Going by the linker error, this is >>probably what's needed? >> >>I have no idea why this error happens, but it seems a deal breaker. I'm using >>gcc on Debian, and built libturing with a standard cmake invocation. Thanks a lot for trying this out. I am struggling a bit to replicate this error. I am using Ubuntu in my local machine but I have also just tried with a clean Debian installation in a Docker container. The Dockerfile clones both ffmpeg and Turing repositories, applies the patch as from the email, builds and installs the Turing library in a specific folder, and finally configures and builds ffmpeg succesfully. I am not quite sure what the difference could be with your workflow. Which version of gcc are you using? I have tested this with gcc 6. .I have also tried with an old Linux machine with 4.8.2 and that works as well. If I understand correctly, you are able to successfully build Turing and the problem happens later when configuring ffmpeg, is this correct? Below is the Dockerfile I have used for your reference, maybe I am doing something wrong in there which prevents me from catching this error. Any help in resolving this would be very much appreciated. Thanks a lot for your help, and sorry for using up your time. Saverio FROM debian:latest RUN apt-get -y update && \ apt-get -y install cmake && \ apt-get -y install git && \ apt-get -y install build-essential && \ apt-get -y install pkg-config && \ apt-get -y install yasm RUN mkdir source WORKDIR /source/ RUN mkdir /source/ffmpeg && git clone https://github.com/FFmpeg/FFmpeg.git /source/ffmpeg && \ mkdir /source/turingcodec && git clone https://github.com/bbc/turingcodec.git /source/turingcodec && \ mkdir /source/ffmpeg/ffmpeg_build && \ mkdir /source/turingcodec/build WORKDIR /source/turingcodec/build RUN cmake -DCMAKE_INSTALL_PREFIX="/source/ffmpeg/ffmpeg_build" .. && \ make && \ make install WORKDIR /source/ffmpeg COPY 0001-Added-Turing-codec-interface-for-ffmpeg.patch /source/ffmpeg RUN git apply 0001-Added-Turing-codec-interface-for-ffmpeg.patch && \ PKG_CONFIG_PATH="/source/ffmpeg/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/source/ffmpeg/ffmpeg_build" \ --pkg-config-flags="--static" --extra-cflags="-I/source/ffmpeg/ffmpeg_build/include" \ --extra-ldflags="-L/source/ffmpeg/ffmpeg_build/lib" --bindir="/source/ffmpeg" --enable-gpl --enable-libturing && \ make ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v12] - Added Turing codec interface for ffmpeg
On Tue, 4 Jul 2017 14:54:31 + Saverio Blasi wrote: > - This patch contains the changes to interface the Turing codec > (http://turingcodec.org/) with ffmpeg. The patch was modified to address the > comments in the review as follows: > - Added a pkg-config file to list all dependencies required by libturing. > This should address the issue pointed out by Hendrik Leppkes on Fri 18/11/2016 > - As per suggestions of wm4, two functions (add_option and > finalise_options) have been created. The former appends new options while the > latter sets up the argv array of pointers to char* accordingly. add_option > re-allocates the buffer for options using av_realloc > - Additionally, both these functions handle the errors in case the memory > wasn't allocated correctly > - malloc|free|realloc have been substituted with their corresponding > av_{malloc|free|realloc} version > - Check on bit-depth has been removed since the ffmpeg already casts the > right pix_fmt and bit depth > - pix_fmts is now set in ff_libturing_encoder as in h264dec.c. > - Changed usage of av_free with av_freep and fixed calls to free arrays > - Added brackets to all if and for statements > - Avoid repetition of code to free arrays in case of failure to initialise > the libturing encoder > - Some fixes to address the review from wm4 and Mark Thompson received on > Wed 08/02/2017 > - Fixed indentation > - Version bump, removed strcpy() and excluding bool use in headers > --- > LICENSE.md | 1 + > configure | 6 + > libavcodec/Makefile| 1 + > libavcodec/allcodecs.c | 1 + > libavcodec/libturing.c | 318 > + > 5 files changed, 327 insertions(+) > create mode 100755 libavcodec/libturing.c > > diff --git a/LICENSE.md b/LICENSE.md > index ba65b05..03787c0 100644 > --- a/LICENSE.md > +++ b/LICENSE.md > @@ -84,6 +84,7 @@ The following libraries are under GPL: > - frei0r > - libcdio > - librubberband > +- libturing > - libvidstab > - libx264 > - libx265 > diff --git a/configure b/configure > index 282114d..d450f2f 100755 > --- a/configure > +++ b/configure > @@ -253,6 +253,7 @@ External library support: >--enable-libssh enable SFTP protocol via libssh [no] >--enable-libtesseractenable Tesseract, needed for ocr filter [no] >--enable-libtheora enable Theora encoding via libtheora [no] > + --enable-libturing enable H.265/HEVC encoding via libturing [no] >--enable-libtwolame enable MP2 encoding via libtwolame [no] >--enable-libv4l2 enable libv4l2/v4l-utils [no] >--enable-libvidstab enable video stabilization using vid.stab [no] > @@ -1497,6 +1498,7 @@ EXTERNAL_LIBRARY_GPL_LIST=" > frei0r > libcdio > librubberband > +libturing > libvidstab > libx264 > libx265 > @@ -2893,6 +2895,7 @@ libspeex_decoder_deps="libspeex" > libspeex_encoder_deps="libspeex" > libspeex_encoder_select="audio_frame_queue" > libtheora_encoder_deps="libtheora" > +libturing_encoder_deps="libturing" > libtwolame_encoder_deps="libtwolame" > libvo_amrwbenc_encoder_deps="libvo_amrwbenc" > libvorbis_decoder_deps="libvorbis" > @@ -5896,6 +5899,9 @@ enabled libssh&& require_pkg_config libssh > libssh/sftp.h sftp_init > enabled libspeex && require_pkg_config speex speex/speex.h > speex_decoder_init -lspeex > enabled libtesseract && require_pkg_config tesseract tesseract/capi.h > TessBaseAPICreate > enabled libtheora && require libtheora theora/theoraenc.h > th_info_init -ltheoraenc -ltheoradec -logg > +enabled libturing && require_pkg_config libturing turing.h > turing_version && > + { check_cpp_condition turing.h > "TURING_API_VERSION > 1" || > + die "ERROR: libturing requires turing api > version 2 or greater."; } > enabled libtwolame&& require libtwolame twolame.h twolame_init > -ltwolame && > { check_lib libtwolame twolame.h > twolame_encode_buffer_float32_interleaved -ltwolame || > die "ERROR: libtwolame must be installed and > version must be >= 0.3.10"; } > diff --git a/libavcodec/Makefile b/libavcodec/Makefile > index b440a00..13a19ff 100644 > --- a/libavcodec/Makefile > +++ b/libavcodec/Makefile > @@ -910,6 +910,7 @@ OBJS-$(CONFIG_LIBSHINE_ENCODER) += libshine.o > OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o > OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o > OBJS-$(CONFIG_LIBTHEORA_ENCODER) += libtheoraenc.o > +OBJS-$(CONFIG_LIBTURING_ENCODER) += libturing.o > OBJS-$(CONFIG_LIBTWOLAME_ENCODER) += libtwolame.o > OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o > OBJS-$(CONFIG_LIBVORBIS_DECODER) += libvorbisdec.o > diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c > index 0