[ffmpeg] remove unuseful ffmpeg_play_stream(), fix #1336

This commit is contained in:
Mort Yao 2016-08-14 03:52:02 +02:00
parent c6784f2fb8
commit 3a8ce8819d
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251
2 changed files with 13 additions and 52 deletions

View File

@ -910,8 +910,7 @@ def download_url_ffmpeg(url,title, ext,params={}, total_size=0, output_dir='.',
return
if player:
from .processor.ffmpeg import ffmpeg_play_stream
ffmpeg_play_stream(player, url, params)
launch_player(player, [url])
return
from .processor.ffmpeg import has_ffmpeg_installed, ffmpeg_download_stream

View File

@ -243,41 +243,3 @@ def ffmpeg_download_stream(files, title, ext, params={}, output_dir='.'):
pass
return True
#
#To be refactor
#Direct copy of rtmpdump.py
#
def ffmpeg_play_stream(player, url, params={}):
ffmpeg_params = []
#should these exist...
if params is not None:
if len(params) > 0:
for k, v in params:
ffmpeg_params.append(k)
ffmpeg_params.append(v)
print('Playing streaming content with FFmpeg, press 1 to stop recording...')
ffmpeg_params = [FFMPEG] + LOGLEVEL + ['-y', '-re', '-i']
ffmpeg_params.append(url) #not the same here!!!!
if FFMPEG == 'avconv': #who cares?
ffmpeg_params += ['-c', 'copy', '|']
else:
ffmpeg_params += ['-c', 'copy', '-bsf:a', 'aac_adtstoasc', '|']
ffmpeg_params += [player, '-']
print(' '.join(ffmpeg_params))
try:
a = subprocess.Popen(ffmpeg_params, stdin= subprocess.PIPE)
a.communicate()
except KeyboardInterrupt:
try:
a.stdin.write('q'.encode('utf-8'))
except:
pass
return True