Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
86bd63f37c | |||
1be8149a68 | |||
c933503b16 | |||
9448c34702 | |||
a024cd4cd8 | |||
e7b010c236 |
34
README.md
34
README.md
@ -1,6 +1,20 @@
|
||||
# Usage
|
||||
# Install
|
||||
|
||||
1) Create `config.yaml`.
|
||||
1) Install Java.
|
||||
|
||||
Debian/Ubuntu
|
||||
|
||||
``` bash
|
||||
sudo apt install default-jdk
|
||||
```
|
||||
|
||||
Mac OS
|
||||
|
||||
``` bash
|
||||
brew install openjdk
|
||||
```
|
||||
|
||||
2) Create `config.yaml`.
|
||||
|
||||
``` bash
|
||||
extension_thumbnail: "_thumbnail.mp4"
|
||||
@ -8,25 +22,27 @@ width_thumbnail: 600
|
||||
path_videos: "videos"
|
||||
```
|
||||
|
||||
2) Make folder `path_videos`.
|
||||
3) Make folder `path_videos`.
|
||||
|
||||
``` bash
|
||||
mkdir videos
|
||||
```
|
||||
|
||||
3) Install `ffmpeg`.
|
||||
4) Install `ffmpeg`.
|
||||
|
||||
4) Download the latest version (`video-optimize-{version}-standalone.jar`).
|
||||
5) Download the latest version (`video-optimize-{version}-SNAPSHOT-standalone.jar`).
|
||||
|
||||
https://github.com/tanrax/auto-video-thumbnail/releases
|
||||
|
||||
|
||||
5) Now you can execute.
|
||||
6) Now you can execute.
|
||||
|
||||
``` bash
|
||||
java $JVM_OPTS -cp video-optimize-{version}-standalone.jar clojure.main -m video-optimize.core
|
||||
java $JVM_OPTS -cp video-optimize-{version}-SNAPSHOT-standalone.jar clojure.main -m video-optimize.core
|
||||
```
|
||||
|
||||
6) Leave videos.
|
||||
7) Leave videos in folder `videos`.
|
||||
|
||||
Everything you leave in the videos folder will be optimized for web with the specified resolution (600 px in this example).
|
||||
Everything you leave in the videos folder will be optimized for web with the specified resolution (600px in this example).
|
||||
|
||||
example.mp4 -> example_thumbnail.mp4
|
||||
|
@ -1,4 +1,5 @@
|
||||
(ns video-optimize.core
|
||||
(:gen-class)
|
||||
(:require
|
||||
[clojure.java.io :as io]
|
||||
[clojure.string :as str]
|
||||
@ -24,7 +25,5 @@
|
||||
(prn (str "Optimizing: " path_raw))
|
||||
;; Optimizing with ffmpeg
|
||||
(shell/sh "ffmpeg" "-y" "-i" path_raw "-vf" (str "scale=" width_thumbnail ":-2") "-c:v" "libx264" "-crf" "23" "-profile:v" "high" "-pix_fmt" "yuv420p" "-color_primaries" "1" "-color_trc" "1" "-colorspace" "1" "-movflags" "+faststart" "-an" "-acodec" "aac" "-ab" "128kb" path_thumbnail)
|
||||
(prn (str "Finish: " path_thumbnail))))
|
||||
)
|
||||
)}])
|
||||
(prn (str "Finish: " path_thumbnail))))))}])
|
||||
(println "Running: Feed me!"))
|
||||
|
Reference in New Issue
Block a user