Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
86bd63f37c | |||
1be8149a68 | |||
c933503b16 | |||
9448c34702 | |||
a024cd4cd8 | |||
e7b010c236 |
32
README.md
32
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
|
``` bash
|
||||||
extension_thumbnail: "_thumbnail.mp4"
|
extension_thumbnail: "_thumbnail.mp4"
|
||||||
@ -8,25 +22,27 @@ width_thumbnail: 600
|
|||||||
path_videos: "videos"
|
path_videos: "videos"
|
||||||
```
|
```
|
||||||
|
|
||||||
2) Make folder `path_videos`.
|
3) Make folder `path_videos`.
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
mkdir videos
|
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
|
https://github.com/tanrax/auto-video-thumbnail/releases
|
||||||
|
|
||||||
|
|
||||||
5) Now you can execute.
|
6) Now you can execute.
|
||||||
|
|
||||||
``` bash
|
``` 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 (600px 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
|
(ns video-optimize.core
|
||||||
|
(:gen-class)
|
||||||
(:require
|
(:require
|
||||||
[clojure.java.io :as io]
|
[clojure.java.io :as io]
|
||||||
[clojure.string :as str]
|
[clojure.string :as str]
|
||||||
@ -24,7 +25,5 @@
|
|||||||
(prn (str "Optimizing: " path_raw))
|
(prn (str "Optimizing: " path_raw))
|
||||||
;; Optimizing with ffmpeg
|
;; 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)
|
(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!"))
|
(println "Running: Feed me!"))
|
||||||
|
Reference in New Issue
Block a user