w33tmaricich / kawa Goto Github PK
View Code? Open in Web Editor NEWA clojure wrapper around ffmpeg command line tools.
Home Page: http://w33tmaricich.com/kawa
License: Eclipse Public License 2.0
A clojure wrapper around ffmpeg command line tools.
Home Page: http://w33tmaricich.com/kawa
License: Eclipse Public License 2.0
Start up a player to view video.
I have an ffprobe line of code. I could just work the strings and do a command-line ssh to pull it off, but… strings, reusability, extensibility, maintainability, brittleness…
I am new to ffprobe (and ffmpeg in general), but the working commandline solution is this:
ffprobe -v error -select_streams v:0 -show_entries stream=width,height,display_aspect_ratio -of json=c=1 ./small_test_video.mp4
with results like this:
{
"programs": [
],
"streams": [
{ "width": 1280, "height": 720, "display_aspect_ratio": "16:9" }
]
}
Here is my current attempt in Kawa. Please pardon all the #_
comments; I am trying to figure this out.
(let [file-path (-> env :FILES :media-url (str "small_test_video.mp4"))
test-name :ffprobe
#_#_ mp4 (ffmanager/register :mp4 (ffm/ffmpeg! :format "lavfi" :input-url "testsrc" :duration 10
:pixel-format "yuv420p" "testsrc.mp4"))
ffp (ffmanager/register test-name
(ffm/ffprobe! :input-url file-path :output-format "json"))]
#_(shell/sh "ffprobe" "-v" "error" "-select_streams" "v:0" "-show_entries" "stream=width,height,display_aspect_ratio" "-of" "json=c=1" (-> (:tempfile file) .getAbsolutePath))
(-> (ffmanager/ls) test-name :process #_:out #_#_:err slurp)
;(is false)
)
And then the goal is to reason over that return value to make a decision based on the aspect ratio.
I can't figure out how to get it to output the data I want.
When everything is done and 0.1.0 is ready, upload to clojars.
Create human readable flags for ffmpeg flags that are too terse.
Template out ffplay options to simplify playback configuration.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.