-
Notifications
You must be signed in to change notification settings - Fork 33
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
Can't invoke create_stream once a stream has already been connected. #16
Comments
It doesn't really invoke EDIT: You should include the code, that would help resolving the issue. Also, the server you are trying to connect to is using http://rtmpd.com/ |
Yes, while I may have a successful connection, I am trying to connect to the 12 other possible streams that the server is broadcasting; but only after I receive an "avons" packet that includes the playpaths in its body. I also see in your repos that you are creating a tinychat client. it is 99% complete on the functions with a few bugs that I will work out in the upcoming days. |
@norwack , yeah the way I wrote it; it could be easily used as a library. Actually a friend, MegaLoler wrote a bit of the source a while ago. I how ever have made many changes to it, and ported it over to use this library. Back on topic; I am able to successfully the create_stream method if I invoke it BEFORE i invoke my "listen" method (while looping the read_packet" function. breaking that loop once the "avons" packet is received (so I have the playpaths) does not work. I don't understand enough of the python-librtmp code to figure out how to fix it. So any help from @chrippa would be appreciated. I am also using stock 2.4 build of librtmp.dll, and have tried other versions, both eariler, and coustom, and can't get it working. |
RTMP.create_stream calls RTMP_ConnectStream, which has it's own loop for processing packets. If you're processing packets before calling this it will probably not work, since it expects packets to happen in a certain order. Edit: This might work, but I'm not sure: from librtmp import RTMP, librtmp as librtmp_binding
rtmp = RTMP(...)
...
# Call RTMP_SendCreateStream directly
librtmp_binding.RTMP_SendCreateStream(rtmp.rtmp)
stream = rtmp.create_stream() |
THANKS BUD! I won't have time tonight to work it out, but I will in the morning. I will update you if this works. I appreciate the help! |
That works for opening a broadcast on TinyChat atleast, haven't tried actually sending FLV data yet. Recieving broadcasts should work fine aswell. EDIT: I've tried passing FLV data to it, it works but audo/video kinda gets rushed over and not played correctly. a 10 second video turns into 2-3 seconds so to speak. @chrippa what is the preferred way to open a flv file and passing the data to the write function? |
So @norwack, how were you able to set the playpath? This code here is what I am using to invoke the methods. With line 12 not commented and 13 commented, it produces this result. with line 13 commented and 14 not, it produces this result, I'm lost in the sauce here. edit, @norwack edit2 @norwack |
@notnola I did something like this and i was able to playback audio and video without problems with vlc:
EDIT: I didn't write anything to break out of the loop if the stream is empty/finished, so .close() is not being called, however it still worked properly. @notnola I would collaborate, however i don't think i'll have the time because i'm working on another project at the moment and i'm moving in ~1 month, etc. |
@norwack I've been trying this same thing. Your example is impossible, however: You can't be using the same object for both calls. Have you actually tried this code? Please share your code that did work. I am unable to start a webcam stream download with librtmp, for no apparent reason. I have noticed that, using packets manually, I would send a "play()" packet on streamID 1, but this library doesn't let me choose which streamID I want to use. :S Suggestions? @chrippa |
@phuein Actually the code I previously posted worked, I don't know if an update to the librtmp bindings have changed or not as I haven't done anything TinyChat related in many months. |
This is an interesting conversation guys. Though one question, this must be possible through rtmp_protocol without librtmp right? I'll give it a try, I know James has already done it, but it would be interesting to see. |
http://i.imgur.com/7bzPQI4.png
on this particular server
invoking conn.connect()
creates a stream
trying to invoke create_stream() after connection produces nothing. No outbound packets.
The text was updated successfully, but these errors were encountered: