Convert MP4 to WEBM in Java

YouTube and other online media platforms rely on WEBM as their preferred file format. Where we have previously discussed how to convert files to WEBM in Node.JS, we will now go over how you can apply this process in Java. This API will allow you to use Java to add WEBM conversion capabilities to your applications.

Image for post
Image for post

Our first step is to add a Jitpack reference to the repositories:

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

Next, we can add a reference for our API client to the dependency in pom.xml:

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

Then, we can call our function, VideoConvertToWebm:

// 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;

Now, you can easily convert your video files to WEBM to meet compatibility with online video services. You can retrieve your free API Key from the Cloudmersive website. This will give you access to 800 monthly calls across our library of APIs.

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