{"id":5733,"date":"2018-06-01T15:13:25","date_gmt":"2018-06-01T15:13:25","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=5733"},"modified":"2020-03-30T02:31:04","modified_gmt":"2020-03-30T02:31:04","slug":"get-series-still-frames-jpeg-aws-deeplens-camera","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/get-series-still-frames-jpeg-aws-deeplens-camera\/","title":{"rendered":"How to get a series of still frames (jpeg) from AWS DeepLens camera"},"content":{"rendered":"<p>If you&#8217;re experimenting with the <a href=\"https:\/\/amzn.to\/2H8FGWQ\">AWS Deeplens camera<\/a>, you may find that you want to get a series of sample, still images for experimentation purposes.<\/p>\n<p>If you try to write python code that calls &#8220;awscam.getLastFrame()&#8221; and works on it in real-time (e.g. saving off numpy arrays or jpegs), you will quickly run into all kinds of memory corruption issues. The camera will also quickly run out of disk space.<\/p>\n<p>A far easier approach is to save off the h264 stream from the camera for a while:<\/p>\n<pre lang=\"bash\">ssh aws_cam@192.168.1.187 cat \/opt\/awscam\/out\/ch1_out.h264 &gt; out.h264\n<\/pre>\n<p>Once you feel you have enough video, you can ctrl-c it.<\/p>\n<p>After that you can extract every frame, like so:<\/p>\n<pre lang=\"bash\">\/d\/software\/mplayer\/mplayer.exe -hardframedrop -vo jpeg out.h264\n<\/pre>\n<p>Alternately, add the &#8220;-sstep 1&#8221; argument to do a frame every second.<\/p>\n<p>If you connect to the camera directly with mplayer, you will also see it struggles for a few seconds to catch up, and has corrupted video &#8211; the above technique skips all those frames.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Getting JPEG frames from the AWS DeepLens camera<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[6,12],"tags":[72],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/5733"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=5733"}],"version-history":[{"count":1,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/5733\/revisions"}],"predecessor-version":[{"id":6433,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/5733\/revisions\/6433"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=5733"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=5733"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=5733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}