{"id":118,"date":"2019-04-29T12:55:16","date_gmt":"2019-04-29T03:55:16","guid":{"rendered":"https:\/\/junkbulk.robots.jp\/wp\/?p=118"},"modified":"2019-04-29T12:55:16","modified_gmt":"2019-04-29T03:55:16","slug":"jcodec%e3%81%a7h-264%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%81%8b%e3%82%89android%e3%81%aebitmap%e3%82%92%e5%8f%96%e5%be%97%ef%bc%88%e4%bb%bb%e6%84%8f%e3%81%ae%e3%83%95%e3%83%ac%e3%83%bc%e3%83%a0","status":"publish","type":"post","link":"https:\/\/junkbulk.com\/wp\/?p=118","title":{"rendered":"JCodec\u3067h.264\u30d5\u30a1\u30a4\u30eb\u304b\u3089Android\u306eBitmap\u3092\u53d6\u5f97\uff08\u4efb\u610f\u306e\u30d5\u30ec\u30fc\u30e0\uff09"},"content":{"rendered":"\n<p>JCodec\u3092\u4f7f\u3063\u3066\u4efb\u610f\u306e\u30d5\u30ec\u30fc\u30e0\u3092\u53d6\u5f97\u3057\u3066\u307f\u307e\u3059\u3002\u52d8\u3067\u3059\u3050\u306b\u6c17\u3065\u304f\u3068\u601d\u3044\u307e\u3059\u304c\u3001nextFrame()\u3092\u3072\u305f\u3059\u3089\u8aad\u307f\u3060\u305b\u3070\u3067\u304d\u305d\u3046\u3067\u3059\u3002 nextFrame() \u304c\u8fd4\u3059\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30e1\u30f3\u30d0\u30fc\u306b <strong>frameNo\u3068\u3044\u3046\u30e1\u30f3\u30d0\u3082\u3042\u308a\u307e\u3059\u3002<\/strong><br><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">    \/\/\u30c0\u30e1\u306a\u4f8b\n    fun getFrame(pos : Long) : Bitmap{\n        val file = File(\"\/sdcard\/000.h264\")\n        val buf = NIOUtils.fetchFromFile(file)\n        val es = BufferH264ES(buf)\n        var nextFrame  =  es.nextFrame()\n        val decoder = H264Decoder()\n        val pic = Picture.create(1280, 1024, ColorSpace.YUV420)\n        while(nextFrame != null &amp;&amp; nextFrame.frameNo != pos){\n            nextFrame  =  es.nextFrame()\n        }\n        val op = decoder.decodeFrame(nextFrame.data, pic.data).cropped()\n        return AndroidUtil.toBitmap(op)\n    }\n<\/pre>\n\n\n\n<p>\u3053\u308c\u3067\u6307\u5b9a\u3057\u305f\u30d5\u30ec\u30fc\u30e0\u306e\u30d3\u30c3\u30c8\u30de\u30c3\u30d7\u304c\u5f97\u3089\u308c\u305d\u3046\u306b\u601d\u3046\u3058\u3083\u306a\u3044\u3067\u3059\u304b\u3002\u30c0\u30e1\u3067\u3059\u3002h.264\u306f\u524d\u30d5\u30ec\u30fc\u30e0\u3068\u306e \uff08\u6b63\u78ba\u306a\u8a00\u3044\u65b9\u3058\u3083\u306a\u3044\u3051\u3069\uff09 \u5dee\u5206\u3092\u4f7f\u3044\u307e\u3059\u3002\u306a\u306e\u3067\u3001\u30d5\u30ec\u30fc\u30e0\u3054\u3068\u306b\u30c7\u30b3\u30fc\u30c9\u3057\u306a\u3051\u308c\u3070\u3060\u3081\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">    fun getFrame(pos : Long) : Bitmap{\n        val file = File(\"\/sdcard\/000.h264\")\n        val buf = NIOUtils.fetchFromFile(file)\n        val es = BufferH264ES(buf)\n        var nextFrame  =  es.nextFrame()\n        val decoder = H264Decoder()\n        val pic = Picture.create(1280, 1024, ColorSpace.YUV420)\n        while(nextFrame != null &amp;&amp; nextFrame.frameNo != pos){\n            val op = decoder.decodeFrame(nextFrame.data, pic.data)\n            nextFrame  =  es.nextFrame()\n        }\n        val op = decoder.decodeFrame(nextFrame.data, pic.data).cropped()\n        return AndroidUtil.toBitmap(op)\n    }\n<\/pre>\n\n\n\n<p>\u3053\u308c\u3067\u53d6\u5f97\u3067\u304d\u308b\u306e\u3067\u3059\u304c\u3001\u7d42\u308f\u308a\u306e\u307b\u3046\u306e\u30d5\u30ec\u30fc\u30e0\u304c\u6b32\u3057\u3044\u6642\u306b\u3001\u3053\u308c\u3067\u306f\u52b9\u7387\u304c\u60aa\u3044\u3067\u3059\u3088\u306d\uff1f\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u6b21\u306b\u7d9a\u304f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JCodec\u3092\u4f7f\u3063\u3066\u4efb\u610f\u306e\u30d5\u30ec\u30fc\u30e0\u3092\u53d6\u5f97\u3057\u3066\u307f\u307e\u3059\u3002\u52d8\u3067\u3059\u3050\u306b\u6c17\u3065\u304f\u3068\u601d\u3044\u307e\u3059\u304c\u3001nextFrame()\u3092\u3072\u305f\u3059\u3089\u8aad\u307f\u3060\u305b\u3070\u3067\u304d\u305d\u3046\u3067\u3059\u3002 nextFrame() \u304c\u8fd4\u3059\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30e1\u30f3\u30d0\u30fc\u306b frameNo\u3068\u3044\u3046\u30e1\u30f3 &hellip; <a href=\"https:\/\/junkbulk.com\/wp\/?p=118\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;JCodec\u3067h.264\u30d5\u30a1\u30a4\u30eb\u304b\u3089Android\u306eBitmap\u3092\u53d6\u5f97\uff08\u4efb\u610f\u306e\u30d5\u30ec\u30fc\u30e0\uff09&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/junkbulk.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/118"}],"collection":[{"href":"https:\/\/junkbulk.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/junkbulk.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/junkbulk.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/junkbulk.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=118"}],"version-history":[{"count":1,"href":"https:\/\/junkbulk.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/118\/revisions"}],"predecessor-version":[{"id":121,"href":"https:\/\/junkbulk.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/118\/revisions\/121"}],"wp:attachment":[{"href":"https:\/\/junkbulk.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/junkbulk.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/junkbulk.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}