freemusicvideo_spec 0.1.0
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/README.md +11 -0
- data/lib/freemusicvideo_spec.rb +70 -0
- metadata +53 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 49f0dc7a3bd8fec2fd20903ca1d600c574fefe933a40240766d569c3e6287cdd
|
|
4
|
+
data.tar.gz: 8c7b8ea763649c158408357c9646d7f186cbd700a6e562b431c2ece3dda98c20
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: c4827d901394868b8c6ed518bdd8f61571e9ad6d3eb5b1c3b356879aaa2eea6057339d058a7f0f4adce2d0077efb8b2a3633f68c023b29f627e0cb6ef3e50f1a
|
|
7
|
+
data.tar.gz: 80dd1cc1c9ff1f8467ba2a5d2d6f56dd84e00f82614dc0a78eed5df672f675dec8aa1a24bc4f10c42c8722f787635b46b18de6fd9b60ce32a32e5fb609625da7
|
data/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# freemusicvideo_spec
|
|
2
|
+
|
|
3
|
+
Free music video maker for your own songs: upload your track and lyrics, watch every word sync on beat, and post it to YouTube, Shorts or TikTok tonight.
|
|
4
|
+
|
|
5
|
+
Pure-Ruby utilities for cleaning Suno/Udio `[Verse]`/`[Chorus]` tags, converting LRC timestamps to SRT/WebVTT, checking 16:9 YouTube and 9:16 Shorts lyric safe zones, and validating 30–45 second free preview clip ranges for [FreeMusicVideo](https://freemusicvideo.ai/).
|
|
6
|
+
|
|
7
|
+
- [Free Lyric Video Maker](https://freemusicvideo.ai/lyric-video-maker)
|
|
8
|
+
- [Free Audio Visualizer](https://freemusicvideo.ai/audio-visualizer)
|
|
9
|
+
- [Free MP3 to Video](https://freemusicvideo.ai/mp3-to-video)
|
|
10
|
+
- [Suno Music Video Maker](https://freemusicvideo.ai/suno-music-video)
|
|
11
|
+
- [Plans & Pricing](https://freemusicvideo.ai/pricing)
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module FreeMusicVideoSpec
|
|
4
|
+
VERSION = "0.1.0"
|
|
5
|
+
BASE_URL = "https://freemusicvideo.ai/"
|
|
6
|
+
LYRIC_VIDEO_URL = "https://freemusicvideo.ai/lyric-video-maker"
|
|
7
|
+
AUDIO_VISUALIZER_URL = "https://freemusicvideo.ai/audio-visualizer"
|
|
8
|
+
MP3_TO_VIDEO_URL = "https://freemusicvideo.ai/mp3-to-video"
|
|
9
|
+
SUNO_MUSIC_VIDEO_URL = "https://freemusicvideo.ai/suno-music-video"
|
|
10
|
+
PRICING_URL = "https://freemusicvideo.ai/pricing"
|
|
11
|
+
MAX_SONG_SECONDS = 480
|
|
12
|
+
|
|
13
|
+
Cue = Struct.new(:start_sec, :end_sec, :text, keyword_init: true)
|
|
14
|
+
|
|
15
|
+
SAFE_ZONES = {
|
|
16
|
+
"16:9" => { width: 1920, height: 1080, left: 140, right: 140, top: 100, bottom: 160, max_chars: 44 }.freeze,
|
|
17
|
+
"9:16" => { width: 1080, height: 1920, left: 72, right: 168, top: 220, bottom: 460, max_chars: 28 }.freeze
|
|
18
|
+
}.freeze
|
|
19
|
+
|
|
20
|
+
module_function
|
|
21
|
+
|
|
22
|
+
def safe_zone(aspect = "16:9")
|
|
23
|
+
SAFE_ZONES.fetch(aspect.to_s, SAFE_ZONES["16:9"])
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def clean_suno_tags(raw)
|
|
27
|
+
raw.to_s.gsub("\r\n", "\n").split("\n")
|
|
28
|
+
.map(&:strip)
|
|
29
|
+
.reject { |line| line.empty? || line.match?(/\A\[[^\]]+\]\z/) }
|
|
30
|
+
.join("\n")
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def parse_lrc(raw)
|
|
34
|
+
cues = []
|
|
35
|
+
raw.to_s.gsub("\r\n", "\n").split("\n").each do |line|
|
|
36
|
+
m = line.strip.match(/\A\[(\d{1,2}):(\d{2})(?:\.(\d{1,3}))?\]\s*(.+)\z/)
|
|
37
|
+
next unless m
|
|
38
|
+
frac = m[3] ? m[3].ljust(3, "0")[0, 3].to_i / 1000.0 : 0.0
|
|
39
|
+
start_s = m[1].to_i * 60 + m[2].to_i + frac
|
|
40
|
+
cues << Cue.new(start_sec: start_s, end_sec: start_s + 3.0, text: m[4].strip)
|
|
41
|
+
end
|
|
42
|
+
cues.each_with_index do |c, i|
|
|
43
|
+
c.end_sec = cues[i + 1].start_sec if i + 1 < cues.length && cues[i + 1].start_sec > c.start_sec
|
|
44
|
+
end
|
|
45
|
+
cues
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def format_srt_timestamp(sec)
|
|
49
|
+
ms = [(sec.to_f * 1000).round, 0].max
|
|
50
|
+
h = ms / 3_600_000
|
|
51
|
+
m = (ms % 3_600_000) / 60_000
|
|
52
|
+
s = (ms % 60_000) / 1_000
|
|
53
|
+
f = ms % 1_000
|
|
54
|
+
format("%02d:%02d:%02d,%03d", h, m, s, f)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def to_srt(cues)
|
|
58
|
+
cues.each_with_index.map do |c, i|
|
|
59
|
+
"#{i + 1}\n#{format_srt_timestamp(c.start_sec)} --> #{format_srt_timestamp(c.end_sec)}\n#{c.text}"
|
|
60
|
+
end.join("\n\n")
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def valid_free_clip?(start_sec, end_sec, song_sec)
|
|
64
|
+
return false if song_sec <= 0 || song_sec > MAX_SONG_SECONDS
|
|
65
|
+
return false if start_sec < 0 || end_sec > song_sec + 0.05 || end_sec <= start_sec
|
|
66
|
+
len = end_sec - start_sec
|
|
67
|
+
min_allowed = [30.0, song_sec.to_f].min
|
|
68
|
+
len >= min_allowed - 0.05 && len <= 45.05
|
|
69
|
+
end
|
|
70
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: freemusicvideo_spec
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- FreeMusicVideo
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-11-30 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: 'Free music video maker for your own songs: upload your track and lyrics,
|
|
14
|
+
watch every word sync on beat, and post it to YouTube, Shorts or TikTok tonight.
|
|
15
|
+
Pure-Ruby LRC/SRT lyric converter, Suno section-tag cleaner, 16:9/9:16 safe-zone
|
|
16
|
+
calculator, and 30-45s chorus clip validator for FreeMusicVideo.'
|
|
17
|
+
email:
|
|
18
|
+
- support@freemusicvideo.ai
|
|
19
|
+
executables: []
|
|
20
|
+
extensions: []
|
|
21
|
+
extra_rdoc_files: []
|
|
22
|
+
files:
|
|
23
|
+
- README.md
|
|
24
|
+
- lib/freemusicvideo_spec.rb
|
|
25
|
+
homepage: https://freemusicvideo.ai/
|
|
26
|
+
licenses:
|
|
27
|
+
- MIT
|
|
28
|
+
metadata:
|
|
29
|
+
homepage_uri: https://freemusicvideo.ai/
|
|
30
|
+
source_code_uri: https://gitlab.com/daniel7dat/freemusicvideo-sdks
|
|
31
|
+
documentation_uri: https://freemusicvideo.ai/llms.txt
|
|
32
|
+
bug_tracker_uri: https://gitlab.com/daniel7dat/freemusicvideo-sdks/-/issues
|
|
33
|
+
post_install_message:
|
|
34
|
+
rdoc_options: []
|
|
35
|
+
require_paths:
|
|
36
|
+
- lib
|
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
38
|
+
requirements:
|
|
39
|
+
- - ">="
|
|
40
|
+
- !ruby/object:Gem::Version
|
|
41
|
+
version: 2.6.0
|
|
42
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0'
|
|
47
|
+
requirements: []
|
|
48
|
+
rubygems_version: 3.0.3.1
|
|
49
|
+
signing_key:
|
|
50
|
+
specification_version: 4
|
|
51
|
+
summary: Free music video maker for your own songs — LRC/SRT lyric prep, Suno tag
|
|
52
|
+
cleaner, and 1080p safe-zone specs.
|
|
53
|
+
test_files: []
|