bugGNU Octave - Bugs: bug #56985, [octave forge] (video) cannot find...

 
 

bug #56985: [octave forge] (video) cannot find avformat.h on Fedora

Submitted by:  Colin Macdonald <cbm>
Submitted on:  Thu 03 Oct 2019 02:28:28 AM UTC  
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Installation Failure
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  GNU/Linux

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Sat 05 Oct 2019 11:53:50 AM UTC, comment #7: 

It would probally be good if configure could detect which one of each defines to use so that older versions of ffmpeg also worked.

John Donoghue <lostbard>
Project Member
Sat 05 Oct 2019 11:51:45 AM UTC, comment #6: 

Something like:

--- a/src/configure.ac  Sat Oct 05 10:31:13 2019 +0200
+++ b/src/configure.ac  Sat Oct 05 07:46:21 2019 -0400
@@ -28,6 +28,16 @@
PKG_CHECK_MODULES([FFMPEG], [libswscale, libavformat, libavcodec], [],
   [AC_MSG_ERROR([FFmpeg libswscale, libavformat or libavcodec not found])])

+# Checks for header files.
+saved_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $FFMPEG_CFLAGS"
+AC_CHECK_HEADERS([ffmpeg/avformat.h], [], [AC_CHECK_HEADERS([libavformat/avformat.h], [],
+  AC_MSG_ERROR([FFMpeg header avformat.h not found]))])
+
+AC_CHECK_HEADERS([ffmpeg/avcodec.h], [], [AC_CHECK_HEADERS([libavcodec/avcodec.h], [],
+  AC_MSG_ERROR([FFMpeg header avcodec.h not found]))])
+CPPFLAGS=$saved_CPPFLAGS
+
## FIMXE: Check if needed on CentOS 7
#AC_CHECK_LIB([avresample], [avresample_close], [],

With the above change in fedora, I then get to:

AVHandler.cc: In member function ‘int AVHandler::setup_read()’:
AVHandler.cc:246:29: error: ‘CODEC_CAP_TRUNCATED’ was not declared in this scope; did you mean ‘AV_CODEC_CAP_TRUNCATED’?
  246 |   if (codec->capabilities & CODEC_CAP_TRUNCATED)
      |                             ^~~~~~~~~~~~~~~~~~~
      |                             AV_CODEC_CAP_TRUNCATED

Which is mentioned on bug #53801

John Donoghue <lostbard>
Project Member
Sat 05 Oct 2019 11:28:54 AM UTC, comment #5: 

The sources still have :

#if defined (HAVE_FFMPEG_AVFORMAT_H)
#include <ffmpeg/swscale.h>
#elif defined(HAVE_LIBAVFORMAT_AVFORMAT_H)
#include <libswscale/swscale.h>
#else
#error "Missing ffmpeg headers"
#endif

Which is set with the AC_CHECK_HEADERS code that was in configure.ac

You will probally need that since even with the use of pkg-config, the path to the headers may still differ on other OSs.

Perhaps do a temporay set of the CPPFLAGS to the value from FFMPEG_CFLAGS, and then do the AC_CHECK_HEADERS calls.

John Donoghue <lostbard>
Project Member
Sat 05 Oct 2019 08:32:43 AM UTC, comment #4: 
Andreas Weber <andy1978>
Project Member
Sat 05 Oct 2019 07:59:13 AM UTC, comment #3: 

Please feel free to push changes to the stable branch.

I've started a new implementation on the devel branch:
https://sourceforge.net/p/octave/video/ci/devel/tree/

using OpenCV code and build a wrapper for GNU Octave around it. And to support the new VideoReader and VideoWriter classdef

I'm happy if you want to help an have a look at https://sourceforge.net/p/octave/video/ci/devel/tree/HACKING if you are able to build the code on fedora

Andreas Weber <andy1978>
Project Member
Fri 04 Oct 2019 02:58:59 AM UTC, comment #2: 

I see the samoe on my fedora machine

I have ffmpeg-devel4.1.4-2.fc30.x86_64 installed from the rpmfusion-free repo.

Running configure I get:

Checking ffmpeg/avformat.h usability... no
checking ffmpeg/avformat.h presence... no
checking for ffmpeg/avformat.h... no
checking libavformat/avformat.h usability... no
checking libavformat/avformat.h presence... no
checking for libavformat/avformat.h... no

And using pkgconfig I get:

$ pkg-config --cflags libavformat
-I/usr/include/ffmpeg

$ pkg-config --cflags libavcodec
-I/usr/include/ffmpeg

Looking for the files, I see:

/usr/include/ffmpeg/libavformat/avformat.h

/usr/include/ffmpeg/libavcodec/avcodec.h

John Donoghue <lostbard>
Project Member
Thu 03 Oct 2019 08:30:06 PM UTC, comment #1: 

Does `pkg-config --cflags libavformat` return "-I/usr/include/ffmpeg" on your system? On Debian it returns "-I/usr/include/x86_64-linux-gnu", which is on the default include search path. Maybe the video package should rely on pkg-config libavformat, assuming it's widely available. I just tried a Fedora 30 docker image, but I'm not sure how to install ffmpeg-devel.

Mike Miller <mtmiller>
Project Administrator
Thu 03 Oct 2019 02:28:28 AM UTC, original submission:  

I tried install the hg tip version of octave-video:

configure: error: FFMpeg header avformat.h not found
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for mkoctfile... yes
checking for pthread_create in -lpthread... yes
checking for av_mallocz in -lavutil... yes
checking for sws_scale in -lswscale... yes
checking for av_frame_alloc in -lavcodec... yes
checking for av_write_frame in -lavformat... yes
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking ffmpeg/avformat.h usability... no
checking ffmpeg/avformat.h presence... no
checking for ffmpeg/avformat.h... no
checking libavformat/avformat.h usability... no
checking libavformat/avformat.h presence... no
checking for libavformat/avformat.h... no

pkg: error running the configure script for video.
make: *** [Makefile:82: install] Error 1
[octave-video.hg]

I noticed there is "ffmpeg/libavformat/avformat.h" on my machine:

# locate -i avformat.h
/usr/include/ffmpeg/libavformat/avformat.h

This is from the ffmpeg-devel package.

Colin Macdonald <cbm>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by andy1978 (Posted a comment)
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by cbm (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.5