motion: upgrade to latest version

This commit is contained in:
Joo Aun Saw 2019-10-30 11:49:33 +11:00
parent afe0465191
commit 49cd141cf1
4 changed files with 2 additions and 96 deletions

View File

@ -1,75 +0,0 @@
commit 6c47f0cded1ef1f119f91f2c6f572d6620776dff
Author: Joo Aun Saw <jasaw@dius.com.au>
Date: Wed Oct 23 10:45:13 2019 +1100
ffmpeg: do not encode NAL as the first video frame
diff --git a/src/ffmpeg.c b/src/ffmpeg.c
index 3af961a..76f3824 100644
--- a/src/ffmpeg.c
+++ b/src/ffmpeg.c
@@ -192,16 +192,17 @@ static void ffmpeg_free_nal(struct ffmpeg *ffmpeg){
}
}
-static void ffmpeg_encode_nal(struct ffmpeg *ffmpeg){
+static int ffmpeg_encode_nal(struct ffmpeg *ffmpeg){
// h264_v4l2m2m has NAL units separated from the first frame, which makes
// some players very unhappy.
if ((ffmpeg->pkt.pts == 0) && (!(ffmpeg->pkt.flags & AV_PKT_FLAG_KEY))) {
ffmpeg_free_nal(ffmpeg);
ffmpeg->nal_info_len = ffmpeg->pkt.size;
ffmpeg->nal_info = malloc(ffmpeg->nal_info_len);
- if (ffmpeg->nal_info)
+ if (ffmpeg->nal_info) {
memcpy(ffmpeg->nal_info, &ffmpeg->pkt.data[0], ffmpeg->nal_info_len);
- else
+ return 1;
+ } else
ffmpeg->nal_info_len = 0;
} else if (ffmpeg->nal_info) {
int old_size = ffmpeg->pkt.size;
@@ -210,6 +211,7 @@ static void ffmpeg_encode_nal(struct ffmpeg *ffmpeg){
memcpy(&ffmpeg->pkt.data[0], ffmpeg->nal_info, ffmpeg->nal_info_len);
ffmpeg_free_nal(ffmpeg);
}
+ return 0;
}
static int ffmpeg_timelapse_exists(const char *fname){
@@ -463,7 +465,10 @@ static int ffmpeg_encode_video(struct ffmpeg *ffmpeg){
}
if (ffmpeg->preferred_codec == USER_CODEC_V4L2M2M){
- ffmpeg_encode_nal(ffmpeg);
+ if (ffmpeg_encode_nal(ffmpeg)) {
+ // Throw special return code
+ return -2;
+ }
}
return 0;
@@ -489,7 +494,10 @@ static int ffmpeg_encode_video(struct ffmpeg *ffmpeg){
/* This kills compiler warnings. Nal setting is only for recent ffmpeg versions*/
if (ffmpeg->preferred_codec == USER_CODEC_V4L2M2M){
- ffmpeg_encode_nal(ffmpeg);
+ if (ffmpeg_encode_nal(ffmpeg)) {
+ // Throw special return code
+ return -2;
+ }
}
return 0;
@@ -529,7 +537,10 @@ static int ffmpeg_encode_video(struct ffmpeg *ffmpeg){
/* This kills compiler warnings. Nal setting is only for recent ffmpeg versions*/
if (ffmpeg->preferred_codec == USER_CODEC_V4L2M2M){
- ffmpeg_encode_nal(ffmpeg);
+ if (ffmpeg_encode_nal(ffmpeg)) {
+ // Throw special return code
+ return -2;
+ }
}
return 0;

View File

@ -1,19 +0,0 @@
commit 54030816e03a31b8af3c53132636bb9bb97b0673
Author: Joo Aun Saw <jasaw@dius.com.au>
Date: Wed Oct 23 00:55:31 2019 +1100
use current frame timestamp as movie initial PTS reference point
diff --git a/src/motion.c b/src/motion.c
index e394c19..9d3cd24 100644
--- a/src/motion.c
+++ b/src/motion.c
@@ -536,7 +536,7 @@ static void motion_detected(struct context *cnt, int dev, struct image_data *img
/* EVENT_FIRSTMOTION triggers on_event_start_command and event_ffmpeg_newfile */
event(cnt, EVENT_FIRSTMOTION, img, NULL, NULL,
- &cnt->imgs.image_ring[cnt->imgs.image_ring_out].timestamp_tv);
+ &img->timestamp_tv);
MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, _("Motion detected - starting event %d"),
cnt->event_nr);

View File

@ -1,5 +1,5 @@
# locally computed hash
sha256 2074b935bdfe28f84c2c3233274b06908336778f303bb13530d4299c3f8aa4e2 motion-release-4.1.1.tar.gz
sha256 c8d40976b41da8eb9f9f7128599403a312fc26b7226bf3787d75f78cb5a6cc6e motion-release-4.2.2.tar.gz
sha256 dba1d32c9a777f4e822d26ded25f24072b7234c70dc9850f8ea61564c0a8eca5 motion-5c8ac5282b3e980270555c1d2c6f710829a2856e.tar.gz
sha256 3cd3492701f8a097ac9f594e4235417c10e0a5f92d591cd2a8f3f86efca4c64c motion-8f18946261ebee45a33ce423c9154b0f94997b51.tar.gz

View File

@ -4,7 +4,7 @@
#
################################################################################
MOTION_VERSION = 5c8ac5282b3e980270555c1d2c6f710829a2856e
MOTION_VERSION = 8f18946261ebee45a33ce423c9154b0f94997b51
MOTION_SITE = $(call github,Motion-Project,motion,$(MOTION_VERSION))
MOTION_AUTORECONF = YES
MOTION_DEPENDENCIES = host-pkgconf ffmpeg jpeg libmicrohttpd