Skip to content

Commit

Permalink
Split VideoAndAudioAnalyzer (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
v-jizhang authored and BrianBlum committed Sep 12, 2019
1 parent bb8cf80 commit 7d1d5b1
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ products:

# Analyze videos with a VideoAnalyzerPreset transform

This sample demonstrates how to analyze video and audio in a file. It shows how to perform the following tasks:
This sample demonstrates how to analyze video in a file. It shows how to perform the following tasks:

1. Creates a transform that uses a video analyzer preset.
1. Uploads a video file to an input asset.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>sample</groupId>
<artifactId>AnalyzeVideosJava</artifactId>
<artifactId>VideoAnalyzer</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>AnalyzeVideosJava</name>
<name>VideoAnalyzer</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
Expand Down Expand Up @@ -90,7 +90,7 @@
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<configuration>
<mainClass>sample.VideoAndAudioAnalyzer</mainClass>
<mainClass>sample.VideoAnalyzer</mainClass>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

import org.joda.time.DateTime;

public class VideoAndAudioAnalyzer {
public class VideoAnalyzer {
private static final String VIDEO_ANALYZER_TRANSFORM_NAME = "MyVideoAnalyzerTransformName";
private static final String INPUT_MP4_RESOURCE = "video/ignite.mp4";
private static final String OUTPUT_FOLDER_NAME = "Output";
Expand Down Expand Up @@ -97,8 +97,7 @@ private static void runAnalyzer(ConfigWrapper config) {

try {
// Create a video analyzer preset with both video and audio insights.
Preset preset = new VideoAnalyzerPreset().withInsightsToExtract(InsightsType.ALL_INSIGHTS)
.withAudioLanguage("en-US");
Preset preset = new VideoAnalyzerPreset().withInsightsToExtract(InsightsType.VIDEO_INSIGHTS_ONLY);

// Ensure that you have the desired encoding Transform. This is really a one
// time setup operation.
Expand Down Expand Up @@ -320,7 +319,7 @@ private static Asset createInputAsset(MediaManager manager, String resourceGroup
// That was created by calling Asset's create() method.
CloudBlobContainer container = new CloudBlobContainer(sasUri);

String fileToUpload = VideoAndAudioAnalyzer.class.getClassLoader().getResource(videoResource).getPath();
String fileToUpload = VideoAnalyzer.class.getClassLoader().getResource(videoResource).getPath();
File file = new File(fileToUpload);
CloudBlockBlob blob = container.getBlockBlobReference(file.getName());

Expand Down

0 comments on commit 7d1d5b1

Please sign in to comment.