Commit Graph

48 Commits

Author SHA1 Message Date
Isaac Connor 655e54db17 remove unused directbuffer 2021-01-07 09:50:45 -05:00
Isaac Connor dc487f35a9 set packet codec_type 2020-12-27 12:36:33 -05:00
Isaac Connor af94473eb1 remove debug lines about nalType=1 2020-12-27 12:25:23 -05:00
Isaac Connor 085d83b250 frames are allocated in zm_packet now, so remove them 2020-12-27 12:24:34 -05:00
Isaac Connor 57542b01d5 Remove all the scaling and conversion stuff. Use packet->decode. Set keyframe flag. return codes of functions are now -1 for failure, 0 for failure but no error and 1 for success. 2020-12-27 12:02:02 -05:00
Isaac Connor a39a656373 Merge branch 'master' into zma_to_thread 2020-09-29 11:02:40 -04:00
Peter Keresztes Schmidt 8f980a1168 Convert NULL/0 to nullptr
The 0 -> nullptr changes should definitely improve readability.
2020-08-26 22:03:40 +02:00
Isaac Connor 869860bb26 Merge branch 'master' into zma_to_thread 2020-07-21 17:49:39 -04:00
Isaac Connor 7575afc8d5 Merge branch 'master' into zma_to_thread 2020-07-21 17:38:32 -04:00
Isaac Connor 7489d66557 use is_video_stream utility function. 2020-05-07 13:40:32 -04:00
Isaac Connor 4ff341a0f5 Merge branch 'master' into zma_to_thread 2020-05-02 18:03:42 -04:00
Isaac Connor e9b1eacc6d Fix not finding stream with old libs 2020-05-02 11:49:28 -04:00
Isaac Connor a7363a4b36 reduce compiler deprecation warnings by using our zm api's that hide support for older ffmpeg versions 2020-04-24 19:05:58 -04:00
Isaac Connor 09fcbad666 Merge branch 'master' into zma_to_thread 2019-11-30 14:59:39 -05:00
Isaac Connor d1458108f4 Add dimensions wrong check. Add bytes count 2019-11-20 12:43:17 -05:00
Isaac Connor 83e477e6be CaptureAndRecord in remote camera rtsp doesn't work. Remove it. 2019-09-23 10:52:57 -04:00
Isaac Connor 396be10d6f Merge branch 'master' into zma_to_thread 2019-08-22 12:57:00 -04:00
Isaac Connor dd57fd95ce Clean up cruft from videostore api. Fix packetqueue clear_unwanted_packets to take a pre_event_count and take it into consideration when finding the right spot in the queue to start recording. 2019-06-27 11:11:14 -04:00
Isaac Connor 28269eccc3 Fix Remote RTSP Method on newer ffmpeg 2019-04-28 12:05:32 -04:00
Isaac Connor 979b31ffc3 Merge branch 'storageareas' into zma_to_thread 2018-08-11 10:08:30 -04:00
Isaac Connor a745790541 Use 1 for successful return from CaptureAndRecord 2018-06-14 13:27:46 -04:00
Isaac Connor 74650ebc70 simplify Analysis 2017-11-20 11:48:56 -05:00
Isaac Connor ed72017684 add a mutex 2017-11-13 14:35:47 -05:00
Isaac Connor 0e7f475ce8 merge work from zma_to_thread, but not the zma_to_thread part 2017-11-12 11:42:34 -05:00
APHW2 MFGENG d15d36f389 rework, compiles, won't open h264 2017-11-09 11:50:20 -08:00
Isaac Connor cab8c4cd5e cleanup Monitor::Capture. Cleanup the return values from Capture and CaptureAndRecord. <0 is error, 0 is things ok, but no video frame. > 0 means we have a frame. Plus google code style 2017-11-03 13:49:42 -04:00
Isaac Connor b58c9d87c3 wip 2017-10-23 09:51:41 -04:00
Isaac Connor bb50784ed2 braces 2017-05-20 09:53:35 -04:00
Isaac Connor b1f8485969 Fix videostorage (#1885)
* merge relevant c bits to make h264 recording work

* h264 code requires libavresample and boost

* Need libavresample
2017-05-16 12:04:56 -04:00
Isaac Connor c859f7291c Feature h264 videostorage (#1882)
* Moved writing of configure options from Controller to Model.  Fixes #191.

* Initial commit for saving events as videos :)

* Add zm_video.cpp to autotools

* Add zm_video.h to autotools

* Search for MP4V2 header file 3 times: mp4v2/mp4v2.h, mp4v2.h, mp4.h

* Fix serve memory leak

* Few minor code improvements

* Added the ability to override preset, tune, profile and few other improvements

* Correctly write SPS & PPS from x264 encoder headers

* Remove unnessecary SPS & PPS writing code

* Imported missing files from master to feature-h264-videostorage

* Audio support including fixes for dts/pts, split on keyframe and update to mkv extension to prevent ffmpeg problems writing rtsp audio to mp4 containter (header problem)

* Updates to make gcc happy

* Add html5 video control to timeline and event to support mkv playback

* Add zm_videostore.cpp to CMakeLists.txt

* Remove Modern Branch for now

* Fix minor bug

* Option handled added in master, removing duplicate declaration

* Add CaptureandRecord from zm_camera.h

* Putting placeholder in for CaptureAndRecord function

* Removed duplicate code and brackets

* add digest auth file for cmake

Conflicts:
	src/CMakeLists.txt

* Add web dir back into Makefile.am
Revert "Removed web from SUBDIRS in Makefile.am"

This reverts commit d9bbcdf3a9.

* Add CaptureAndRecord to vlc, still need to make it record

* Resolve SegFault on videostore

* Swap to mp4 container

* mp4 changes

* spaces to tabs, hide video stuff if video writer is turned off

* Make timeline open event.mp4 instead of mkv

* Missed mkv in timeline.js

* Fix some issues from the merge conflict

* Resolve post merge build issues with braces

* Fix whitespace

* Update Jpeg and Video options for passthrough options

* Whitespace fix zm_camera.h

* Fix array mkssing comma

* Add support for Jpeg save options for h264 branch snapshot. Might remove altogether if snapshots not needed

* Update VideoStoreData memory size comment

* Change from config.use_mkv_storage to per monitor option VideoWriter from video branch

* Fix bracket issues post merge

* Clean up comments and add av_free_packet

* Convert from event_directory to event file as per Video branch

* Testing videojs for video playback

* Fixed a missing bracket post merge and also SQL_values now used for EventID and Monitors

* bring recent improvements in ffmpeg capture function into captureandrecord

* Remove pict from writeAudioFramePacket as not used

* Add translate options for h264 Storage options in Monitor and update en_gb file

* Cherry-Pick from iconnor - make it compile on ubuntu 15.04.  Which is libav 56.1.0

Conflicts:
	src/zm_ffmpeg.cpp
	src/zm_remote_camera_rtsp.cpp

Conflicts:
	distros/ubuntu1204/changelog

* Clean up videostore code and remove lots of unused code

* proof of concept for dynamic/automatic video rotation using video-js plugin zoomrotate

Conflicts:
	web/skins/classic/views/event.php

* removed redundant field in sql query

Conflicts:
	web/skins/classic/views/event.php

* local storage of video js plugin

* Beautify!

Make the code somewhat readable.

* added missing videojs.zoomrotate.js file

added missing videojs.zoomrotate.js file

* Typo

added missing "

* Added missing brackets

* fix to display thumbnails when only storing snapshot.jpg

* added control for video playback rate

Conflicts:
	web/skins/classic/views/event.php

* dynamically create jpegs from video file for viewing in browser

* fix timeline view for SaveJPEGs monitors (without enabled VideoWriter)

* only expose monitor info which are being used in client

* fix segmentation fault in zma with ubuntu 14.04 and ffmpeg 2.5.8 (gcc 4.8)

when libx264 is not installed

* better way of detecting showing image or video in timeline and event view

instead of Monitor.VideoWriter, Event.DefaultVideo is used, so even if
VideoWriter/SaveJPEG option is changed, a valid image or video will always be
displayed for historical events in both timeline and event view

this also fixes loading videos in timeline view

* Fixes problem of crashing zmc when bad packet arrives causing av_interleaved_write_frame() to return non-zero (-22).  Prefilters common packet issues. Add metadata title to generated video file

* Remove syslog.h

* fixed SaveJPEGs are not working

which is caused in errors introduced when merging with master

* Update README.md

* Fix build warnings specific to h264 branch, unused FrameImg, unused ret and int64_t snprintf issues

* Fix PRId64 issue in travis, builds locally fine, but I can see a gcc version issue here

* Fix PRId64 issue in travis, another try

* Try "STDC_FORMAT_MACROS" to see if that helps Travis on gcc 4.6.3

* Revert space removal around PRId64

* video branch ffmpeg 2.9 fixes

ffmpeg 2.9 patched removed SSE2 CPU

* Add FFMPEGInit back

* use webvvt to overlay timestamp (honoring Monitor.LabelFormat) to videos in timeline and event

also fixed bug which prevented seeking in timeline video preview

* ffmpeg 3.0 API build failure fixes

* Update README.md

* merge all the commits from the messed up iconnor_video branch

* fix whitespace

* revert

* whitespace fixes

* spelling fix

* put back some text

* add these back

* fix spelling mistake

* Steal some packet dumping routines from ffmpeg. Convert them to use our logging routines

* add a test and error message if the codec is not h264

* these have been removed in master

* add a view to check auth and just send the video

* add some comments, and dump filename and AVFormatContext on failure to write header

* add the toggle for RecordAudio so that the checkbox works to turn off Audio

* Must init videoStore in constuctor

* more debug and comments, return checking

* Fix dropped part of sql query.

* fix extra else and some whitespace

* Fix missing } from merge that was preventing building.

* fix tabs

* get rid of use of separator, just use \n

* Restore lost fixes for deprecation

* Why are these failing

* Respect record_audio flag when setting up video file so dont try and initiliase mp4 with unsupported audio

* Forgot that I was trying to solve case of stream is true and record_audio
is false.

* Pass swscale_ctx back in to getCachedContext or it will create new
context every frame and leak memory like a mofo.

* Add libx264-dev and libmp4v2-dev to build requires to save hassle of
ensuring they are installed before build.

* Merge my Rotation/Orientation work and fixes for bad h264 streams

* need arpa/inet for reverse lookups

* pull in the new byte range code for viewing videos

* Move our recording flag deeper into closeevent

* add braces and only call closeEvent if there is an event

* deprecate the z_frame_rate stuff which is deprecated in ffmpeg

* remark out some debugging

* fix for video on stream 1

* fix audio_stream to audio_st

* Ignore bad decodes

* fix problems with content-length causing viewing to not work in chrome/android

* change logic of sending file contents to handle an off by one and be more readable

* Some fixes pointed out by Maxim Romanov.  Also simply the loading of events to not join the Monitors table

* fix to sql for timeline

* added RecordAudio to sql in README

* Use sub queries instead of joins to fix errors when using new mysql defaults.

* fix sql queries

* Dockerfile to build feature-h264-videostorage

* Must cast codec

* add php-acpu as a dependency

* require php5-acpu

* fix typo

* remove extra /

* Add a line for out-of-tree builds to do api/lib/Cake/bootstrap.php

* delete merge conflict files

* delete merge conflict files
2017-05-15 22:02:48 -04:00
Andy Bauer 254fcbcef7 update gpl 2 mailing address in source files 2016-12-26 09:23:16 -06:00
Steve Gilvarry 8452c4bce5 Fix tab to spaces merge issues 2016-04-29 21:27:28 +10:00
Isaac Connor 03b1ced568 tabs to spaces and use 2space indenting 2016-04-04 10:11:48 -04:00
SteveGilvarry 2122d6e443 Fix all the av_picture related deprecations 2016-03-03 01:03:55 +11:00
SteveGilvarry 477e63a878 Reorder RTSPDescribe to avoid -wreorder warnings 2015-11-05 17:19:58 +11:00
SteveGilvarry 5ba13f1a76 ffmpeg 2.9 patched removed SSE2 CPU flags as these are automatically detected
for all ffmpeg versions circa 2010. This commit removes the if statement on
duplicated functions.
2015-11-04 16:24:39 +11:00
SteveGilvarry 51914994f7 Migrating from av_free/av_freep to av_frame_free using libavcodec version
check. Also replaced recently deprecated av_free_packet with av_packet_unref.
2015-11-04 15:30:14 +11:00
Dmitry Smirnov 0ff7a4e616 Replace deprecated FFmpeg API
Fixes FTBFS with ffmpeg-2.9; compatible with ffmpeg-2.8.

Author: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803850
2015-11-03 11:58:23 +11:00
Andrew Bauer a2d7ac86fe add rtsp_describe to RtspThread class 2015-08-21 10:29:54 -05:00
Emmanuel Papin a36b4aa65d Implement version check for ffmpeg and libav (address issue #580) 2015-05-29 17:38:02 +02:00
manupap1 d2e849104c Fix memory leaks with rtsp and a bug 2014-11-14 22:31:03 +01:00
Andy Bauer 549360cabd Merge branch 'zms/videostream-improvements' of https://github.com/Sune1337/ZoneMinder into Sune1337-zms/videostream-improvements
Conflicts:
	src/zm_ffmpeg.h
	src/zm_mpeg.cpp
2014-10-11 15:38:38 -05:00
Sune1337 04b8ecf0a7 Support streaming with zms (using ffmpeg) better
* ZoneMinder compiles with ffmpeg 0.5..master
    * Make VideoStream class able to stream through ffmpeg better.
    * Ability to use fixed quality instead of fixed bitrate (by specifying bitrate 0...100)
    * Format url parameter supports <format>/<encoder> syntax

Details:
    - Redefine av_err2str to a to avoid compiler warning on newer g++'s
    - When using rtp format; if ffmpeg does not have a default codec, use CODEC_ID_MPEG4. (because this is what the default is as of 2.2 when this code was written)
    - Specify ofc->packet_size if rtp format is requested
    - Video generated in a thread to guarantee a constant fps.
    - Move _AVCODECID definition into zm_ffmpeg.h (and use instead of (AV)CodecID
    - Call avformat_network_init because ffmpeg warns about it beeing required soon.
    - increase VideoStream::video_outbuf_size to 4MiB to be able to encode larger pictures
2014-04-25 22:12:58 +02:00
Anton Khirnov 296aa2517b Support building with new libavcodec versions.
CODEC_ID_* has been replaced with AV_CODEC_ID_* upstream.
2014-02-06 08:39:47 +01:00
Edward Barnard 9a06ec51c6 Save a couple of cpu cycles. 2013-12-02 15:37:26 +00:00
Edward Barnard 21946b5854 H264 SPS and PPS frames are now handled correctly 2013-11-30 21:59:04 +00:00
POKKAHOH 33b6e5cd03 Now can recive RTSP stream.
Decode fragmented NAL
Understand sprop-parametr-sets
Don't check unsetted video format (zm_remote_camera_rtsp.cpp)
2013-09-27 15:08:11 +04:00
nextime 33cbd89212 Migrate svn to git 2013-03-17 00:45:21 +01:00