Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
docker-ffmpeg-gpu
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YONG-LIN SU
docker-ffmpeg-gpu
Commits
c0b62cdf
Commit
c0b62cdf
authored
Aug 02, 2019
by
YONG-LIN SU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
d9d6b1bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
ipcame2easy (1).py
ipcame2easy (1).py
+43
-0
No files found.
ipcame2easy (1).py
0 → 100644
View file @
c0b62cdf
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import
subprocess
as
sp
import
threading
# In[ ]:
host_server
=
'rtsp://192.168.5.17:554/'
soures
=
[
'rtsp://ncut0:ecom2828@192.168.5.198/main_0'
,
'rtsp://admin:Ecom84253675@120.108.24.88:554/onvif/profile2/media.smp'
,
'rtsp://admin:Ecom84253675@120.108.24.89:554/onvif/profile2/media.smp'
]
destination
=
[
'rd/0'
,
'mm/in'
,
'mm/out'
]
def
push2rtsp
(
surl
,
durl
):
command
=
'ffmpeg -rtsp_transport tcp -i {0} -c:v copy -an -rtsp_transport tcp -f rtsp {1}'
.
format
(
surl
,
durl
)
returncode
=
sp
.
call
(
command
,
shell
=
True
)
print
(
'error'
+
str
(
returncode
))
restart
(
surl
,
durl
)
def
restart
(
surl
,
durl
):
t
=
threading
.
Thread
(
target
=
push2rtsp
,
args
=
(
surl
,
durl
,))
t
.
start
()
print
(
'restart'
+
durl
)
# 建立 n 個子執行緒
threads
=
[]
for
i
in
range
(
len
(
soures
)):
threads
.
append
(
threading
.
Thread
(
target
=
push2rtsp
,
args
=
(
soures
[
i
],
host_server
+
destination
[
i
],)))
threads
[
i
]
.
start
()
# In[ ]:
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