modify ffmpeg param: use string instead of an object

This commit is contained in:
jb-alvarado 2020-04-09 20:56:16 +02:00
parent 50b305e736
commit 8ee529c695
2 changed files with 16 additions and 27 deletions

View File

@ -127,18 +127,18 @@ out:
preview: False preview: False
service_name: "Live Stream" service_name: "Live Stream"
service_provider: "example.org" service_provider: "example.org"
post_ffmpeg_param: post_ffmpeg_param: >-
c:v: "libx264" -c:v libx264
crf: "23" -crf 23
x264-params: "keyint=50:min-keyint=25:scenecut=-1" -x264-params keyint=50:min-keyint=25:scenecut=-1
maxrate: "1300k" -maxrate 1300k
bufsize: "2600k" -bufsize 2600k
preset: "medium" -preset medium
profile:v: "Main" -profile:v Main
level: "3.1" -level 3.1
c:a: "aac" -c:a aac
ar: "44100" -ar 44100
b:a: "128k" -b:a 128k
flags: +global_header -flags +global_header
f: "flv" -f flv
out_addr: "rtmp://localhost/live/stream" out_addr: "rtmp://localhost/live/stream"

View File

@ -140,17 +140,6 @@ def read_config(path):
return yaml.safe_load(config_file) return yaml.safe_load(config_file)
def dict_to_list(d):
li = []
for key, value in d.items():
if value:
li += ['-{}'.format(key), str(value)]
else:
li += ['-{}'.format(key)]
return li
def load_config(): def load_config():
""" """
this function can reload most settings from configuration file, this function can reload most settings from configuration file,
@ -228,8 +217,8 @@ def load_config():
_playout.preview = cfg['out']['preview'] _playout.preview = cfg['out']['preview']
_playout.name = cfg['out']['service_name'] _playout.name = cfg['out']['service_name']
_playout.provider = cfg['out']['service_provider'] _playout.provider = cfg['out']['service_provider']
_playout.post_comp_param = dict_to_list( print(cfg['out']['post_ffmpeg_param'].split(' '))
cfg['out']['post_ffmpeg_param']) _playout.post_comp_param = cfg['out']['post_ffmpeg_param'].split(' ')
_playout.out_addr = cfg['out']['out_addr'] _playout.out_addr = cfg['out']['out_addr']
_init.load = False _init.load = False