{"id":3016,"date":"2017-07-03T00:00:44","date_gmt":"2017-07-03T07:00:44","guid":{"rendered":"http:\/\/192.168.3.4\/?p=3016"},"modified":"2018-01-09T06:51:50","modified_gmt":"2018-01-09T14:51:50","slug":"ffmpeg-video-sharpening","status":"publish","type":"post","link":"https:\/\/www.cloudacm.com\/?p=3016","title":{"rendered":"FFMpeg Video Sharpening"},"content":{"rendered":"<p>It can seem magical when blurry and low detail video is refocused.\u00a0 Unsharpen masks are the wizard behind the curtain and FFMpeg has this feature.\u00a0 In this post I&#8217;ll give some examples of the unsharpen mask.\u00a0 I won&#8217;t go into the details or mechanics of how the filter works.\u00a0 This will merely be a quick how to.<\/p>\n<p>I&#8217;m going to be working with a 30 second clip of video that was shot during the 2012 STP bicycle classic.\u00a0 It was shot late in the day on the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Yelm%E2%80%93Tenino_Trail\">Yelm-Tenino trail<\/a> (GPS 46.8701, -122.7489 to be exact).\u00a0 There was a rider that was moving quickly in the opposite direction and we thought it odd.\u00a0 Anyway, this video is a series of still images with varying degrees of unsharpen filtering.<\/p>\n<p><iframe loading=\"lazy\" title=\"FFMpeg Video Sharpening\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/bgK0ZOBDM48?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>The variables are overlayed on the video.\u00a0 For ease of reading, here are the FFMpeg commands I used.<\/p>\n<pre>\r\nffmpeg -ss 00:00:00 -i 201207141826.MOV -t 00:00:30 -c copy 201207141718_SharpenSource.MOV\r\nffmpeg -i 201207141718_SharpenSource.MOV -vf unsharp=3:3:1.5 201207141718_Sharpen_msize_x3_y3_amount_1-5.MOV\r\nffmpeg -i 201207141718_SharpenSource.MOV -vf unsharp=5:5:2 201207141718_Sharpen_msize_x5_y5_amount_2.MOV\r\nffmpeg -i 201207141718_SharpenSource.MOV -vf unsharp=3:3:5 201207141718_Sharpen_msize_x3_y3_amount_5.MOV\r\nffmpeg -i 201207141718_SharpenSource.MOV -vf unsharp=13:13:2.5 201207141718_Sharpen_msize_x13_y13_amount_2-5.MOV\r\nffmpeg -i 201207141718_SharpenSource.MOV -vf unsharp=13:13:5 201207141718_Sharpen_msize_x13_y13_amount_5.MOV\r\n<\/pre>\n<p>These are listed in order of degree of sharping.\u00a0 The msize and amount that I found to work the best for this footage was either 3:3:1.5 or 5:5:2.\u00a0 The imaging begins to become distorted as the amount and msize are increased beyond that.<\/p>\n<p>I also named the file based on the timestamp of the video, so you also can see when this was taken, July 14th, 2012 at 5:18pm.\u00a0 That&#8217;s secondary info that matters little in this post.\u00a0 I like to include it because it will be useful in later processing, which I&#8217;ll cover in later posts.<\/p>\n<p>Anyway, I hope you have enjoyed this brief intro into video enhancements with FFMpeg.\u00a0 I look forward to covering more topics with FFMpeg and hope you will return.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It can seem magical when blurry and low detail video is refocused.\u00a0 Unsharpen masks are the wizard behind the curtain and FFMpeg has this feature.\u00a0 In this post I&#8217;ll give some examples of the unsharpen mask.\u00a0 I won&#8217;t go into the details or mechanics of how the filter works.\u00a0 This will merely be a quick how to. I&#8217;m going to be working with a 30 second clip of video that was shot during the 2012 STP bicycle classic.\u00a0 It was&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.cloudacm.com\/?p=3016\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,3],"tags":[],"class_list":["post-3016","post","type-post","status-publish","format-standard","hentry","category-computer-vision","category-rd"],"_links":{"self":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/3016","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3016"}],"version-history":[{"count":9,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/3016\/revisions"}],"predecessor-version":[{"id":3018,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/3016\/revisions\/3018"}],"wp:attachment":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}