Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timout not working for multiple stream #51

Open
mzramna opened this issue Jul 11, 2020 · 1 comment
Open

timout not working for multiple stream #51

mzramna opened this issue Jul 11, 2020 · 1 comment

Comments

@mzramna
Copy link

mzramna commented Jul 11, 2020

Describe the bug
when using multiple stream as shown in test files,timout parameter not work

System Parameters

  • Operating system linux
  • FFmpeg version 4.2.2-1ubuntu1
sites = [ "youtube","facebook",]
TIMEOUT = 5
S = pls.Screenshare(inifn=None, websites=sites, timeout=TIMEOUT)
    for s in S.streams:
        if input != "file":
            assert "-re" not in S.streams[s].cmd
            assert S.streams[s].fps == approx(30.0)
        if int(S.streams[s].res[1]) == 480:
            assert S.streams[s].video_kbps == 500
        elif int(S.streams[s].res[1]) == 720:
            assert S.streams[s].video_kbps == 1800
        print(s.title())
        print(S.streams[s].__dict__)
    S.golive()

with the folowing code the resulting comand executed excludes de '-t' tag:
running only with youtube:
/usr/bin/ffmpeg -loglevel error -f x11grab -s 640x480 -i :0.0+50,30 -f pulse -i default -codec:v libx264 -pix_fmt yuv420p -preset veryfast -b:v 500k -g 60 -codec:a aac -b:a 128k -ar 44100 -maxrate 500k -bufsize 250k -strict experimental -f flv -t 5 rtmp://a.rtmp.youtube.com/
running with youtube and facebook:
/usr/bin/ffmpeg -loglevel error -f x11grab -s 640x480 -i :0.0+50,30 -f pulse -i default -codec:v libx264 -pix_fmt yuv420p -preset veryfast -b:v 500k -g 60 -codec:a aac -b:a 128k -ar 44100 -maxrate 500k -bufsize 250k -strict experimental -f flv -flags:v +global_header -f tee -map 0:v -map 1:a [f=flv]rtmp://a.rtmp.youtube.com/_______________________|[f=flv]rtmps://live-api-s.facebook.com:443/rtmp/

@mzramna
Copy link
Author

mzramna commented Jul 12, 2020

this code i've made have the same expected output,but with the -t tag included:

cmd=""
    for command in S.streams[list(S.streams.keys())[0]].cmd[:-1]:
        cmd+=command+" "
    cmd+="-flags:v +global_header -f tee"
    print(cmd)
    for site in S.streams:
        if site!=list(S.streams.keys())[0]:
            cmd +="|"
        print(S.streams[site].sink)
        cmd+="[f=flv]"+str(S.streams[site].sink)
    print(cmd)

i think using the folowing line instead of the existing into the main code will fix the issue:
for command in S.streams[list(S.streams.keys())[0]].cmd[:-1]:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant