Compiling from Master: fails on avformat_new_stream
Added by Prof Yaffle almost 12 years ago
Summary: some sleuthing here leads me to think that you're now relying on a later version of ffmpeg than ships with at least Oneiric (0.7.6-4:0.7.6-0ubuntu0.11.10.2) - I think that you're now relying on functions in libavformat that aren't there in my version, perhaps as of this commit. That's going to cause self-build problems, but will it also create dependency issues if you're expecting shared libraries? Do we need to move users to specific PPAs for later ffmpeg packages?
./configure --disable-libav works around it for now, though...
My system was failing to build tvheadend because the -Werror flag in the Makefile was stopping it on a couple of warnings:
/home/xbmc/tvheadend/src/muxer/muxer_libav.c: In function ‘lav_muxer_add_stream’: /home/xbmc/tvheadend/src/muxer/muxer_libav.c:69:3: error: implicit declaration of function ‘avformat_new_stream’ [-Werror=implicit-function-declaration] /home/xbmc/tvheadend/src/muxer/muxer_libav.c:69:6: error: assignment makes pointer from integer without a cast [-Werror] cc1: all warnings being treated as errors make: *** [build.linux/src/muxer/muxer_libav.o] Error 1
Over-riding this (no matter how rash!) finally got me to a real error:
xbmc@revo:~/tvheadend$ make -j4 CC build.linux/src/main.o CC build.linux/src/utils.o ... ... all the modules that worked okay ... ... CC build.linux/src/cwc.o CC build.linux/src/capmt.o /home/xbmc/tvheadend/src/muxer/muxer_libav.c: In function ‘lav_muxer_add_stream’: /home/xbmc/tvheadend/src/muxer/muxer_libav.c:69:3: warning: implicit declaration of function ‘avformat_new_stream’ [-Wimplicit-function-declaration] /home/xbmc/tvheadend/src/muxer/muxer_libav.c:69:6: warning: assignment makes pointer from integer without a cast [enabled by default] CC build.linux/src/ffdecsa/ffdecsa_interface.o CC build.linux/src/ffdecsa/ffdecsa_sse2.o CC build.linux/src/version.o CC build.linux/tvheadend ./build.linux/src/muxer/muxer_libav.o: In function `lav_muxer_add_stream': /home/xbmc/tvheadend/src/muxer/muxer_libav.c:69: undefined reference to `avformat_new_stream' collect2: ld returned 1 exit status make: *** [build.linux/tvheadend] Error 1
Looking at the tvh code, there's no declaration for this function, so it's clearly intended to be brought in from elsewhere (ffmpeg is my guess, since libavformat is their demesne). Looking at my system include files (/usr/include), though, I can find no reference to avformat_new_stream.
Checking on a later ffmpeg code I downloaded for compskip, and - lo and behold - libavformat/avformat.h does indeed include the function declaration for avformat_new_stream. So I suspect it appears in ffmpeg between 0.7.6 and now...
Replies (4)
RE: Compiling from Master: fails on avformat_new_stream - Added by Phill Lavender almost 12 years ago
Yep. Same issue here. I even tried libavformat-dev from the oneric ppas and the now depreciated av_new_steam is still the only function defined in the usr/include/libavformat/avformat.h
RE: Compiling from Master: fails on avformat_new_stream - Added by Phill Lavender almost 12 years ago
Not sure if it help but i installed Jon Severinsson's FFmpeg PPA as if was listed on the ffmpeg website.
Now compiles properly.
RE: Compiling from Master: fails on avformat_new_stream - Added by Prof Yaffle almost 12 years ago
Phil - thanks for that - yes, I considered the same, but I don't know what that's likely to break on the system (any application that goes looking for the ffmpeg libraries may have a problem if the functions in those libraries have changed).
As I understand, ffmpeg 0.7 is backwardly-compatible with 0.5 and 0.6; 1.0 works with applications expecting 0.8 and 0.9; and after that you're fine because ffmpeg installs alongside libav, which is what ships as default with later 'buntus instead of ffmpeg (though I'm not sure how that works for the header files and includes, since I thought they had the same names). So moving from 0.7 to anything later does present some risk, but I've no idea to what...!
For info, compiling with --disable-libav seems to knock out the .mkv container - [[link]].
RE: Compiling from Master: fails on avformat_new_stream - Added by Prof Yaffle almost 12 years ago
Okay, I think I've succesfully built it against a later ffmpeg without a global install as Phil did - I haven't had a chance to test it yet, but it's certainly linked okay.
See [[this post]]. You'll need to knock it around a bit if you want to install ffmpeg somewhere else, but you should also be able to slavishly follow the instructions and not break anything.