log decoder sdterr
This commit is contained in:
parent
6daebd4727
commit
f59f623196
16
ffplayout.py
16
ffplayout.py
@ -42,6 +42,7 @@ from subprocess import PIPE, CalledProcessError, Popen, check_output
|
|||||||
from threading import Thread
|
from threading import Thread
|
||||||
from types import SimpleNamespace
|
from types import SimpleNamespace
|
||||||
from urllib import request
|
from urllib import request
|
||||||
|
from threading import Thread
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if os.name != 'posix':
|
if os.name != 'posix':
|
||||||
@ -507,6 +508,14 @@ def terminate_processes(watcher=None):
|
|||||||
watcher.stop()
|
watcher.stop()
|
||||||
|
|
||||||
|
|
||||||
|
def decoder_error_reader(pipe):
|
||||||
|
try:
|
||||||
|
for line in pipe.stderr:
|
||||||
|
messenger.error('ffmpeg decoder: {}'.format(line.decode("utf-8")))
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def get_date(seek_day):
|
def get_date(seek_day):
|
||||||
"""
|
"""
|
||||||
get date for correct playlist,
|
get date for correct playlist,
|
||||||
@ -1586,7 +1595,12 @@ def main():
|
|||||||
with Popen([
|
with Popen([
|
||||||
'ffmpeg', '-v', 'error', '-hide_banner', '-nostats'
|
'ffmpeg', '-v', 'error', '-hide_banner', '-nostats'
|
||||||
] + src_cmd + ff_pre_settings,
|
] + src_cmd + ff_pre_settings,
|
||||||
stdout=PIPE) as _ff.decoder:
|
stdout=PIPE, stderr=PIPE) as _ff.decoder:
|
||||||
|
|
||||||
|
err_thread = Thread(target=decoder_error_reader,
|
||||||
|
args=(_ff.decoder,))
|
||||||
|
err_thread.daemon = True
|
||||||
|
err_thread.start()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
buf = _ff.decoder.stdout.read(65424)
|
buf = _ff.decoder.stdout.read(65424)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user