diff --git a/doc/motion_config.html b/doc/motion_config.html
index 0edf51ed..0fc16750 100644
--- a/doc/motion_config.html
+++ b/doc/motion_config.html
@@ -873,6 +873,12 @@
|
native_language |
+
+ |
+ |
+ |
+ netcam_decoder |
+
|
|
@@ -1643,9 +1649,10 @@
netcam_url |
netcam_highres |
netcam_userpass |
- netcam_keepalive |
+ netcam_decoder |
+ | netcam_keepalive |
netcam_proxy |
netcam_tolerant_check |
netcam_use_tcp |
@@ -3051,6 +3058,25 @@
To use no authentication simply remove this option. Digest authentication is only available for rtsp/rtmp cameras.
+ netcam_decoder
+
+
+ - Type: String
+ - Range / Valid values: Max 4095 characters
+ - Default: Not defined
+
+
+ The user requested decoder to use for rtsp/rtmp cameras. Motion will try to open the camera using the decoder
+ specified by this parameter. If it not successful, it will usually fall back to the default decoder. This
+ option may improve performance in certain situations for certain platforms and cameras. Users can find the
+ names of the decoders on their system by going to a command prompt and typing ffmpeg -formats and
+ looking for the name of the decoder with a 'D' next to it and correlating this with the type of image
+ provided from the camera. Note that not all decoders will work with all cameras. If the camera does not
+ open using the requested decoder, specify a different decoder or leave this parameter empty to use the default.
+ Additionally, ffmpeg will only list out the decoders that it was compiled to support. Additional decoders
+ may be available if ffmpeg is compiled from source.
+
+
netcam_keepalive
diff --git a/man/motion.1 b/man/motion.1
index e45de3bd..a016a128 100644
--- a/man/motion.1
+++ b/man/motion.1
@@ -492,6 +492,19 @@ Format is in user:password format when both a user name and password are require
.RE
.RE
+.TP
+.B netcam_decoder
+.RS
+.nf
+Values: User specified string
+Default: Not Defined
+Description:
+.fi
+.RS
+User requested decoder to use for network cameras.
+.RE
+.RE
+
.TP
.B netcam_keepalive
.RS
diff --git a/po/da.po b/po/da.po
index a78634d0..239800c0 100644
--- a/po/da.po
+++ b/po/da.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
-"POT-Creation-Date: 2019-09-28 09:39-0600\n"
+"POT-Creation-Date: 2019-10-27 22:19-0600\n"
"PO-Revision-Date: 2018-10-13 11:59-0600\n"
"Last-Translator: MrDave \n"
"Language-Team: MrDave \n"
@@ -221,6 +221,10 @@ msgstr ""
msgid "netcam_use_tcp"
msgstr ""
+#: src/conf.c
+msgid "netcam_decoder"
+msgstr ""
+
#: src/conf.c
msgid "mmalcam_name"
msgstr ""
@@ -2572,27 +2576,22 @@ msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: av_find_best_stream: %s,Interrupt %s"
+msgid "%s: %s: %s,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_find_decoder: Failed,Interrupt %s"
+msgid "%s: %s: Failed,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_alloc_context3: Failed,Interrupt %s"
+msgid "%s: Ignoring user requested decoder %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_parameters_to_context: %s,Interrupt %s"
-msgstr ""
-
-#: src/netcam_rtsp.c
-#, c-format
-msgid "%s: avcodec_open2: %s,Interrupt %s"
+msgid "%s: Using decoder %s"
msgstr ""
#: src/netcam_rtsp.c
diff --git a/po/de.po b/po/de.po
index 3aea5d44..ecae4a5b 100644
--- a/po/de.po
+++ b/po/de.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
-"POT-Creation-Date: 2019-09-28 09:39-0600\n"
+"POT-Creation-Date: 2019-10-27 22:19-0600\n"
"PO-Revision-Date: 2018-10-13 11:59-0600\n"
"Last-Translator: MrDave \n"
"Language-Team: MrDave \n"
@@ -222,6 +222,10 @@ msgstr ""
msgid "netcam_use_tcp"
msgstr ""
+#: src/conf.c
+msgid "netcam_decoder"
+msgstr ""
+
#: src/conf.c
msgid "mmalcam_name"
msgstr ""
@@ -2573,27 +2577,22 @@ msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: av_find_best_stream: %s,Interrupt %s"
+msgid "%s: %s: %s,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_find_decoder: Failed,Interrupt %s"
+msgid "%s: %s: Failed,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_alloc_context3: Failed,Interrupt %s"
+msgid "%s: Ignoring user requested decoder %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_parameters_to_context: %s,Interrupt %s"
-msgstr ""
-
-#: src/netcam_rtsp.c
-#, c-format
-msgid "%s: avcodec_open2: %s,Interrupt %s"
+msgid "%s: Using decoder %s"
msgstr ""
#: src/netcam_rtsp.c
diff --git a/po/es.po b/po/es.po
index 179b1393..deaec92c 100644
--- a/po/es.po
+++ b/po/es.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
-"POT-Creation-Date: 2019-09-28 09:39-0600\n"
+"POT-Creation-Date: 2019-10-27 22:19-0600\n"
"PO-Revision-Date: 2018-10-13 12:00-0600\n"
"Last-Translator: MrDave \n"
"Language-Team: MrDave \n"
@@ -222,6 +222,10 @@ msgstr ""
msgid "netcam_use_tcp"
msgstr ""
+#: src/conf.c
+msgid "netcam_decoder"
+msgstr ""
+
#: src/conf.c
msgid "mmalcam_name"
msgstr ""
@@ -2573,27 +2577,22 @@ msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: av_find_best_stream: %s,Interrupt %s"
+msgid "%s: %s: %s,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_find_decoder: Failed,Interrupt %s"
+msgid "%s: %s: Failed,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_alloc_context3: Failed,Interrupt %s"
+msgid "%s: Ignoring user requested decoder %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_parameters_to_context: %s,Interrupt %s"
-msgstr ""
-
-#: src/netcam_rtsp.c
-#, c-format
-msgid "%s: avcodec_open2: %s,Interrupt %s"
+msgid "%s: Using decoder %s"
msgstr ""
#: src/netcam_rtsp.c
diff --git a/po/fi.po b/po/fi.po
index 3ad9eb73..d1cb96fc 100644
--- a/po/fi.po
+++ b/po/fi.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
-"POT-Creation-Date: 2019-09-28 09:39-0600\n"
+"POT-Creation-Date: 2019-10-27 22:19-0600\n"
"PO-Revision-Date: 2018-10-13 12:00-0600\n"
"Last-Translator: MrDave \n"
"Language-Team: MrDave \n"
@@ -221,6 +221,10 @@ msgstr ""
msgid "netcam_use_tcp"
msgstr ""
+#: src/conf.c
+msgid "netcam_decoder"
+msgstr ""
+
#: src/conf.c
msgid "mmalcam_name"
msgstr ""
@@ -2572,27 +2576,22 @@ msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: av_find_best_stream: %s,Interrupt %s"
+msgid "%s: %s: %s,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_find_decoder: Failed,Interrupt %s"
+msgid "%s: %s: Failed,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_alloc_context3: Failed,Interrupt %s"
+msgid "%s: Ignoring user requested decoder %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_parameters_to_context: %s,Interrupt %s"
-msgstr ""
-
-#: src/netcam_rtsp.c
-#, c-format
-msgid "%s: avcodec_open2: %s,Interrupt %s"
+msgid "%s: Using decoder %s"
msgstr ""
#: src/netcam_rtsp.c
diff --git a/po/fr.po b/po/fr.po
index df5e1a5f..d753bcc6 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
-"POT-Creation-Date: 2019-09-28 09:39-0600\n"
+"POT-Creation-Date: 2019-10-27 22:19-0600\n"
"PO-Revision-Date: 2018-10-13 12:01-0600\n"
"Last-Translator: MrDave \n"
"Language-Team: MrDave \n"
@@ -225,6 +225,10 @@ msgstr ""
msgid "netcam_use_tcp"
msgstr ""
+#: src/conf.c
+msgid "netcam_decoder"
+msgstr ""
+
#: src/conf.c
msgid "mmalcam_name"
msgstr ""
@@ -2578,27 +2582,22 @@ msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: av_find_best_stream: %s,Interrupt %s"
+msgid "%s: %s: %s,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_find_decoder: Failed,Interrupt %s"
+msgid "%s: %s: Failed,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_alloc_context3: Failed,Interrupt %s"
+msgid "%s: Ignoring user requested decoder %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_parameters_to_context: %s,Interrupt %s"
-msgstr ""
-
-#: src/netcam_rtsp.c
-#, c-format
-msgid "%s: avcodec_open2: %s,Interrupt %s"
+msgid "%s: Using decoder %s"
msgstr ""
#: src/netcam_rtsp.c
diff --git a/po/it.po b/po/it.po
index e8739259..26311af2 100644
--- a/po/it.po
+++ b/po/it.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
-"POT-Creation-Date: 2019-09-28 09:39-0600\n"
+"POT-Creation-Date: 2019-10-27 22:19-0600\n"
"PO-Revision-Date: 2018-10-13 12:02-0600\n"
"Last-Translator: MrDave \n"
"Language-Team: MrDave \n"
@@ -221,6 +221,10 @@ msgstr ""
msgid "netcam_use_tcp"
msgstr ""
+#: src/conf.c
+msgid "netcam_decoder"
+msgstr ""
+
#: src/conf.c
msgid "mmalcam_name"
msgstr ""
@@ -2572,27 +2576,22 @@ msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: av_find_best_stream: %s,Interrupt %s"
+msgid "%s: %s: %s,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_find_decoder: Failed,Interrupt %s"
+msgid "%s: %s: Failed,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_alloc_context3: Failed,Interrupt %s"
+msgid "%s: Ignoring user requested decoder %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_parameters_to_context: %s,Interrupt %s"
-msgstr ""
-
-#: src/netcam_rtsp.c
-#, c-format
-msgid "%s: avcodec_open2: %s,Interrupt %s"
+msgid "%s: Using decoder %s"
msgstr ""
#: src/netcam_rtsp.c
diff --git a/po/ja.po b/po/ja.po
index d29a0cef..975effcd 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
-"POT-Creation-Date: 2019-09-28 09:39-0600\n"
+"POT-Creation-Date: 2019-10-27 22:19-0600\n"
"PO-Revision-Date: 2018-10-13 12:02-0600\n"
"Last-Translator: MrDave \n"
"Language-Team: MrDave \n"
@@ -221,6 +221,10 @@ msgstr ""
msgid "netcam_use_tcp"
msgstr ""
+#: src/conf.c
+msgid "netcam_decoder"
+msgstr ""
+
#: src/conf.c
msgid "mmalcam_name"
msgstr ""
@@ -2572,27 +2576,22 @@ msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: av_find_best_stream: %s,Interrupt %s"
+msgid "%s: %s: %s,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_find_decoder: Failed,Interrupt %s"
+msgid "%s: %s: Failed,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_alloc_context3: Failed,Interrupt %s"
+msgid "%s: Ignoring user requested decoder %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_parameters_to_context: %s,Interrupt %s"
-msgstr ""
-
-#: src/netcam_rtsp.c
-#, c-format
-msgid "%s: avcodec_open2: %s,Interrupt %s"
+msgid "%s: Using decoder %s"
msgstr ""
#: src/netcam_rtsp.c
diff --git a/po/ko.po b/po/ko.po
index 14866e64..a82f59b9 100644
--- a/po/ko.po
+++ b/po/ko.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
-"POT-Creation-Date: 2019-09-28 09:39-0600\n"
+"POT-Creation-Date: 2019-10-27 22:19-0600\n"
"PO-Revision-Date: 2018-10-13 12:02-0600\n"
"Last-Translator: MrDave \n"
"Language-Team: MrDave \n"
@@ -221,6 +221,10 @@ msgstr ""
msgid "netcam_use_tcp"
msgstr ""
+#: src/conf.c
+msgid "netcam_decoder"
+msgstr ""
+
#: src/conf.c
msgid "mmalcam_name"
msgstr ""
@@ -2572,27 +2576,22 @@ msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: av_find_best_stream: %s,Interrupt %s"
+msgid "%s: %s: %s,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_find_decoder: Failed,Interrupt %s"
+msgid "%s: %s: Failed,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_alloc_context3: Failed,Interrupt %s"
+msgid "%s: Ignoring user requested decoder %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_parameters_to_context: %s,Interrupt %s"
-msgstr ""
-
-#: src/netcam_rtsp.c
-#, c-format
-msgid "%s: avcodec_open2: %s,Interrupt %s"
+msgid "%s: Using decoder %s"
msgstr ""
#: src/netcam_rtsp.c
diff --git a/po/li.po b/po/li.po
index f2820ab0..8c197548 100644
--- a/po/li.po
+++ b/po/li.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
-"POT-Creation-Date: 2019-09-28 09:39-0600\n"
+"POT-Creation-Date: 2019-10-27 22:19-0600\n"
"PO-Revision-Date: 2018-10-13 12:02-0600\n"
"Last-Translator: MrDave \n"
"Language-Team: MrDave \n"
@@ -222,6 +222,10 @@ msgstr ""
msgid "netcam_use_tcp"
msgstr ""
+#: src/conf.c
+msgid "netcam_decoder"
+msgstr ""
+
#: src/conf.c
msgid "mmalcam_name"
msgstr ""
@@ -2573,27 +2577,22 @@ msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: av_find_best_stream: %s,Interrupt %s"
+msgid "%s: %s: %s,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_find_decoder: Failed,Interrupt %s"
+msgid "%s: %s: Failed,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_alloc_context3: Failed,Interrupt %s"
+msgid "%s: Ignoring user requested decoder %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_parameters_to_context: %s,Interrupt %s"
-msgstr ""
-
-#: src/netcam_rtsp.c
-#, c-format
-msgid "%s: avcodec_open2: %s,Interrupt %s"
+msgid "%s: Using decoder %s"
msgstr ""
#: src/netcam_rtsp.c
diff --git a/po/nl.po b/po/nl.po
index 16b9a4c2..866bcb7e 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
-"POT-Creation-Date: 2019-09-28 09:39-0600\n"
+"POT-Creation-Date: 2019-10-27 22:19-0600\n"
"PO-Revision-Date: 2018-10-13 12:03-0600\n"
"Last-Translator: MrDave \n"
"Language-Team: MrDave \n"
@@ -221,6 +221,10 @@ msgstr ""
msgid "netcam_use_tcp"
msgstr ""
+#: src/conf.c
+msgid "netcam_decoder"
+msgstr ""
+
#: src/conf.c
msgid "mmalcam_name"
msgstr ""
@@ -2572,27 +2576,22 @@ msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: av_find_best_stream: %s,Interrupt %s"
+msgid "%s: %s: %s,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_find_decoder: Failed,Interrupt %s"
+msgid "%s: %s: Failed,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_alloc_context3: Failed,Interrupt %s"
+msgid "%s: Ignoring user requested decoder %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_parameters_to_context: %s,Interrupt %s"
-msgstr ""
-
-#: src/netcam_rtsp.c
-#, c-format
-msgid "%s: avcodec_open2: %s,Interrupt %s"
+msgid "%s: Using decoder %s"
msgstr ""
#: src/netcam_rtsp.c
diff --git a/po/no.po b/po/no.po
index 4207257e..df817482 100644
--- a/po/no.po
+++ b/po/no.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
-"POT-Creation-Date: 2019-09-28 09:39-0600\n"
+"POT-Creation-Date: 2019-10-27 22:19-0600\n"
"PO-Revision-Date: 2018-10-13 12:03-0600\n"
"Last-Translator: MrDave \n"
"Language-Team: MrDave \n"
@@ -221,6 +221,10 @@ msgstr ""
msgid "netcam_use_tcp"
msgstr ""
+#: src/conf.c
+msgid "netcam_decoder"
+msgstr ""
+
#: src/conf.c
msgid "mmalcam_name"
msgstr ""
@@ -2572,27 +2576,22 @@ msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: av_find_best_stream: %s,Interrupt %s"
+msgid "%s: %s: %s,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_find_decoder: Failed,Interrupt %s"
+msgid "%s: %s: Failed,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_alloc_context3: Failed,Interrupt %s"
+msgid "%s: Ignoring user requested decoder %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_parameters_to_context: %s,Interrupt %s"
-msgstr ""
-
-#: src/netcam_rtsp.c
-#, c-format
-msgid "%s: avcodec_open2: %s,Interrupt %s"
+msgid "%s: Using decoder %s"
msgstr ""
#: src/netcam_rtsp.c
diff --git a/po/pt.po b/po/pt.po
index a0e6ebc4..637ba360 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
-"POT-Creation-Date: 2019-09-28 09:39-0600\n"
+"POT-Creation-Date: 2019-10-27 22:19-0600\n"
"PO-Revision-Date: 2018-10-13 12:03-0600\n"
"Last-Translator: MrDave \n"
"Language-Team: MrDave \n"
@@ -221,6 +221,10 @@ msgstr ""
msgid "netcam_use_tcp"
msgstr ""
+#: src/conf.c
+msgid "netcam_decoder"
+msgstr ""
+
#: src/conf.c
msgid "mmalcam_name"
msgstr ""
@@ -2572,27 +2576,22 @@ msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: av_find_best_stream: %s,Interrupt %s"
+msgid "%s: %s: %s,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_find_decoder: Failed,Interrupt %s"
+msgid "%s: %s: Failed,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_alloc_context3: Failed,Interrupt %s"
+msgid "%s: Ignoring user requested decoder %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_parameters_to_context: %s,Interrupt %s"
-msgstr ""
-
-#: src/netcam_rtsp.c
-#, c-format
-msgid "%s: avcodec_open2: %s,Interrupt %s"
+msgid "%s: Using decoder %s"
msgstr ""
#: src/netcam_rtsp.c
diff --git a/po/sk.po b/po/sk.po
index 6ed753e5..12ad1600 100644
--- a/po/sk.po
+++ b/po/sk.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
-"POT-Creation-Date: 2019-09-28 10:15-0600\n"
+"POT-Creation-Date: 2019-10-27 22:19-0600\n"
"PO-Revision-Date: 2018-12-17 06:35+0100\n"
"Last-Translator: Dusan Mikulas \n"
"Language-Team: Dusan Mikulas \n"
@@ -221,6 +221,10 @@ msgstr ""
msgid "netcam_use_tcp"
msgstr ""
+#: src/conf.c
+msgid "netcam_decoder"
+msgstr ""
+
#: src/conf.c
msgid "mmalcam_name"
msgstr ""
@@ -2576,27 +2580,22 @@ msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: av_find_best_stream: %s,Interrupt %s"
+msgid "%s: %s: %s,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_find_decoder: Failed,Interrupt %s"
+msgid "%s: %s: Failed,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_alloc_context3: Failed,Interrupt %s"
+msgid "%s: Ignoring user requested decoder %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_parameters_to_context: %s,Interrupt %s"
-msgstr ""
-
-#: src/netcam_rtsp.c
-#, c-format
-msgid "%s: avcodec_open2: %s,Interrupt %s"
+msgid "%s: Using decoder %s"
msgstr ""
#: src/netcam_rtsp.c
diff --git a/po/sv.po b/po/sv.po
index 7a1df5dd..72702e3d 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
-"POT-Creation-Date: 2019-09-28 09:39-0600\n"
+"POT-Creation-Date: 2019-10-27 22:19-0600\n"
"PO-Revision-Date: 2018-10-13 12:04-0600\n"
"Last-Translator: MrDave \n"
"Language-Team: MrDave \n"
@@ -221,6 +221,10 @@ msgstr ""
msgid "netcam_use_tcp"
msgstr ""
+#: src/conf.c
+msgid "netcam_decoder"
+msgstr ""
+
#: src/conf.c
msgid "mmalcam_name"
msgstr ""
@@ -2572,27 +2576,22 @@ msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: av_find_best_stream: %s,Interrupt %s"
+msgid "%s: %s: %s,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_find_decoder: Failed,Interrupt %s"
+msgid "%s: %s: Failed,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_alloc_context3: Failed,Interrupt %s"
+msgid "%s: Ignoring user requested decoder %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_parameters_to_context: %s,Interrupt %s"
-msgstr ""
-
-#: src/netcam_rtsp.c
-#, c-format
-msgid "%s: avcodec_open2: %s,Interrupt %s"
+msgid "%s: Using decoder %s"
msgstr ""
#: src/netcam_rtsp.c
diff --git a/po/zh.po b/po/zh.po
index e6713e79..75fed6ea 100644
--- a/po/zh.po
+++ b/po/zh.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
-"POT-Creation-Date: 2019-09-28 09:39-0600\n"
+"POT-Creation-Date: 2019-10-27 22:19-0600\n"
"PO-Revision-Date: 2018-10-13 12:04-0600\n"
"Last-Translator: MrDave \n"
"Language-Team: MrDave \n"
@@ -221,6 +221,10 @@ msgstr ""
msgid "netcam_use_tcp"
msgstr ""
+#: src/conf.c
+msgid "netcam_decoder"
+msgstr ""
+
#: src/conf.c
msgid "mmalcam_name"
msgstr ""
@@ -2572,27 +2576,22 @@ msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: av_find_best_stream: %s,Interrupt %s"
+msgid "%s: %s: %s,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_find_decoder: Failed,Interrupt %s"
+msgid "%s: %s: Failed,Interrupt %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_alloc_context3: Failed,Interrupt %s"
+msgid "%s: Ignoring user requested decoder %s"
msgstr ""
#: src/netcam_rtsp.c
#, c-format
-msgid "%s: avcodec_parameters_to_context: %s,Interrupt %s"
-msgstr ""
-
-#: src/netcam_rtsp.c
-#, c-format
-msgid "%s: avcodec_open2: %s,Interrupt %s"
+msgid "%s: Using decoder %s"
msgstr ""
#: src/netcam_rtsp.c
diff --git a/src/conf.c b/src/conf.c
index e4be94b2..d96e02fd 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -68,6 +68,7 @@ struct config conf_template = {
.netcam_proxy = NULL,
.netcam_tolerant_check = FALSE,
.netcam_use_tcp = TRUE,
+ .netcam_decoder = NULL,
.mmalcam_name = NULL,
.mmalcam_control_params = NULL,
@@ -498,6 +499,15 @@ config_param config_params[] = {
WEBUI_LEVEL_ADVANCED
},
{
+ "netcam_decoder",
+ "# User requested decoder for netcam.",
+ 0,
+ CONF_OFFSET(netcam_decoder),
+ copy_string,
+ print_string,
+ WEBUI_LEVEL_ADVANCED
+ },
+ {
"mmalcam_name",
"# Name of mmal camera (e.g. vc.ril.camera for pi camera).",
0,
@@ -3186,6 +3196,7 @@ static void config_parms_intl(){
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_proxy",_("netcam_proxy"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_tolerant_check",_("netcam_tolerant_check"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_use_tcp",_("netcam_use_tcp"));
+ MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_decoder",_("netcam_decoder"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","mmalcam_name",_("mmalcam_name"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","mmalcam_control_params",_("mmalcam_control_params"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","width",_("width"));
diff --git a/src/conf.h b/src/conf.h
index 457481dd..5d648386 100644
--- a/src/conf.h
+++ b/src/conf.h
@@ -53,6 +53,7 @@ struct config {
const char *netcam_proxy;
int netcam_tolerant_check;
int netcam_use_tcp;
+ char *netcam_decoder;
const char *mmalcam_name;
const char *mmalcam_control_params;
diff --git a/src/motion.c b/src/motion.c
index da923038..90091ff0 100644
--- a/src/motion.c
+++ b/src/motion.c
@@ -1291,6 +1291,19 @@ static int motion_init(struct context *cnt)
if (cnt->conf.width < 64) cnt->conf.width = 64;
if (cnt->conf.height < 64) cnt->conf.height = 64;
+ if (cnt->conf.netcam_decoder != NULL){
+ cnt->netcam_decoder = mymalloc(strlen(cnt->conf.netcam_decoder)+1);
+ retcd = snprintf(cnt->netcam_decoder,strlen(cnt->conf.netcam_decoder)+1
+ ,"%s",cnt->conf.netcam_decoder);
+ if (retcd < 0){
+ free(cnt->netcam_decoder);
+ cnt->netcam_decoder = NULL;
+ }
+ } else {
+ cnt->netcam_decoder = NULL;
+ }
+
+
/* set the device settings */
cnt->video_dev = vid_start(cnt);
@@ -1722,6 +1735,11 @@ static void motion_cleanup(struct context *cnt) {
dbse_deinit(cnt);
+ if (cnt->netcam_decoder){
+ free(cnt->netcam_decoder);
+ cnt->netcam_decoder = NULL;
+ }
+
}
static void mlp_mask_privacy(struct context *cnt){
diff --git a/src/motion.h b/src/motion.h
index 2d6773a3..a6af35e4 100644
--- a/src/motion.h
+++ b/src/motion.h
@@ -453,6 +453,7 @@ struct context {
int stream_count;
char hostname[PATH_MAX];
+ char *netcam_decoder;
int sql_mask;
diff --git a/src/netcam_rtsp.c b/src/netcam_rtsp.c
index 85df64f4..2dbdcae5 100644
--- a/src/netcam_rtsp.c
+++ b/src/netcam_rtsp.c
@@ -329,11 +329,36 @@ static int netcam_rtsp_decode_packet(struct rtsp_context *rtsp_data){
return frame_size;
}
+static void netcam_rtsp_decoder_error(struct rtsp_context *rtsp_data, int retcd, const char* fnc_nm){
+
+ char errstr[128];
+
+ if (retcd < 0){
+ av_strerror(retcd, errstr, sizeof(errstr));
+ MOTION_LOG(ERR, TYPE_NETCAM, NO_ERRNO
+ ,_("%s: %s: %s,Interrupt %s")
+ ,rtsp_data->cameratype,fnc_nm, errstr, rtsp_data->interrupted ? _("True"):_("False"));
+ } else {
+ MOTION_LOG(ERR, TYPE_NETCAM, NO_ERRNO
+ ,_("%s: %s: Failed,Interrupt %s"),rtsp_data->cameratype
+ ,fnc_nm, rtsp_data->interrupted ? _("True"):_("False"));
+ }
+
+ if (rtsp_data->decoder_nm != NULL){
+ MOTION_LOG(NTC, TYPE_NETCAM, NO_ERRNO
+ ,_("%s: Ignoring user requested decoder %s"),rtsp_data->cameratype
+ ,rtsp_data->decoder_nm);
+ free(rtsp_data->cnt->netcam_decoder);
+ rtsp_data->cnt->netcam_decoder = NULL;
+ rtsp_data->decoder_nm = NULL;
+ }
+
+}
+
static int netcam_rtsp_open_codec(struct rtsp_context *rtsp_data){
#if (LIBAVFORMAT_VERSION_MAJOR >= 58) || ((LIBAVFORMAT_VERSION_MAJOR == 57) && (LIBAVFORMAT_VERSION_MINOR >= 41))
int retcd;
- char errstr[128];
AVStream *st;
AVCodec *decoder = NULL;
@@ -341,46 +366,46 @@ static int netcam_rtsp_open_codec(struct rtsp_context *rtsp_data){
retcd = av_find_best_stream(rtsp_data->format_context, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0);
if ((retcd < 0) || (rtsp_data->interrupted)){
- av_strerror(retcd, errstr, sizeof(errstr));
- MOTION_LOG(ERR, TYPE_NETCAM, NO_ERRNO
- ,_("%s: av_find_best_stream: %s,Interrupt %s")
- ,rtsp_data->cameratype, errstr, rtsp_data->interrupted ? _("True"):_("False"));
+ netcam_rtsp_decoder_error(rtsp_data, retcd, "av_find_best_stream");
return -1;
}
rtsp_data->video_stream_index = retcd;
st = rtsp_data->format_context->streams[rtsp_data->video_stream_index];
- decoder = avcodec_find_decoder(st->codecpar->codec_id);
+ if (rtsp_data->decoder_nm != NULL){
+ decoder = avcodec_find_decoder_by_name(rtsp_data->decoder_nm);
+ if (decoder == NULL) {
+ netcam_rtsp_decoder_error(rtsp_data, 0, "avcodec_find_decoder_by_name");
+ } else {
+ MOTION_LOG(NTC, TYPE_NETCAM, NO_ERRNO,_("%s: Using decoder %s")
+ ,rtsp_data->cameratype,rtsp_data->decoder_nm);
+ }
+ }
+
+ if (decoder == NULL) {
+ decoder = avcodec_find_decoder(st->codecpar->codec_id);
+ }
+
if ((decoder == NULL) || (rtsp_data->interrupted)){
- MOTION_LOG(ERR, TYPE_NETCAM, NO_ERRNO
- ,_("%s: avcodec_find_decoder: Failed,Interrupt %s")
- ,rtsp_data->cameratype, rtsp_data->interrupted ? _("True"):_("False"));
+ netcam_rtsp_decoder_error(rtsp_data, 0, "avcodec_find_decoder");
return -1;
}
rtsp_data->codec_context = avcodec_alloc_context3(decoder);
if ((rtsp_data->codec_context == NULL) || (rtsp_data->interrupted)){
- MOTION_LOG(ERR, TYPE_NETCAM, NO_ERRNO
- ,_("%s: avcodec_alloc_context3: Failed,Interrupt %s")
- ,rtsp_data->cameratype, rtsp_data->interrupted ? _("True"):_("False"));
+ netcam_rtsp_decoder_error(rtsp_data, 0, "avcodec_alloc_context3");
return -1;
}
retcd = avcodec_parameters_to_context(rtsp_data->codec_context, st->codecpar);
if ((retcd < 0) || (rtsp_data->interrupted)) {
- av_strerror(retcd, errstr, sizeof(errstr));
- MOTION_LOG(ERR, TYPE_NETCAM, NO_ERRNO
- ,_("%s: avcodec_parameters_to_context: %s,Interrupt %s")
- ,rtsp_data->cameratype, errstr, rtsp_data->interrupted ? _("True"):_("False"));
+ netcam_rtsp_decoder_error(rtsp_data, retcd, "avcodec_alloc_context3");
return -1;
}
retcd = avcodec_open2(rtsp_data->codec_context, decoder, NULL);
if ((retcd < 0) || (rtsp_data->interrupted)){
- av_strerror(retcd, errstr, sizeof(errstr));
- MOTION_LOG(ERR, TYPE_NETCAM, NO_ERRNO
- ,_("%s: avcodec_open2: %s,Interrupt %s")
- ,rtsp_data->cameratype, errstr, rtsp_data->interrupted ? _("True"):_("False"));
+ netcam_rtsp_decoder_error(rtsp_data, retcd, "avcodec_open2");
return -1;
}
@@ -388,7 +413,6 @@ static int netcam_rtsp_open_codec(struct rtsp_context *rtsp_data){
#else
int retcd;
- char errstr[128];
AVStream *st;
AVCodec *decoder = NULL;
@@ -396,10 +420,7 @@ static int netcam_rtsp_open_codec(struct rtsp_context *rtsp_data){
retcd = av_find_best_stream(rtsp_data->format_context, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0);
if ((retcd < 0) || (rtsp_data->interrupted)){
- av_strerror(retcd, errstr, sizeof(errstr));
- MOTION_LOG(ERR, TYPE_NETCAM, NO_ERRNO
- ,_("%s: av_find_best_stream: %s,Interrupt %s")
- ,rtsp_data->cameratype, errstr, rtsp_data->interrupted ? _("True"):_("False"));
+ netcam_rtsp_decoder_error(rtsp_data, retcd, "av_find_best_stream");
return -1;
}
rtsp_data->video_stream_index = retcd;
@@ -408,17 +429,12 @@ static int netcam_rtsp_open_codec(struct rtsp_context *rtsp_data){
rtsp_data->codec_context = st->codec;
decoder = avcodec_find_decoder(rtsp_data->codec_context->codec_id);
if ((decoder == NULL) || (rtsp_data->interrupted)) {
- MOTION_LOG(ERR, TYPE_NETCAM, NO_ERRNO
- ,_("%s: avcodec_find_decoder: Failed,Interrupt %s")
- ,rtsp_data->cameratype, rtsp_data->interrupted ? _("True"):_("False"));
- return -1;
+ netcam_rtsp_decoder_error(rtsp_data, 0, "avcodec_find_decoder");
+ return -1;
}
retcd = avcodec_open2(rtsp_data->codec_context, decoder, NULL);
if ((retcd < 0) || (rtsp_data->interrupted)){
- av_strerror(retcd, errstr, sizeof(errstr));
- MOTION_LOG(ERR, TYPE_NETCAM, NO_ERRNO
- ,_("%s: avcodec_open2: %s,Interrupt %s")
- ,rtsp_data->cameratype, errstr, rtsp_data->interrupted ? _("True"):_("False"));
+ netcam_rtsp_decoder_error(rtsp_data, retcd, "avcodec_open2");
return -1;
}
@@ -982,6 +998,8 @@ static void netcam_rtsp_set_parms (struct context *cnt, struct rtsp_context *rts
rtsp_data->handler_finished = TRUE;
rtsp_data->first_image = TRUE;
rtsp_data->reconnect_count = 0;
+ rtsp_data->decoder_nm = cnt->netcam_decoder;
+ rtsp_data->cnt = cnt;
snprintf(rtsp_data->threadname, 15, "%s",_("Unknown"));
diff --git a/src/netcam_rtsp.h b/src/netcam_rtsp.h
index 5205f78f..23569184 100644
--- a/src/netcam_rtsp.h
+++ b/src/netcam_rtsp.h
@@ -79,6 +79,8 @@ struct rtsp_context {
struct timeval frame_prev_tm; /* The time set before calling the av functions */
struct timeval frame_curr_tm; /* Time during the interrupt to determine duration since start*/
struct config *conf; /* Pointer to conf parms of parent cnt*/
+ char *decoder_nm; /* User requested decoder */
+ struct context *cnt;
char threadname[16]; /* The thread name*/
int threadnbr; /* The thread number */