{"id":1376,"date":"2016-06-01T13:26:52","date_gmt":"2016-06-01T04:26:52","guid":{"rendered":"http:\/\/matoken.org\/blog\/?p=1376"},"modified":"2016-06-01T13:26:52","modified_gmt":"2016-06-01T04:26:52","slug":"try-hiptext","status":"publish","type":"post","link":"https:\/\/matoken.org\/blog\/2016\/06\/01\/try-hiptext\/","title":{"rendered":"\u753b\u50cf\u3084\u52d5\u753b\u3092text\u306b\u5909\u63db\u3059\u308bhiptext\u3092\u8a66\u3059"},"content":{"rendered":"<div id=\"content\">\n<div id=\"preamble\">\n<div class=\"sectionbody\">\n<div class=\"ulist\">\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/jart\/hiptext\">jart\/hiptext: Turn images into text better than caca\/aalib<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p>\u985e\u4f3c\u306e\u3082\u306e\u3067libcaca\u3068\u304b\u304c\u3042\u308a\u307e\u3059\u304c\uff0c<\/p>\n<\/div>\n<div class=\"quoteblock\">\n<blockquote>\n<div class=\"paragraph\">\n<p>Turn images into text better than caca\/aalib<\/p>\n<\/div>\n<\/blockquote>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3068\u306e\u3053\u3068\u3067\u3082\u3063\u3068\u3044\u3044\u3082\u306e\u3089\u3057\u3044\u3067\u3059\uff0e<br \/>\nTexttop<sup class=\"footnote\">[<a id=\"_footnoteref_1\" class=\"footnote\" href=\"#_footnote_1\" title=\"View footnote.\">1<\/a>]<\/sup>\u3067\u4f7f\u308f\u308c\u3066\u3044\u308b\u306e\u3067\u8208\u5473\u3092\u6301\u3063\u305f\u306e\u3067\u3059\u304c\uff0c\u305d\u306e\u307e\u307e\u3067\u306fBuild\u51fa\u6765\u306a\u304b\u3063\u305f\u306e\u3067\u30e1\u30e2\u3067\u3059\uff0e<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_build\">build<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>README\u3067\u306f\u3053\u306e\u8fba\u304c\u5fc5\u8981\u3068\u306e\u3053\u3068\u3067\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>sudo apt-get install build-essential libpng12-dev libjpeg-dev \\\r\n    libfreetype6-dev libgif-dev ragel libavformat-dev libavcodec-dev \\\r\n    libswscale-dev libgflags-dev libgoogle-glog-dev<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>Debian stretch testing\u3067\u306f\u3053\u3093\u306a\u611f\u3058?<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ sudo apt-get install build-essential libpng-dev libjpeg-dev \\\r\n      libfreetype6-dev libgif-dev ragel libavformat-dev libavcodec-dev \\\r\n      libswscale-dev libgflags-dev libgoogle-glog-dev<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>\u5f8c\u306fmake\u3059\u308b\u3060\u3051\u306a\u3093\u3067\u3059\u304c\uff0c\u3053\u3093\u306a\u30a8\u30e9\u30fc\u304c\uff0e\u65b0\u3057\u3044libav\u306b\u8ffd\u5f93\u3067\u304d\u3066\u306a\u3044\u611f\u3058?<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>g++ -g -O3 -std=c++11 -Wall -Wextra -fno-exceptions -fno-rtti -MD  -march=native -c -o movie.o movie.cc\r\nmovie.cc: In member function \u2018void Movie::PrepareRGB(int, int)\u2019:\r\nmovie.cc:56:42: error: \u2018PIX_FMT_RGB24\u2019 was not declared in this scope\r\n                       width_, height_, PIX_FMT_RGB24, SWS_FAST_BILINEAR,\r\n                                          ^\r\nIn file included from graphic.h:10:0,\r\n                 from movie.h:9,\r\n                 from movie.cc:4:\r\nmovie.cc:64:38: error: \u2018avcodec_alloc_frame\u2019 was not declared in this scope\r\n CHECK(frame_ = avcodec_alloc_frame());\r\n                                      ^\r\nmovie.cc:66:19: warning: \u2018int avpicture_get_size(AVPixelFormat, int, int)\u2019 is deprecated [-Wdeprecated-declarations]\r\n   int rgb_bytes = avpicture_get_size(PIX_FMT_RGB24, width_, height_);\r\n                   ^\r\nIn file included from \/usr\/include\/x86_64-linux-gnu\/libavformat\/avformat.h:318:0,\r\n                 from movie.cc:10:\r\n\/usr\/include\/x86_64-linux-gnu\/libavcodec\/avcodec.h:4898:5: note: declared here\r\n int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);\r\n     ^\r\nmovie.cc:66:19: warning: \u2018int avpicture_get_size(AVPixelFormat, int, int)\u2019 is deprecated [-Wdeprecated-declarations]\r\n   int rgb_bytes = avpicture_get_size(PIX_FMT_RGB24, width_, height_);\r\n                   ^\r\nIn file included from \/usr\/include\/x86_64-linux-gnu\/libavformat\/avformat.h:318:0,\r\n                 from movie.cc:10:\r\n\/usr\/include\/x86_64-linux-gnu\/libavcodec\/avcodec.h:4898:5: note: declared here\r\n int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);\r\n     ^\r\nmovie.cc:69:14: warning: \u2018int avpicture_fill(AVPicture*, const uint8_t*, AVPixelFormat, int, int)\u2019 is deprecated [-Wdeprecated-declarations]\r\n   int prep = avpicture_fill(reinterpret_cast&lt;AVPicture*&gt;(frame_rgb_),\r\n              ^\r\nIn file included from \/usr\/include\/x86_64-linux-gnu\/libavformat\/avformat.h:318:0,\r\n                 from movie.cc:10:\r\n\/usr\/include\/x86_64-linux-gnu\/libavcodec\/avcodec.h:4883:5: note: declared here\r\n int avpicture_fill(AVPicture *picture, const uint8_t *ptr,\r\n     ^\r\nmovie.cc:69:14: warning: \u2018int avpicture_fill(AVPicture*, const uint8_t*, AVPixelFormat, int, int)\u2019 is deprecated [-Wdeprecated-declarations]\r\n   int prep = avpicture_fill(reinterpret_cast&lt;AVPicture*&gt;(frame_rgb_),\r\n              ^\r\nIn file included from \/usr\/include\/x86_64-linux-gnu\/libavformat\/avformat.h:318:0,\r\n                 from movie.cc:10:\r\n\/usr\/include\/x86_64-linux-gnu\/libavcodec\/avcodec.h:4883:5: note: declared here\r\n int avpicture_fill(AVPicture *picture, const uint8_t *ptr,\r\n     ^\r\nmovie.cc: In member function \u2018Graphic Movie::Next()\u2019:\r\nmovie.cc:94:5: warning: \u2018void av_free_packet(AVPacket*)\u2019 is deprecated [-Wdeprecated-declarations]\r\n     av_free_packet(&amp;packet);\r\n     ^\r\nIn file included from \/usr\/include\/x86_64-linux-gnu\/libavformat\/avformat.h:318:0,\r\n                 from movie.cc:10:\r\n\/usr\/include\/x86_64-linux-gnu\/libavcodec\/avcodec.h:4040:6: note: declared here\r\n void av_free_packet(AVPacket *pkt);\r\n      ^\r\nmovie.cc:94:5: warning: \u2018void av_free_packet(AVPacket*)\u2019 is deprecated [-Wdeprecated-declarations]\r\n     av_free_packet(&amp;packet);\r\n     ^\r\nIn file included from \/usr\/include\/x86_64-linux-gnu\/libavformat\/avformat.h:318:0,\r\n                 from movie.cc:10:\r\n\/usr\/include\/x86_64-linux-gnu\/libavcodec\/avcodec.h:4040:6: note: declared here\r\n void av_free_packet(AVPacket *pkt);\r\n      ^\r\nmovie.cc:94:27: warning: \u2018void av_free_packet(AVPacket*)\u2019 is deprecated [-Wdeprecated-declarations]\r\n     av_free_packet(&amp;packet);\r\n                           ^\r\nIn file included from \/usr\/include\/x86_64-linux-gnu\/libavformat\/avformat.h:318:0,\r\n                 from movie.cc:10:\r\n\/usr\/include\/x86_64-linux-gnu\/libavcodec\/avcodec.h:4040:6: note: declared here\r\n void av_free_packet(AVPacket *pkt);\r\n      ^\r\n&lt;\u30d3\u30eb\u30c8\u30a4\u30f3&gt;: \u30bf\u30fc\u30b2\u30c3\u30c8 'movie.o' \u306e\u30ec\u30b7\u30d4\u3067\u5931\u6557\u3057\u307e\u3057\u305f\r\nmake: *** [movie.o] \u30a8\u30e9\u30fc 1<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3067\u3082\u4ee5\u4e0b\u306ePR\u3092\u53cd\u6620\u3057\u305f\u3089\u901a\u308a\u307e\u3057\u305f :)<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/jart\/hiptext\/pull\/27\">Ffmpeg improvements by tombh \u00b7 Pull Request #27 \u00b7 jart\/hiptext<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_\u8a66\u3057\u3066\u307f\u308b\">\u8a66\u3057\u3066\u307f\u308b<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>\u30b5\u30f3\u30d7\u30eb\u3068\u3057\u3066\uff0c<code>balls.jpg<\/code>, <code>obama.jpg<\/code> \u304c\u3042\u308b\u306e\u3067\u3053\u308c\u3092\u8a66\u3057\u3066\u307f\u307e\u3059\uff0e<br \/>\n\u3046\u307e\u304f\u52d5\u3044\u3066\u3044\u305d\u3046\u3067\u3059\uff0e<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><a href=\"https:\/\/asciinema.org\/a\/47418\"><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/asciinema.org\/a\/47418.png\" alt=\"47418\"><\/span><\/a><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3067\u3082.png\u306f\u3046\u307e\u304f\u52d5\u304b\u306a\u3044?<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ .\/hiptext ~\/Downloads\/Tux.png\r\nF0601 11:01:16.713266 30721 png.cc:35] Check failed: type == PNG_COLOR_TYPE_RGB || type == PNG_COLOR_TYPE_RGBA png bad type: \/home\/mk\/Downloads\/Tux.png\r\n*** Check failure stack trace: ***\r\n    @     0x7fa48d3c013d  google::LogMessage::Fail()\r\n    @     0x7fa48d3c1fa3  google::LogMessage::SendToLog()\r\n    @     0x7fa48d3bfccb  google::LogMessage::Flush()\r\n    @     0x7fa48d3c298e  google::LogMessageFatal::~LogMessageFatal()\r\n    @           0x41859f  LoadPNG()\r\n    @           0x403fa8  main\r\n    @     0x7fa489e59610  __libc_start_main\r\n    @           0x40a229  _start\r\n    @              (nil)  (unknown)\r\n\u4e2d\u6b62\r\n$ convert ~\/Downloads\/Tux.png .\/Tux.jpg\r\n$ .\/hiptext Tux.jpg<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>`.jpg`\u306b\u5909\u63db\u3057\u305f\u3089\u3044\u3051\u3066\u308b\u611f\u3058\u3067\u3059\u304c\u306a\u3093\u304b\u6b20\u3051\u3066\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><a href=\"https:\/\/www.flickr.com\/photos\/119142834@N05\/26780171563\/in\/dateposted\/\"><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/c4.staticflickr.com\/8\/7579\/26780171563_8d301b27a4.jpg\" alt=\"26780171563 8d301b27a4\"><\/span><\/a><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>\u52d5\u753b\u518d\u751f\u3082\u3044\u3051\u307e\u3059\uff0e\u518d\u751f\u306e\u307f\u3067\u4e00\u6642\u5b9a\u4f4d\u306a\u3069\u306e\u64cd\u4f5c\u306f\u51fa\u6765\u306a\u3044\u611f\u3058?<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><a href=\"https:\/\/asciinema.org\/a\/47425\"><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/asciinema.org\/a\/47425.png\" alt=\"47425\"><\/span><\/a><br \/>\n<em><a href=\"https:\/\/www.youtube.com\/watch?v=1a5hlejlq9E\">\u300c\u3075\u3089\u3044\u3093\u3050\u3046\u3043\u3063\u3061 \u3077\u3061\u300d\u3000\uff03\uff11 &#8211; YouTube<\/a>\u3088\u308a<\/em><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>\u4eca\u306e\u3068\u3053\u308dlibcaca\u3084\u52d5\u753b\u3067\u306fvlc\u3084mplayer\u306a\u3093\u304b\u306e\u307b\u3046\u304c\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u5c0e\u5165\u3067\u304d\u308b\u306e\u3067\u304a\u624b\u8efd\u305d\u3046\uff0e<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3068\u308a\u3042\u3048\u305a\u52d5\u304f\u3088\u3046\u306b\u306a\u3063\u305f\u306e\u3067\u6b21\u306fTexttop\u3092\u8a66\u3057\u3066\u307f\u3088\u3046\u3068\u601d\u3044\u307e\u3059\uff0e<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"footnotes\">\n<hr>\n<div class=\"footnote\" id=\"_footnote_1\">\n<a href=\"#_footnoteref_1\">1<\/a>. <a href=\"https:\/\/github.com\/tombh\/texttop\">tombh\/texttop: A fully interactive X Linux desktop rendered in TTY and streamable over SSH<\/a>\n<\/div>\n<\/div>\n<p><iframe src=\"http:\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=matokensmeme-22&#038;o=9&#038;p=8&#038;l=as4&#038;m=amazon&#038;f=ifr&#038;ref=ss_til&#038;asins=B01DB3G1VO\" style=\"width:120px;height:240px;\" scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\"><\/iframe><iframe src=\"http:\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=matokensmeme-22&#038;o=9&#038;p=8&#038;l=as4&#038;m=amazon&#038;f=ifr&#038;ref=ss_til&#038;asins=B019O8NFDC\" style=\"width:120px;height:240px;\" scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\"><\/iframe><iframe src=\"http:\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=matokensmeme-22&#038;o=9&#038;p=8&#038;l=as4&#038;m=amazon&#038;f=ifr&#038;ref=ss_til&#038;asins=B01FEWTPF4\" style=\"width:120px;height:240px;\" scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>jart\/hiptext: Turn images into text better than caca\/aalib \u985e\u4f3c\u306e\u3082\u306e\u3067libcaca\u3068\u304b\u304c\u3042\u308a\u307e\u3059\u304c\uff0c Turn images into text better [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[7,6,75,90],"tags":[148,276,275,290,291],"class_list":["post-1376","post","type-post","status-publish","format-standard","hentry","category-debian-linux","category-linux","category-stretch","category-testing","tag-ascii","tag-debian-linux","tag-linux","tag-stretch","tag-testing"],"_links":{"self":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/1376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/comments?post=1376"}],"version-history":[{"count":0,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/1376\/revisions"}],"wp:attachment":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/media?parent=1376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/categories?post=1376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/tags?post=1376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}