Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
x393
Commits
ed954e1f
Commit
ed954e1f
authored
May 05, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stop compressor before changes then restart
parent
374d7837
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
imgsrv.py
py393/imgsrv.py
+10
-0
No files found.
py393/imgsrv.py
100644 → 100755
View file @
ed954e1f
...
...
@@ -37,6 +37,7 @@ import time
import
socket
import
shutil
import
sys
import
subprocess
path
=
"/www/pages/img.jpeg"
PORT
=
8888
...
...
@@ -95,6 +96,9 @@ if ((not acquisition_parameters["bayer"] is None) and
ibayer
^=
2
acquisition_parameters
[
"bayer"
]
=
str
(
ibayer
)
#restart compressor
communicate
(
PORT
,
"compressor_control all 1 None None None None None"
)
cmd_str
=
"jpeg_acquire_write
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s"
%
(
str
(
acquisition_parameters
[
"file_path"
]),
str
(
acquisition_parameters
[
"channel"
]),
...
...
@@ -157,6 +161,12 @@ reply = communicate(PORT,cmd_str)
if
(
acquisition_parameters
[
"cmode"
]
==
"5"
):
path
=
path
.
replace
(
"jpeg"
,
"jp4"
)
circbufcmd
=
"echo
\"
3 "
+
str
(
acquisition_parameters
[
"y_quality"
])
+
"
\"
> /dev/circbuf0"
subprocess
.
check_output
(
circbufcmd
,
stderr
=
subprocess
.
STDOUT
,
shell
=
True
)
communicate
(
PORT
,
"compressor_control all 0 None None None None None"
)
communicate
(
PORT
,
"compressor_control all 3 None None None None None"
)
timestamp
=
str
(
time
.
time
())
.
replace
(
"."
,
"_"
)
# later use image timestamp
print
(
"Content-Type: image/jpeg"
)
print
(
"Content-Disposition: inline; filename=
\"
elphelimg_
%
s.jpeg
\"
"
%
(
timestamp
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment