cptjhmiller / omv-zoneminder

Other
8 stars 1 forks source link

feature-h264-videostorage branch #2

Open lucianconstantin opened 7 years ago

lucianconstantin commented 7 years ago

Hi,

Would be hard to adapt your instructions for the ZoneMinder feature-h264-videostorage branch?

This branch "Passes FFmpeg cameras h264 packets direct to an mp4 container. Best used in Record mode. By it's nature you must have a h264 capable camera using FFmpeg source type, and if you want to record audio it must be compatible with mp4 container, and if you want that to playback in a browser has to be AAC."

It also allows for encoding any camera sources or jpegs to h264, saving space.

cptjhmiller commented 7 years ago

Have you tried building? Looking at the dependency list I can't see any new items so it may just be a difference in the source code so should work.

If you try it and have errors let me know. I have not updated the conversion code for a while so there mabe issues with that.

lucianconstantin commented 7 years ago

I cloned the branch with: git clone -b feature-h264-videostorage https://github.com/ZoneMinder/ZoneMinder.git

Then went through all the steps you described, but it fails with:

[ 27%] Building CXX object src/CMakeFiles/zm.dir/zm_ffmpeg_camera.cpp.o
/zoneminder/ZoneMinder/src/zm_ffmpeg_camera.cpp:27:28: fatal error: libavutil/time.h: No such file or directory
compilation terminated.
make[3]: *** [src/CMakeFiles/zm.dir/zm_ffmpeg_camera.cpp.o] Error 1
make[3]: Leaving directory `/zoneminder/ZoneMinder/obj-x86_64-linux-gnu'
make[2]: *** [src/CMakeFiles/zm.dir/all] Error 2
make[2]: Leaving directory `/zoneminder/ZoneMinder/obj-x86_64-linux-gnu'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/zoneminder/ZoneMinder/obj-x86_64-linux-gnu'
dh_auto_build: make -j1 returned exit code 2
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
cptjhmiller commented 7 years ago

Did you install libavutil-dev and does /usr/local/include/libavutil/time.h exists?

You could try coping /usr/local/include/libavutil to /usr/include/libavutil then try to build again.

lucianconstantin commented 7 years ago

Actually there's nothing in /usr/local/include/ and /usr/include/libavutil exists but doesn't have time.h.

Libavutil-dev is installed. Apt-get returns: libavutil-dev is already the newest version.

cptjhmiller commented 7 years ago

I have the time.h file in my folder, you could try manually installing the package https://packages.debian.org/wheezy-backports/libavutil-dev If you click the list of files it shows time.h should be installed.

lucianconstantin commented 7 years ago

I manually installed the package, but as expected I ended up in dependency hell where it required newer backported versions of other packages, which themselves required newer versions of other packages and so on. After a lot of manual package installs and dependency fixing I got to a point where I could attempt compilation again. This time it went way past 27% but died at some other point and can't figure out why from the error or how to fix it.

[ 82%] Building CXX object src/CMakeFiles/zm.dir/zm_videostore.cpp.o /zoneminder/ZoneMinder/src/zm_videostore.cpp: In constructor ‘VideoStore::VideoStore(const char*, const char*, AVStream*, AVStream*, int64_t, Monitor::Orientation)’: /zoneminder/ZoneMinder/src/zm_videostore.cpp:84:60: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive] In file included from /zoneminder/ZoneMinder/src/zm_ffmpeg.h:142:0, from /zoneminder/ZoneMinder/src/zm_videostore.h:4, from /zoneminder/ZoneMinder/src/zm_videostore.cpp:29: /usr/include/libavformat/avformat.h:1281:11: error: initializing argument 2 of ‘AVStream* avformat_new_stream(AVFormatContext*, AVCodec*)’ [-fpermissive] /zoneminder/ZoneMinder/src/zm_videostore.cpp:138:63: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive] In file included from /zoneminder/ZoneMinder/src/zm_ffmpeg.h:142:0, from /zoneminder/ZoneMinder/src/zm_videostore.h:4, from /zoneminder/ZoneMinder/src/zm_videostore.cpp:29: /usr/include/libavformat/avformat.h:1281:11: error: initializing argument 2 of ‘AVStream* avformat_new_stream(AVFormatContext*, AVCodec*)’ [-fpermissive] /zoneminder/ZoneMinder/src/zm_videostore.cpp: In member function ‘int VideoStore::writeVideoFramePacket(AVPacket*, AVStream*)’: /zoneminder/ZoneMinder/src/zm_videostore.cpp:254:1: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] /zoneminder/ZoneMinder/src/zm_videostore.cpp:261:1: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] /zoneminder/ZoneMinder/src/zm_videostore.cpp: In member function ‘int VideoStore::writeAudioFramePacket(AVPacket*, AVStream*)’: /zoneminder/ZoneMinder/src/zm_videostore.cpp:342:1: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] /zoneminder/ZoneMinder/src/zm_videostore.cpp:351:1: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] /zoneminder/ZoneMinder/src/zm_videostore.cpp:363:1: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] make[3]: *** [src/CMakeFiles/zm.dir/zm_videostore.cpp.o] Error 1 make[3]: Leaving directory/zoneminder/ZoneMinder/obj-x86_64-linux-gnu' make[2]: [src/CMakeFiles/zm.dir/all] Error 2 make[2]: Leaving directory `/zoneminder/ZoneMinder/obj-x86_64-linux-gnu' make[1]: [all] Error 2 make[1]: Leaving directory /zoneminder/ZoneMinder/obj-x86_64-linux-gnu' dh_auto_build: make -j1 returned exit code 2 make: *** [build] Error 2 dpkg-buildpackage: error: debian/rules build gave error exit status 2