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
Add script to check and show no-signal preview #79
Conversation
url = "http://" + group + ".encoder.timvideos.us:8081/loop.raw" | ||
print "scanning " + group | ||
try: | ||
r = requests.get(url, stream=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When does requests.get return? When the header is available?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requests.get fails if the stream is not accessible, either encoder server is shut down or, it's running but flumotion is stopped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens with the stream is accessible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The HTTP response object from https://ROOMNAME.encoder.timvideos.us:8081/loop.raw is stored in r and looks something like this:
HTTP/1.0 200 OK
date: Sun, 07 Sep 2014 20:55:57 GMT
connection: close
cache-control: private
content-type: video/x-flv
server: FlumotionHTTPServer/0.11.0.1
When encoder goes hungry, the content-type changes to "None".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I'm asking is, does "requests.get" return when after the headers? Or does it wait for data?
It seems like you want to be using HEAD function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I have written "stream=True", the request won't continue forever (it will just get a small chunk). But I think you are right, HEAD function should be enough.
@aps-sids Still a couple of comments on this to reply. |
I am still thinking, how to go about using argparse and config.json, will probably look at it this weekend. |
@aps-sids I'd love to use this. What do you think is left to finish this off? |
@mithro It needs to be merged with the generate.sh script, removing whole hard-coded stuff. |
@aps-sids Now you have some time, can you take another look at this? |
pngcrush functionality needs to be added. |
What is pngcrush? On Wed, Feb 4, 2015 at 1:48 PM, Amanpreet Singh notifications@github.com
Carl K |
Images created by this are >100 KB in size so we need to compress them.
|
Just use |
I don't see a problem with >100 KB images. This is the exception to showing a video, so minimal in comparison. |
@CarlFK this takes over the job of the old preview generation script and instead generates no-signal image when there is no video coming through. Hence it needs to produce small PNGs when the signal is coming through. |
bus = pipeline.get_bus() | ||
pipeline.set_state(Gst.State.PLAYING) | ||
bus.poll(Gst.MessageType.EOS, Gst.CLOCK_TIME_NONE) | ||
pipeline.set_state(Gst.State.NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a #FIXME: This should return true if the preview was generated
@mithro This is good to go except that we need to make it threaded. Should the whole thing be made threaded or just the preview generation (gstreamer) part? |
I'll merge this now. Please another pull request with the threading fixes. |
Add script to check and show no-signal preview.
When collectors error, encoders change to "hungry" for feed. In this situation, previews change to a "No signal" image.