{"action":"created","issue":{"url":"https://api.github.com/repos/openva/richmondsunlight/issues/66","labels_url":"https://api.github.com/repos/openva/richmondsunlight/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/openva/richmondsunlight/issues/66/comments","events_url":"https://api.github.com/repos/openva/richmondsunlight/issues/66/events","html_url":"https://github.com/openva/richmondsunlight/issues/66","id":126502283,"number":66,"title":"Capture streaming video","user":{"login":"waldoj","id":656758,"avatar_url":"https://avatars.githubusercontent.com/u/656758?v=3","gravatar_id":"","url":"https://api.github.com/users/waldoj","html_url":"https://github.com/waldoj","followers_url":"https://api.github.com/users/waldoj/followers","following_url":"https://api.github.com/users/waldoj/following{/other_user}","gists_url":"https://api.github.com/users/waldoj/gists{/gist_id}","starred_url":"https://api.github.com/users/waldoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waldoj/subscriptions","organizations_url":"https://api.github.com/users/waldoj/orgs","repos_url":"https://api.github.com/users/waldoj/repos","events_url":"https://api.github.com/users/waldoj/events{/privacy}","received_events_url":"https://api.github.com/users/waldoj/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openva/richmondsunlight/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-01-13T20:09:08Z","updated_at":"2016-01-19T19:55:25Z","closed_at":null,"body":"Eliminate the delay to get video. Capture streaming video. Granicus uses an RTMP stream. VLC can capture an RTMP stream. See if it can do that via the command line, and then script that to run every day that the legislature is in session. Also, ffmpeg might be able to do this.\r\n\r\nOK, like this:\r\n\r\n* [x] put together the core commands for both chambers\r\n* [x] copy legislative schedule data out of the database and into a JSON file\r\n* [x] determine when each chamber's session starts next\r\n* [x] create a PHP CLI script that checks whether a session is starting in the next X minutes and returns 1 or 0\r\n* [x] create a shell script to trigger the capture of video\r\n* [x] create a cron job to run that PHP CLI script and, when appropriate, start the shell script\r\n* [ ] figure out how to know when the session has ended (Twitter?)—alternately, just record for X hours and trim later\r\n* [ ] test ways to trigger the termination of the capture process on the appointed hour\r\n* [ ] set up a processing pipeline to convert the video to h.264 and add it to the database"},"comment":{"url":"https://api.github.com/repos/openva/richmondsunlight/issues/comments/172967296","html_url":"https://github.com/openva/richmondsunlight/issues/66#issuecomment-172967296","issue_url":"https://api.github.com/repos/openva/richmondsunlight/issues/66","id":172967296,"user":{"login":"waldoj","id":656758,"avatar_url":"https://avatars.githubusercontent.com/u/656758?v=3","gravatar_id":"","url":"https://api.github.com/users/waldoj","html_url":"https://github.com/waldoj","followers_url":"https://api.github.com/users/waldoj/followers","following_url":"https://api.github.com/users/waldoj/following{/other_user}","gists_url":"https://api.github.com/users/waldoj/gists{/gist_id}","starred_url":"https://api.github.com/users/waldoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waldoj/subscriptions","organizations_url":"https://api.github.com/users/waldoj/orgs","repos_url":"https://api.github.com/users/waldoj/repos","events_url":"https://api.github.com/users/waldoj/events{/privacy}","received_events_url":"https://api.github.com/users/waldoj/received_events","type":"User","site_admin":false},"created_at":"2016-01-19T19:55:25Z","updated_at":"2016-01-19T19:55:25Z","body":"I just did a live test with the Senate, and they just kept on broadcasting video:\r\n\r\n![senate](https://cloud.githubusercontent.com/assets/656758/12429975/12cf31d6-bebb-11e5-88b4-ad106c40d1e5.png)\r\n\r\nSo, it seems we're going to require a backup method here. I'm thinking:\r\n\r\n* create a lockfile when video is being captured (e.g., `/tmp/senate-video`) that contains the mencoder PID; destroy the lockfile when it's not\r\n* create a new script that checks whether the session has ended (when the lock file still exists) and kills the process\r\n* create a cron job to call that script every ~5 minutes\r\n\r\nOf course, none of this addresses the question of how to know that the session has ended. I can think of 2 mechanisms:\r\n\r\n* We're capturing and archiving the HTML from the right half of the video display screen (in the `chamber_status` table). Check that for uses of \"The Senate is in recess\" and \"The House is in recess.\" When found, stop recording.\r\n* Use the respective chambers' Twitter feeds, via which they announce when they go into recess.\r\n\r\nSeems like Door #1 is the way to go."}}