Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes viewer to support RTSP playback #1890

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,8 @@ def url_fails(url):
If it is streaming
"""
if urlparse(url).scheme in ('rtsp', 'rtmp'):
run_mplayer = mplayer('-identify', '-frames', '0', '-nosound', url)
for line in run_mplayer.split('\n'):
if 'Clip info:' in line:
return False
return True
# @TODO: Do further validation on the asset before returning.
return False

"""
Try HEAD and GET for URL availability check.
Expand Down
5 changes: 5 additions & 0 deletions viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,15 @@ def view_video(uri, duration):

view_image('null')

timeout = 0

try:
while media_player.is_playing():
watchdog()
sleep(1)
timeout += 1
if timeout > int(duration):
break
except sh.ErrorReturnCode_1:
logging.info('Resource URI is not correct, remote host is not responding or request was rejected.')

Expand Down
Loading