LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-31-2021, 08:37 AM   #1
timsoft
Member
 
Registered: Oct 2004
Location: scotland
Distribution: slackware 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 392

Rep: Reputation: 107Reputation: 107
Question Blender and ffmpeg4


Has anyone had success building Blender (sbo slackbuild) with ffmpeg4 instead of ffmpeg3?

It is the only slackbuild I use which so far is refusing to play ball. All the others (qt5, audacity, vlc,kicad, shotcut, obs-studio) seem to be okay with ffmpeg4.

for me it gets as far as....
Quote:
[ 6%] Building C object source/blender/makesrna/intern/CMakeFiles/makesrna.dir/rna_scene.c.o
In file included from /tmp/SBo/blender-2.83.8/source/blender/makesrna/intern/rna_scene.c:64:0:
/tmp/SBo/blender-2.83.8/intern/ffmpeg/ffmpeg_compat.h:23:34: fatal error: libavformat/avformat.h: No such file or directory
compilation terminated.
source/blender/makesrna/intern/CMakeFiles/makesrna.dir/build.make:1238: recipe for target 'source/blender/makesrna/intern/CMakeFiles/makesrna.dir/rna_scene.c.o' failed
make[2]: *** [source/blender/makesrna/intern/CMakeFiles/makesrna.dir/rna_scene.c.o] Error 1
CMakeFiles/Makefile2:6976: recipe for target 'source/blender/makesrna/intern/CMakeFiles/makesrna.dir/all' failed
make[1]: *** [source/blender/makesrna/intern/CMakeFiles/makesrna.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
and in my environment i have
Code:
PKG_CONFIG_PATH=/usr/lib64/ffmpeg4/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/share/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig
 
Old 03-31-2021, 09:41 AM   #2
mumahendras3
Member
 
Registered: Feb 2018
Location: Indonesia
Distribution: Slackware-current with s6 + s6-rc + s6-linux-init
Posts: 105

Rep: Reputation: Disabled
I don't use blender so I can't help further than pointing out below message
Quote:
In file included from /tmp/SBo/blender-2.83.8/source/blender/makesrna/intern/rna_scene.c:64:0:
/tmp/SBo/blender-2.83.8/intern/ffmpeg/ffmpeg_compat.h:23:34: fatal error: libavformat/avformat.h: No such file or directory
So it seems libavformat/avformat.h was missing.
 
Old 03-31-2021, 10:55 AM   #3
timsoft
Member
 
Registered: Oct 2004
Location: scotland
Distribution: slackware 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 392

Original Poster
Rep: Reputation: 107Reputation: 107
Quote:
ls /usr/include/ffmpeg4/libavformat/
produces
Quote:
avformat.h avio.h version.h
which can also be seen from
Quote:
cat /var/log/packages/ffmpeg4-4.3.2-x86_64-1_SBo
package.
so it is there, it is blender that is not finding it.
It must be hard coded where it looks, because pkgconfig finds it thanks to the PKG_CONFIG_PATH env variable for all the other software that uses ffmpeg4 as mentioned in the first post.

I am attempting to create the package with CUDA=no and EMBREE=no

because the build process is large, it is hard to figure out what configuration is created by cmake, and what is not, but all I can say is it doesn't work with ffmpeg4 for me. If anyone has got it to go (with ffmpeg4), please comment how :-)
 
Old 03-31-2021, 11:15 AM   #4
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,121

Rep: Reputation: 5648Reputation: 5648Reputation: 5648Reputation: 5648Reputation: 5648Reputation: 5648Reputation: 5648Reputation: 5648Reputation: 5648Reputation: 5648Reputation: 5648
Blender isn't designed to look for the header files where the ffmpeg4 SlackBuild packages them (/usr/include/ffmpeg4/ to prevent clashing with ffmpeg3). You would need to modify the Blender source to look in the proper locations, or, if you don't intend to have ffmpeg3 installed at all, you could probably symlink the locations or rebuild ffmpeg4 to use just /usr/include).

If you want to change the blender source to point to the correct header locations, it might be quite the hunt. There are probably more ffmpeg headers that blender is going to look for in the wrong location. Just checking for #include <libavformat/avformat.h> shows the following files:

Code:
intern/ffmpeg/ffmpeg_compat.h:#include <libavformat/avformat.h>
extern/audaspace/plugins/ffmpeg/FFMPEGWriter.h:#include <libavformat/avformat.h>
extern/audaspace/plugins/ffmpeg/FFMPEGReader.h:#include <libavformat/avformat.h>
source/blender/imbuf/intern/util.c:#  include <libavformat/avformat.h>
source/blender/imbuf/intern/IMB_anim.h:#  include <libavformat/avformat.h>
source/blender/imbuf/intern/anim_movie.c:#  include <libavformat/avformat.h>
source/blender/python/intern/bpy_app_ffmpeg.c:#  include <libavformat/avformat.h>
source/blender/makesrna/intern/rna_scene.c:#  include <libavformat/avformat.h>
source/blender/blenkernel/intern/writeffmpeg.c:#  include <libavformat/avformat.h>
For your error here, you'd need to add the following into the SlackBuild after you cd into the source directory but before compilation, but you might need to do this with every file listed above:

Code:
sed -i 's|libavformat/avformat.h|ffmpeg4/libavformat/avformat.h|' intern/ffmpeg/ffmpeg_compat.h
In reality, if you don't intend to use ffmpeg3 at all, you could simply change the SlackBuild for ffmpeg4 to remove the --incdir=/usr/include/ffmpeg4 \ line in the ./configure command. It might also be possible to tell blender where to expect the headers for ffmpeg, but I didn't see anything for it in the CMakeLists.txt.
 
1 members found this post helpful.
Old 04-01-2021, 08:53 AM   #5
timsoft
Member
 
Registered: Oct 2004
Location: scotland
Distribution: slackware 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 392

Original Poster
Rep: Reputation: 107Reputation: 107
thanks bassmadrigal. I'm chatting with chris on #slackbuilds (the slackbuild maintainer) and he has come up with some stuff and is looking at it. If we get it going, I'll post the info here for everyone, although it might make it into the slackbuild - you never know :-)
If all fails, I might take up your last suggestion of fixing ffmpeg4 slackbuild. I am only really interested in having one version on my system, provided that all the packages I use will work with that version.
 
Old 04-01-2021, 11:00 PM   #6
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 715

Rep: Reputation: 466Reputation: 466Reputation: 466Reputation: 466Reputation: 466
I've pushed a new iteration of the SlackBuild for Blender to use ffmpeg4 (from SBo's ffmpeg4 SlackBuild). This applies only to Slackware 14.2 (not -current, which has its own ffmpeg4 package). To try it before the next SBo public update, see: https://git.slackbuilds.org/slackbui...illing/updates

It assumes the builder has taken care of any ffmpeg4-related requirements of the prerequisites. Use of ffmpeg4 in the Blender build is dictated by the FORCE_FFMPEG4 environment variable. Enable it with something like:
Code:
    FORCE_FFMPEG4=yes sh Blender.SlackBuild
chris
 
1 members found this post helpful.
Old 04-01-2021, 11:33 PM   #7
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,121

Rep: Reputation: 5648Reputation: 5648Reputation: 5648Reputation: 5648Reputation: 5648Reputation: 5648Reputation: 5648Reputation: 5648Reputation: 5648Reputation: 5648Reputation: 5648
Quote:
Originally Posted by chris.willing View Post
I've pushed a new iteration of the SlackBuild for Blender to use ffmpeg4 (from SBo's ffmpeg4 SlackBuild). This applies only to Slackware 14.2 (not -current, which has its own ffmpeg4 package). To try it before the next SBo public update, see: https://git.slackbuilds.org/slackbui...illing/updates

It assumes the builder has taken care of any ffmpeg4-related requirements of the prerequisites. Use of ffmpeg4 in the Blender build is dictated by the FORCE_FFMPEG4 environment variable. Enable it with something like:
Code:
    FORCE_FFMPEG4=yes sh Blender.SlackBuild
chris
Much better idea than mine!

Minor suggestion if you want to make your sed a bit shorter... You can use the & symbol to duplicate your search in the replacement, meaning you could have the line be:

Code:
sed -i -e "s|env={\"ASAN_OPTIONS\": \"exitcode=0\"|&,\"LD_LIBRARY_PATH\":\"/usr/lib$LIBDIRSUFFIX/ffmpeg4\"}|g" \
  doc/manpage/blender.1.py
Instead of:

Code:
sed -i -e "s|env={\"ASAN_OPTIONS\": \"exitcode=0\"}|env={\"ASAN_OPTIONS\": \"exitcode=0\",\"LD_LIBRARY_PATH\":\"/usr/lib$LIBDIRSUFFIX/ffmpeg4\"}|g" \
  doc/manpage/blender.1.py
In fact, because "exitcode=0" is only used the two times in the file that you need to update, you can simplify the sed even more:

Code:
sed "s|\"exitcode=0\"|&,\"LD_LIBRARY_PATH\":\"/usr/lib$LIBDIRSUFFIX/ffmpeg4\"|g" blender.1.py
 
1 members found this post helpful.
Old 04-02-2021, 02:48 AM   #8
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 715

Rep: Reputation: 466Reputation: 466Reputation: 466Reputation: 466Reputation: 466
Quote:
Originally Posted by bassmadrigal View Post
Minor suggestion if you want to make your sed a bit shorter... You can use the & symbol to duplicate your search in the replacement
Thanks for the tip - I'll try it out and update the update.

[edit: the shortened sed was good so SlackBuild updated. Thanks @bassmadrigal]

chris

Last edited by chris.willing; 04-02-2021 at 03:31 AM.
 
2 members found this post helpful.
Old 04-06-2021, 05:48 AM   #9
timsoft
Member
 
Registered: Oct 2004
Location: scotland
Distribution: slackware 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 392

Original Poster
Rep: Reputation: 107Reputation: 107
many thanks chris.willing and bassmadrigal for solving the problem and adding the ffmpeg4 support to the Blender slackbuild.
 
  


Reply

Tags
blender, ffmpeg4


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Blender 2.63 only runs if I type /opt/blender/blender in cmdline Jeebizz Slackware 6 07-23-2013 05:00 PM
LXer: Getting Your Feet Wet with Blender: A Short Guide to Understanding Blender LXer Syndicated Linux News 0 02-16-2011 01:11 PM
LXer: 12 Unique Blender Tutorials Every Blender Enthusiast Should Know Of LXer Syndicated Linux News 0 10-06-2010 07:42 PM
LXer: The Essential Blender: Guide to 3D Creation with the Open Source Suite Blender LXer Syndicated Linux News 0 11-23-2007 11:00 AM
Blender problem: can't run Blender, anyone know how? Chuong Linux - Software 11 09-01-2006 08:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration