mirror of
https://github.com/soimort/you-get.git
synced 2025-03-13 03:17:44 +03:00
[ffmpeg] remove unuseful ffmpeg_play_stream(), fix #1336
This commit is contained in:
parent
c6784f2fb8
commit
3a8ce8819d
@ -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
|
||||
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user