Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcaption 0.7 (new formula) #34453

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions Formula/libcaption.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
class Libcaption < Formula
desc "Library for the creation and parsing of closed caption data"
homepage "https://github.com/szatmary/libcaption"

url "https://github.com/szatmary/libcaption/archive/0.7.tar.gz"
# version "0.7"
bbgdzxng1 marked this conversation as resolved.
Show resolved Hide resolved
sha256 "125c9c55e1d5f0dc37ef151fa9583dd2fcfaefe7699d348c7292e634859e527e"
revision 0
bbgdzxng1 marked this conversation as resolved.
Show resolved Hide resolved

# --HEAD version
bbgdzxng1 marked this conversation as resolved.
Show resolved Hide resolved
head "https://github.com/szatmary/libcaption.git"

depends_on "cmake" => :build
depends_on "ffmpeg" => :build
bbgdzxng1 marked this conversation as resolved.
Show resolved Hide resolved
depends_on "re2c" => :build

def install
system "cmake", ".", *std_cmake_args
system "make", "install"
end

test do
# Create an FLV video file
INPUT_VIDEO = testpath/"input_video.flv"
system "ffmpeg", "-report", "-hide_banner",
"-f", "lavfi", "-i", "smptebars=duration=2:size=640x360:rate=30",
"-c:v", "libx264", "-crf", "23", "-preset", "ultrafast",
"-f", "flv", INPUT_VIDEO
# system "ffprobe", "-i", INPUT_VIDEO
bbgdzxng1 marked this conversation as resolved.
Show resolved Hide resolved

INPUT_CAPTION_FILE = testpath/"input_caption.srt"
INPUT_CAPTION_FILE.write <<~EOS
1
00:00:00,000 --> 00:00:02,000
Caption Text
EOS
OUTPUT_FILE = testpath/"output.flv"
system bin/"flv+srt", INPUT_VIDEO, INPUT_CAPTION_FILE, OUTPUT_FILE
assert_predicate OUTPUT_FILE, :exist?
end
end