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

Unity3D Testing and Learning#1 (part 1)

[Lessons Learned] Amazon EC2 Placement Groups

Top 5 Programming Languages to Learn for 2022

CS373 Spring 2021 Blog #9: Remus Wong

Unifying AI-to-BI with Azure Synapse Analytics

A quick way to create README using readme.so

Hosting a Laravel Application on AWS Lambda (Full Guide)

Function Internals 1

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

Auto Save Example In PHP & MYSQL.

Auto Save Example In PHP & MYSQL.

Seeding a Rails Database with the YouTube Data API

Why does Chrome use so much RAM 😭?