Scan a Video for NSFW Content in Java

We have previously show you how to use an API to scan video files for NSFW content in Node.JS. Doing so will ensure that any content associated with your organization meets your standards without having to scrub through each video on your own. In this article, we will be showing you how to use the same API in Java. This API supports several input video formats including AVI, ASF, FLV, MP4, MPEG/MPG, Matroska/WEBM, 3G2, OGV, MKV, M4V and MOV.

Image for post
Image for post

We need to install our SDK, so first, we will add a reference to the repository in pom.xml:

<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

Then, add a reference to the dependency:

<dependencies>
<dependency>
<groupId>com.github.Cloudmersive</groupId>
<artifactId>Cloudmersive.APIClient.Java</artifactId>
<version>v3.54</version>
</dependency>
</dependencies>

Now, we can call our function:

// Import classes:
//import com.cloudmersive.client.invoker.ApiClient;
//import com.cloudmersive.client.invoker.ApiException;
//import com.cloudmersive.client.invoker.Configuration;
//import com.cloudmersive.client.invoker.auth.*;
//import com.cloudmersive.client.VideoApi;

With that, you can instantly scan any video file and ensure that you have a safety net for any video content associated with your organization. You can retrieve your free API Key from Cloudmersive. This will give you access to 800 monthly calls across our entire API library.

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store