Detect NSFW Content from a Video in Ruby

gem 'cloudmersive-video-api-client', '~> 2.0', '>= 2.0.5'
# load the gem
require 'cloudmersive-video-api-client'
# setup authorization
CloudmersiveVideoApiClient.configure do |config|
# Configure API key authorization: Apikey
config.api_key['Apikey'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Apikey'] = 'Bearer'
end
api_instance = CloudmersiveVideoApiClient::VideoApi.newopts = {
input_file: File.new('/path/to/inputfile'), # File | Input file to perform the operation on.
file_url: 'file_url_example', # String | Optional; URL of a video file being scanned. Use this option for files larger than 2GB.
frames_per_second: 8.14 # Float | Optional; How many video frames per second to be scanned. Minimum value is 0.05 (1 frame per 20 seconds), maximum is 1. Default is 0.33 frame per second (1 frame scanned every 3 seconds). Maximum of 1000 total frames can be scanned, potentially adjusting the framerate for longer videos.
}
begin
#Scan a Video for NSFW content.
result = api_instance.video_scan_for_nsfw(opts)
p result
rescue CloudmersiveVideoApiClient::ApiError => e
puts "Exception when calling VideoApi->video_scan_for_nsfw: #{e}"
end

--

--

--

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

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Efficient Learning — How to efficiently learn fast?

Back in May I decided to make the best of this extra time, given to us by the pandemic.

A Journey from Coffee to Code

How to detect the Text Encoding of a File in Python

Make A Smart Move By Hiring Remote App Development Team From The Best Countries

Beyond Vim emulation inVSCode

Taskrabbit Clone — on demand service platform

taskrabbit clone

Simple AWS S3 Logging in Python3 Using Boto3

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
Cloudmersive

Cloudmersive

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

More from Medium

JWT Authorization with Ruby on Rails API and Redux

How to Sign-up users in an API + Devise + Devise-jwt app, without jumping to the Rails-6.

How I Have Created an Eventbrite Clone with Ruby on Rails: Part III

Building a Fullscript API client ruby gem with method_missing