6 Commits
1.0.0 ... 1.0.1

Author SHA1 Message Date
86bd63f37c Merge pull request #1 from josesanch/master
Add needed gen-class
2020-07-14 11:28:07 +02:00
1be8149a68 Update README.md 2020-07-14 11:25:10 +02:00
c933503b16 Add needed gen-class 2020-07-14 11:24:19 +02:00
9448c34702 Update README.md 2020-07-14 09:39:29 +02:00
a024cd4cd8 Update README.md 2020-07-14 09:38:42 +02:00
e7b010c236 Update README.md 2020-07-14 00:07:50 +02:00
2 changed files with 27 additions and 12 deletions

View File

@ -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 (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

View File

@ -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!"))