I have a digital ocean droplet which has a linux os on it. On this vm I have a flask webserver and in the __init__.py
script I have these two functions:
@app.route('/ds')
def ds():
fp = "/home/ds/gabo/"
pre = 'das_'
req_value = create_vlc_command(pre, fp)
os.system(req_value)
return req_value
def create_vlc_command(pre_fn, full_path):
pre_sc_path = '--scene-path='
file_name = pre_fn + get_date_time()
vid_settings = ("--rate=1 --video-filter=scene "
"--vout=dummy --run-time=3 "
"--scene-format=png --scene-ratio=24 "
"--scene-prefix=") + file_name
scene_path = pre_sc_path + full_path
req_value = ("vlc {arg_name} {vid_settings} {scene_path} "
"{quit}").format(arg_name="htttp:examplexxx.com",
vid_settings=vid_settings, scene_path=scene_path,
quit='vlc://quit')
return req_value
When I hit ctrl + r on the droplet-ip/ds i can see the req_value and the folder gets created on the vm but I don't see any pictures in that folder. But when I run the req_value later in the terminal, the pictures get created.
The command on the page:
vlc http://exampleamplexxx.com/dsa.m3u8 --video-filter=scene --vout=dummy --run-time=3 --scene-format=png --scene-ratio=24 --scene-prefix=pi_pic_lc_2017_12_09_15_58_30 --scene-path=/home/ds/gabo/ vlc://quit
Is something wrong with the os.system or what am I doing wrong?