modify ffmpeg param: use string instead of an object
This commit is contained in:
parent
50b305e736
commit
8ee529c695
@ -127,18 +127,18 @@ out:
|
||||
preview: False
|
||||
service_name: "Live Stream"
|
||||
service_provider: "example.org"
|
||||
post_ffmpeg_param:
|
||||
c:v: "libx264"
|
||||
crf: "23"
|
||||
x264-params: "keyint=50:min-keyint=25:scenecut=-1"
|
||||
maxrate: "1300k"
|
||||
bufsize: "2600k"
|
||||
preset: "medium"
|
||||
profile:v: "Main"
|
||||
level: "3.1"
|
||||
c:a: "aac"
|
||||
ar: "44100"
|
||||
b:a: "128k"
|
||||
flags: +global_header
|
||||
f: "flv"
|
||||
post_ffmpeg_param: >-
|
||||
-c:v libx264
|
||||
-crf 23
|
||||
-x264-params keyint=50:min-keyint=25:scenecut=-1
|
||||
-maxrate 1300k
|
||||
-bufsize 2600k
|
||||
-preset medium
|
||||
-profile:v Main
|
||||
-level 3.1
|
||||
-c:a aac
|
||||
-ar 44100
|
||||
-b:a 128k
|
||||
-flags +global_header
|
||||
-f flv
|
||||
out_addr: "rtmp://localhost/live/stream"
|
||||
|
@ -140,17 +140,6 @@ def read_config(path):
|
||||
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():
|
||||
"""
|
||||
this function can reload most settings from configuration file,
|
||||
@ -228,8 +217,8 @@ def load_config():
|
||||
_playout.preview = cfg['out']['preview']
|
||||
_playout.name = cfg['out']['service_name']
|
||||
_playout.provider = cfg['out']['service_provider']
|
||||
_playout.post_comp_param = dict_to_list(
|
||||
cfg['out']['post_ffmpeg_param'])
|
||||
print(cfg['out']['post_ffmpeg_param'].split(' '))
|
||||
_playout.post_comp_param = cfg['out']['post_ffmpeg_param'].split(' ')
|
||||
_playout.out_addr = cfg['out']['out_addr']
|
||||
|
||||
_init.load = False
|
||||
|
Loading…
x
Reference in New Issue
Block a user