{"id":882,"date":"2021-08-20T08:15:33","date_gmt":"2021-08-20T07:15:33","guid":{"rendered":"https:\/\/mokrzycki.eu\/blog\/?p=882"},"modified":"2021-08-20T08:17:35","modified_gmt":"2021-08-20T07:17:35","slug":"take-screenshots-from-both-devices-and-merge-them","status":"publish","type":"post","link":"https:\/\/mokrzycki.eu\/blog\/2021\/08\/20\/take-screenshots-from-both-devices-and-merge-them\/","title":{"rendered":"Take screenshots from both devices and merge them"},"content":{"rendered":"\n<p>Recently I had to compare two versions of the app. I had Huawei and Samsung devices.<\/p>\n\n\n\n<p>Instead do it manually I made some research and I created script for that:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>REM Remove previously generated images\ndel huawei.png\ndel samsung.png\n\nREM Remove previously resized images\ndel huawei_r.png\ndel samsung_r.png\n\nREM Rename previously merged image (to keep it)\nren \"huawei_samsung.png\" \"huawei_samsung_old_%time:~0,2%%time:~3,2%-%DATE:\/=%.png\"\n\nREM Command to create a screenshot on the device and then to download it\nREM There were 2 devices, -s XXXX was mandatory to device what device connect to\nadb -s EHT0220B19001804 shell screencap -p \/sdcard\/screencap.png\nadb -s EHT0220B19001804 pull \/sdcard\/screencap.png huawei.png\n\nREM Command to create a screenshot on the device and then to download it\nREM There were 2 devices, -s XXXX was mandatory to device what device connect to\nadb -s 2a1aa4ad06047ece shell screencap -p \/sdcard\/screencap.png\nadb -s 2a1aa4ad06047ece pull \/sdcard\/screencap.png samsung.png\n\nREM To merge it horizontally both images must have the same height\nffmpeg -i huawei.png -vf scale=-2:1080 huawei_r.png\nffmpeg -i samsung.png -vf scale=-2:1080 samsung_r.png\n\nREM Merge both images with split black line in the center\nffmpeg -i huawei_r.png -i samsung_r.png -filter_complex \"&#91;0]pad=iw+5:color=black&#91;left];&#91;left]&#91;1]hstack=inputs=2\" huawei_samsung.png\n\nREM Delete generated images\ndel huawei.png\ndel samsung.png\n\nREM Delete resized images\ndel huawei_r.png\ndel samsung_r.png\n\nREM pause<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I had to compare two versions of the app. I had Huawei and Samsung&#8230;<\/p>\n","protected":false},"author":1,"featured_media":884,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[500],"tags":[465,249,273,537,343,479,541,540,43],"_links":{"self":[{"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/posts\/882"}],"collection":[{"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/comments?post=882"}],"version-history":[{"count":1,"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/posts\/882\/revisions"}],"predecessor-version":[{"id":883,"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/posts\/882\/revisions\/883"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/media\/884"}],"wp:attachment":[{"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/media?parent=882"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/categories?post=882"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/tags?post=882"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}