scivision / PyLivestream

Pure Python FFmpeg-based live video / audio streaming to YouTube, Facebook, Periscope, Twitch, and more
Apache License 2.0
707 stars 156 forks source link

How do we start the program? #52

Closed SilverStrings024 closed 1 year ago

SilverStrings024 commented 4 years ago

Where do I call " ScreenshareLivestream twitch "? Everything I try to run (in the PyLivestream folder its self) says that they're trying to do a relative import with no parents and when I just enter the command into the terminal, it tells me the bash command isn't recognized (I know, I know but I was just taking a stab).

I'm sorry if this is a stupid question but I seriously can't figure this out and there aren't any tutorials or anything about this project. I'd like to use this in a django package I'm making but I need to know how to activate it first lol.

scivision commented 4 years ago

These commands come from the "entry_points" in setup.cfg

to enable them, you have to first install this package by either (pick one):

latest development code

git clone https://github.com/scivision/PyLivestream
pip install -e . PyLivestream

latest release

pip install pylivestream
scivision commented 4 years ago

Are you looking to have something you can import from another python module? That's not currently present but I think straightforward to add

scivision commented 4 years ago

I added a module (in GitHub code, not yet uploaded to PyPi). use it like:

import pylivestream.api as pls

help(pls.stream_screen)
pls.stream_screen('~/twitch.key', 'twitch')
SilverStrings024 commented 4 years ago

I added a module (in GitHub code, not yet uploaded to PyPi). use it like:

import pylivestream.api as pls

help(pls.stream_screen)
pls.stream_screen('~/twitch.key', 'twitch')

Thank you so much! Yeah, I was hoping to get it rigged up to import in a project and add some stuff to it. I was thinking of forking it because I would be adding some extra features but since the package I'm making Is for django, I'm not sure if it would be appropriate to fork it.

However, when I add some stuff (to this project on my machine) and it all works and is well tested, I'll submit a PR. Thanks again for the responses and the module!

TURBULENTE commented 4 years ago

Hi, I have the same question. Sorry, which file should make the program start? I'm trying to make a Youtube stream, but don't understand how to use this package. By far I've made tests only through the command line. Is there any tutorial or example that I could see? Thanks a lot.

SilverStrings024 commented 4 years ago

Hi, I have the same question. Sorry, which file should make the program start? I'm trying to make a Youtube stream, but don't understand how to use this package. By far I've made tests only through the command line. Is there any tutorial or example that I could see? Thanks a lot.

He said that currently you can use the module he put in the github code in your own program. This makes it much easier, just have the import he said at the top, then make a function to use it the way he mentioned and call the function at the bottom of the file so you can run the program and start the stream..

Better explaination: use the import he spoke about in your own python file. Either make a function or simply call the method as he did in his comment that shows how to use it.

Get the code from this github (it's not in pypi yet) then in your file do...

Import pylivestream.api as pls pls.stream_screen('your api key', 'platform to stream to')

Then just run the file and you'll stream your screen to whatever platform you put

@scivision did I explain this correctly?