{"action":"created","comment":{"url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/pulls/comments/80052475","id":80052475,"diff_hunk":"@@ -0,0 +1,103 @@\n+/*\n+ * (C) Copyright 2016 Nuxeo SA (http://nuxeo.com/) and others.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ *\n+ * Contributors:\n+ *     Ricardo Dias\n+ */\n+package org.nuxeo.ecm.platform.video.tools;\n+\n+import org.apache.commons.io.FilenameUtils;\n+import org.apache.commons.lang.StringUtils;\n+import org.nuxeo.ecm.core.api.Blob;\n+import org.nuxeo.ecm.core.api.NuxeoException;\n+import org.nuxeo.ecm.core.api.blobholder.BlobHolder;\n+import org.nuxeo.runtime.api.Framework;\n+\n+import java.io.File;\n+import java.io.IOException;\n+import java.util.Arrays;\n+import java.util.Collections;\n+import java.util.List;\n+import java.util.Map;\n+\n+/**\n+ * The {@link VideoTool} that extracts closed captions.\n+ *\n+ * @since 8.4\n+ */\n+public class VideoClosedCaptionsExtractor extends VideoTool {\n+\n+    public final static String NAME = \"ccExtractorTool\";\n+\n+    public final static String START_AT_PARAM = \"startAt\";\n+\n+    public final static String END_AT_PARAM = \"endAt\";\n+\n+    public final static String OUTPUT_FORMAT_PARAM = \"outFormat\";\n+\n+    protected static final String COMMANDLINE_FULL_VIDEO = \"videoClosedCaptionsExtractor\";\n+\n+    protected static final String COMMANDLINE_SLICED_VIDEO = \"videoPartClosedCaptionsExtractor\";\n+\n+    protected static final String DEFAULT_OUTFORMAT = \"ttxt\";\n+\n+    protected static final List<String> TEXT_OUTFORMATS = Collections.unmodifiableList(\n+            Arrays.asList(\"srt\", \"txt\", \"ttxt\"));","path":"nuxeo-platform-video-core/src/main/java/org/nuxeo/ecm/platform/video/tools/VideoClosedCaptionsExtractor.java","position":57,"original_position":57,"commit_id":"fba24bd6e2b668f9f62fd954834953855e594109","original_commit_id":"fba24bd6e2b668f9f62fd954834953855e594109","user":{"login":"efge","id":592810,"avatar_url":"https://avatars.githubusercontent.com/u/592810?v=3","gravatar_id":"","url":"https://api.github.com/users/efge","html_url":"https://github.com/efge","followers_url":"https://api.github.com/users/efge/followers","following_url":"https://api.github.com/users/efge/following{/other_user}","gists_url":"https://api.github.com/users/efge/gists{/gist_id}","starred_url":"https://api.github.com/users/efge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/efge/subscriptions","organizations_url":"https://api.github.com/users/efge/orgs","repos_url":"https://api.github.com/users/efge/repos","events_url":"https://api.github.com/users/efge/events{/privacy}","received_events_url":"https://api.github.com/users/efge/received_events","type":"User","site_admin":false},"body":"`Arrays.asList` is already unmodifiable, no need to wrap it with `Collections.unmodifiableList`","created_at":"2016-09-22T14:26:03Z","updated_at":"2016-09-22T14:26:03Z","html_url":"https://github.com/nuxeo/nuxeo-platform-video/pull/3#discussion_r80052475","pull_request_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/pulls/comments/80052475"},"html":{"href":"https://github.com/nuxeo/nuxeo-platform-video/pull/3#discussion_r80052475"},"pull_request":{"href":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/pulls/3","id":78322371,"html_url":"https://github.com/nuxeo/nuxeo-platform-video/pull/3","diff_url":"https://github.com/nuxeo/nuxeo-platform-video/pull/3.diff","patch_url":"https://github.com/nuxeo/nuxeo-platform-video/pull/3.patch","issue_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/issues/3","number":3,"state":"open","locked":false,"title":"Feature NXP-19718 Integrate Nuxeo Video Tools Plugin","user":{"login":"richardsd","id":738700,"avatar_url":"https://avatars.githubusercontent.com/u/738700?v=3","gravatar_id":"","url":"https://api.github.com/users/richardsd","html_url":"https://github.com/richardsd","followers_url":"https://api.github.com/users/richardsd/followers","following_url":"https://api.github.com/users/richardsd/following{/other_user}","gists_url":"https://api.github.com/users/richardsd/gists{/gist_id}","starred_url":"https://api.github.com/users/richardsd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardsd/subscriptions","organizations_url":"https://api.github.com/users/richardsd/orgs","repos_url":"https://api.github.com/users/richardsd/repos","events_url":"https://api.github.com/users/richardsd/events{/privacy}","received_events_url":"https://api.github.com/users/richardsd/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-21T14:09:45Z","updated_at":"2016-09-22T14:36:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0931855131513a391d242538513c3a94cd1a65a8","assignee":{"login":"nelsonsilva","id":6028,"avatar_url":"https://avatars.githubusercontent.com/u/6028?v=3","gravatar_id":"","url":"https://api.github.com/users/nelsonsilva","html_url":"https://github.com/nelsonsilva","followers_url":"https://api.github.com/users/nelsonsilva/followers","following_url":"https://api.github.com/users/nelsonsilva/following{/other_user}","gists_url":"https://api.github.com/users/nelsonsilva/gists{/gist_id}","starred_url":"https://api.github.com/users/nelsonsilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelsonsilva/subscriptions","organizations_url":"https://api.github.com/users/nelsonsilva/orgs","repos_url":"https://api.github.com/users/nelsonsilva/repos","events_url":"https://api.github.com/users/nelsonsilva/events{/privacy}","received_events_url":"https://api.github.com/users/nelsonsilva/received_events","type":"User","site_admin":false},"assignees":[{"login":"nelsonsilva","id":6028,"avatar_url":"https://avatars.githubusercontent.com/u/6028?v=3","gravatar_id":"","url":"https://api.github.com/users/nelsonsilva","html_url":"https://github.com/nelsonsilva","followers_url":"https://api.github.com/users/nelsonsilva/followers","following_url":"https://api.github.com/users/nelsonsilva/following{/other_user}","gists_url":"https://api.github.com/users/nelsonsilva/gists{/gist_id}","starred_url":"https://api.github.com/users/nelsonsilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelsonsilva/subscriptions","organizations_url":"https://api.github.com/users/nelsonsilva/orgs","repos_url":"https://api.github.com/users/nelsonsilva/repos","events_url":"https://api.github.com/users/nelsonsilva/events{/privacy}","received_events_url":"https://api.github.com/users/nelsonsilva/received_events","type":"User","site_admin":false},{"login":"troger","id":116786,"avatar_url":"https://avatars.githubusercontent.com/u/116786?v=3","gravatar_id":"","url":"https://api.github.com/users/troger","html_url":"https://github.com/troger","followers_url":"https://api.github.com/users/troger/followers","following_url":"https://api.github.com/users/troger/following{/other_user}","gists_url":"https://api.github.com/users/troger/gists{/gist_id}","starred_url":"https://api.github.com/users/troger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/troger/subscriptions","organizations_url":"https://api.github.com/users/troger/orgs","repos_url":"https://api.github.com/users/troger/repos","events_url":"https://api.github.com/users/troger/events{/privacy}","received_events_url":"https://api.github.com/users/troger/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/pulls/3/commits","review_comments_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/pulls/3/comments","review_comment_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/issues/3/comments","statuses_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/statuses/fba24bd6e2b668f9f62fd954834953855e594109","head":{"label":"nuxeo:feature-NXP-19718-integrate-nuxeo-video-tools-plugin","ref":"feature-NXP-19718-integrate-nuxeo-video-tools-plugin","sha":"fba24bd6e2b668f9f62fd954834953855e594109","user":{"login":"nuxeo","id":460607,"avatar_url":"https://avatars.githubusercontent.com/u/460607?v=3","gravatar_id":"","url":"https://api.github.com/users/nuxeo","html_url":"https://github.com/nuxeo","followers_url":"https://api.github.com/users/nuxeo/followers","following_url":"https://api.github.com/users/nuxeo/following{/other_user}","gists_url":"https://api.github.com/users/nuxeo/gists{/gist_id}","starred_url":"https://api.github.com/users/nuxeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuxeo/subscriptions","organizations_url":"https://api.github.com/users/nuxeo/orgs","repos_url":"https://api.github.com/users/nuxeo/repos","events_url":"https://api.github.com/users/nuxeo/events{/privacy}","received_events_url":"https://api.github.com/users/nuxeo/received_events","type":"Organization","site_admin":false},"repo":{"id":2989002,"name":"nuxeo-platform-video","full_name":"nuxeo/nuxeo-platform-video","owner":{"login":"nuxeo","id":460607,"avatar_url":"https://avatars.githubusercontent.com/u/460607?v=3","gravatar_id":"","url":"https://api.github.com/users/nuxeo","html_url":"https://github.com/nuxeo","followers_url":"https://api.github.com/users/nuxeo/followers","following_url":"https://api.github.com/users/nuxeo/following{/other_user}","gists_url":"https://api.github.com/users/nuxeo/gists{/gist_id}","starred_url":"https://api.github.com/users/nuxeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuxeo/subscriptions","organizations_url":"https://api.github.com/users/nuxeo/orgs","repos_url":"https://api.github.com/users/nuxeo/repos","events_url":"https://api.github.com/users/nuxeo/events{/privacy}","received_events_url":"https://api.github.com/users/nuxeo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nuxeo/nuxeo-platform-video","description":"Nuxeo Platform Video addon","fork":false,"url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video","forks_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/forks","keys_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/teams","hooks_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/hooks","issue_events_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/issues/events{/number}","events_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/events","assignees_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/assignees{/user}","branches_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/branches{/branch}","tags_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/tags","blobs_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/git/refs{/sha}","trees_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/statuses/{sha}","languages_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/languages","stargazers_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/stargazers","contributors_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/contributors","subscribers_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/subscribers","subscription_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/subscription","commits_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/commits{/sha}","git_commits_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/git/commits{/sha}","comments_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/comments{/number}","issue_comment_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/issues/comments{/number}","contents_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/contents/{+path}","compare_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/merges","archive_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/downloads","issues_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/issues{/number}","pulls_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/pulls{/number}","milestones_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/milestones{/number}","notifications_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/labels{/name}","releases_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/releases{/id}","deployments_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/deployments","created_at":"2011-12-15T16:39:02Z","updated_at":"2016-08-24T14:52:58Z","pushed_at":"2016-09-22T11:59:42Z","git_url":"git://github.com/nuxeo/nuxeo-platform-video.git","ssh_url":"git@github.com:nuxeo/nuxeo-platform-video.git","clone_url":"https://github.com/nuxeo/nuxeo-platform-video.git","svn_url":"https://github.com/nuxeo/nuxeo-platform-video","homepage":"","size":24112,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"nuxeo:master","ref":"master","sha":"cb49ae90ca10c8cd97729e3398d139d0d09335aa","user":{"login":"nuxeo","id":460607,"avatar_url":"https://avatars.githubusercontent.com/u/460607?v=3","gravatar_id":"","url":"https://api.github.com/users/nuxeo","html_url":"https://github.com/nuxeo","followers_url":"https://api.github.com/users/nuxeo/followers","following_url":"https://api.github.com/users/nuxeo/following{/other_user}","gists_url":"https://api.github.com/users/nuxeo/gists{/gist_id}","starred_url":"https://api.github.com/users/nuxeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuxeo/subscriptions","organizations_url":"https://api.github.com/users/nuxeo/orgs","repos_url":"https://api.github.com/users/nuxeo/repos","events_url":"https://api.github.com/users/nuxeo/events{/privacy}","received_events_url":"https://api.github.com/users/nuxeo/received_events","type":"Organization","site_admin":false},"repo":{"id":2989002,"name":"nuxeo-platform-video","full_name":"nuxeo/nuxeo-platform-video","owner":{"login":"nuxeo","id":460607,"avatar_url":"https://avatars.githubusercontent.com/u/460607?v=3","gravatar_id":"","url":"https://api.github.com/users/nuxeo","html_url":"https://github.com/nuxeo","followers_url":"https://api.github.com/users/nuxeo/followers","following_url":"https://api.github.com/users/nuxeo/following{/other_user}","gists_url":"https://api.github.com/users/nuxeo/gists{/gist_id}","starred_url":"https://api.github.com/users/nuxeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuxeo/subscriptions","organizations_url":"https://api.github.com/users/nuxeo/orgs","repos_url":"https://api.github.com/users/nuxeo/repos","events_url":"https://api.github.com/users/nuxeo/events{/privacy}","received_events_url":"https://api.github.com/users/nuxeo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nuxeo/nuxeo-platform-video","description":"Nuxeo Platform Video addon","fork":false,"url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video","forks_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/forks","keys_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/teams","hooks_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/hooks","issue_events_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/issues/events{/number}","events_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/events","assignees_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/assignees{/user}","branches_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/branches{/branch}","tags_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/tags","blobs_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/git/refs{/sha}","trees_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/statuses/{sha}","languages_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/languages","stargazers_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/stargazers","contributors_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/contributors","subscribers_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/subscribers","subscription_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/subscription","commits_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/commits{/sha}","git_commits_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/git/commits{/sha}","comments_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/comments{/number}","issue_comment_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/issues/comments{/number}","contents_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/contents/{+path}","compare_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/merges","archive_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/downloads","issues_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/issues{/number}","pulls_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/pulls{/number}","milestones_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/milestones{/number}","notifications_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/labels{/name}","releases_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/releases{/id}","deployments_url":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/deployments","created_at":"2011-12-15T16:39:02Z","updated_at":"2016-08-24T14:52:58Z","pushed_at":"2016-09-22T11:59:42Z","git_url":"git://github.com/nuxeo/nuxeo-platform-video.git","ssh_url":"git@github.com:nuxeo/nuxeo-platform-video.git","clone_url":"https://github.com/nuxeo/nuxeo-platform-video.git","svn_url":"https://github.com/nuxeo/nuxeo-platform-video","homepage":"","size":24112,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/pulls/3"},"html":{"href":"https://github.com/nuxeo/nuxeo-platform-video/pull/3"},"issue":{"href":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/issues/3"},"comments":{"href":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/nuxeo/nuxeo-platform-video/statuses/fba24bd6e2b668f9f62fd954834953855e594109"}}}}
{"actor":{"display_login":"efge"}}