first-last-frame 1767.774.631
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/first_last_frame.rb +61 -0
- metadata +44 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 8bd8282b73c439f017cd04a4cfa5ac47a62dde0969af08d154518e90cccd21ee
|
|
4
|
+
data.tar.gz: 14c13321ab614f3c33f4475952d7890f871e95c49c5db79b0e864018096b0464
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 4d9d865cd38a0acb1aa3c975f1b8871760d0e2b8e540441dc7d57a68e0d355c7d8e3adbfe9e5c86af5b99818dfa683be86349f336cf212813b756241fba35225
|
|
7
|
+
data.tar.gz: 47c465723278dcaa6a81433ad85ef5a5cc1d3ca515f5ae96fe0fe71b90602738111172668f26fed15211e497073eb3197eba42275ebb4707c29093c14006fe83
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# FirstLastFrame is a module for extracting the first and last frames from a video.
|
|
4
|
+
# It provides utility methods for generating URLs and processing video files.
|
|
5
|
+
module FirstLastFrame
|
|
6
|
+
SUPERMAKER_URL = 'https://supermaker.ai/video/first-last-frame/'.freeze
|
|
7
|
+
|
|
8
|
+
# Returns the full URL to a specified path on the Supermaker website.
|
|
9
|
+
# @param path [String] The path to append to the base URL.
|
|
10
|
+
# @return [String] The full URL.
|
|
11
|
+
def self.get_endpoint(path = '')
|
|
12
|
+
"#{SUPERMAKER_URL}#{path}"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Represents a video file and its associated metadata.
|
|
16
|
+
class Video
|
|
17
|
+
attr_reader :filepath
|
|
18
|
+
|
|
19
|
+
# Initializes a new Video object.
|
|
20
|
+
# @param filepath [String] The path to the video file.
|
|
21
|
+
# @raise [ArgumentError] if the filepath is nil or empty.
|
|
22
|
+
def initialize(filepath)
|
|
23
|
+
raise ArgumentError, 'Filepath cannot be nil or empty' if filepath.nil? || filepath.empty?
|
|
24
|
+
|
|
25
|
+
@filepath = filepath
|
|
26
|
+
validate_file_exists
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Checks if the video file exists.
|
|
30
|
+
# @raise [Errno::ENOENT] if the file does not exist.
|
|
31
|
+
def validate_file_exists
|
|
32
|
+
raise Errno::ENOENT, "File not found: #{@filepath}" unless File.exist?(@filepath)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Returns the filesize in bytes.
|
|
36
|
+
# @return [Integer] The filesize in bytes.
|
|
37
|
+
def filesize
|
|
38
|
+
File.size(@filepath)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Extracts the first frame from a video file.
|
|
43
|
+
# This method provides basic functionality. For extended capabilities and cloud-based features,
|
|
44
|
+
# see https://supermaker.ai/video/first-last-frame/.
|
|
45
|
+
# @param video [FirstLastFrame::Video] The video object.
|
|
46
|
+
# @param output_path [String] The path to save the extracted frame.
|
|
47
|
+
# @return [String] The path to the extracted frame.
|
|
48
|
+
def self.extract_first_frame(video, output_path)
|
|
49
|
+
raise NotImplementedError, 'FirstLastFrame.extract_first_frame not implemented. See https://supermaker.ai/video/first-last-frame/ for cloud-based features.'
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Extracts the last frame from a video file.
|
|
53
|
+
# This method provides basic functionality. For extended capabilities and cloud-based features,
|
|
54
|
+
# see https://supermaker.ai/video/first-last-frame/.
|
|
55
|
+
# @param video [FirstLastFrame::Video] The video object.
|
|
56
|
+
# @param output_path [String] The path to save the extracted frame.
|
|
57
|
+
# @return [String] The path to the extracted frame.
|
|
58
|
+
def self.extract_last_frame(video, output_path)
|
|
59
|
+
raise NotImplementedError, 'FirstLastFrame.extract_last_frame not implemented. See https://supermaker.ai/video/first-last-frame/ for cloud-based features.'
|
|
60
|
+
end
|
|
61
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: first-last-frame
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1767.774.631
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- SuperMaker
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-01-07 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description:
|
|
14
|
+
email:
|
|
15
|
+
- support@supermaker.ai
|
|
16
|
+
executables: []
|
|
17
|
+
extensions: []
|
|
18
|
+
extra_rdoc_files: []
|
|
19
|
+
files:
|
|
20
|
+
- lib/first_last_frame.rb
|
|
21
|
+
homepage: https://supermaker.ai/video/first-last-frame/
|
|
22
|
+
licenses:
|
|
23
|
+
- MIT
|
|
24
|
+
metadata: {}
|
|
25
|
+
post_install_message:
|
|
26
|
+
rdoc_options: []
|
|
27
|
+
require_paths:
|
|
28
|
+
- lib
|
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '2.6'
|
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - ">="
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '0'
|
|
39
|
+
requirements: []
|
|
40
|
+
rubygems_version: 3.0.3.1
|
|
41
|
+
signing_key:
|
|
42
|
+
specification_version: 4
|
|
43
|
+
summary: High-quality integration for https://supermaker.ai/video/first-last-frame/
|
|
44
|
+
test_files: []
|