alpha
Login
or
Join now
kasper.space
/
to
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
[READ-ONLY] Mirror of https://github.com/probablykasper/to. CLI audio, video and image file converter
aiff
audio
cli
flac
gif
image
jp2
jpg
mov
mp3
mp4
ogg
png
video
webm
webp
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
Add opus:#
author
Kasper
date
3 years ago
(Sep 6, 2022, 9:59 AM +0200)
commit
6b11b567
6b11b567ac1394c3ffcae60a11d5642929023974
parent
e4e4305c
e4e4305ced732e3ad3c678706c3c3254c4b4624e
+14
-7
3 changed files
Expand all
Collapse all
Unified
Split
CHANGELOG.md
README.md
bin
to
+2
CHANGELOG.md
View file
Reviewed
···
1
1
## Next
2
2
- Remove jp2
3
3
+
- Remove ogg
4
4
+
- Add opus with custom quality support
3
5
4
6
## 1.4.0 - 2021 Nov 19
5
7
- Change image quality default from 95 to 90
+1
-1
README.md
View file
Reviewed
···
37
37
mp3 320kbps. Custom bitrate example: mp3:128
38
38
flac
39
39
aiff
40
40
-
ogg
40
40
+
opus 256kbps. Custom bitrate example: opus:128
41
41
42
42
Image formats:
43
43
jpg 90 quality. Custom quality example: jpg:75 (0-100)
+11
-6
bin/to
View file
Reviewed
···
39
39
`cyan mp3` 320kbps. Custom bitrate example: `cyan mp3:128`
40
40
`cyan flac`
41
41
`cyan aiff`
42
42
-
`cyan opus`
42
42
+
`cyan opus` 256kbps. Custom bitrate example: `cyan opus:128`
43
43
44
44
`green Image formats:`
45
45
`cyan jpg` 90 quality. Custom quality example: `cyan jpg:75` (0-100)
···
116
116
117
117
# format
118
118
case "$FORMAT" in
119
119
-
mov|webm|wav|flac|aiff|opus)
119
119
+
mov|webm|wav|flac|aiff)
120
120
;;
121
121
mp4|mp4-h264|mp4-h265)
122
122
if [[ $FORMAT == "mp4-h265" ]]; then
···
133
133
OPTIONS+=("-b:a" "256k")
134
134
OPTIONS+=("-preset" "medium")
135
135
;;
136
136
+
opus)
137
137
+
if [[ $AUDIO_BITRATE_CHANGED != true ]]; then
138
138
+
OPTIONS+=("-b:a" "256k")
139
139
+
fi
140
140
+
;;
136
141
mp3)
137
142
if [[ $AUDIO_BITRATE_CHANGED != true ]]; then
138
143
OPTIONS+=("-b:a" "320k")
139
144
fi
140
145
;;
141
141
-
mp3:*)
142
142
-
MP3_REGEX="^(mp3)(:|-|\/)([0-9]{1,3})(k|kbps)?$"
143
143
-
if [[ "$FORMAT" =~ $MP3_REGEX ]]; then
146
146
+
mp3:*|opus:*)
147
147
+
REGEX="^(mp3|opus)(:|-|\/)([0-9]{1,3})(k|kbps)?$"
148
148
+
if [[ "$FORMAT" =~ $REGEX ]]; then
144
149
FORMAT="${BASH_REMATCH[1]}"
145
150
if [[ $AUDIO_BITRATE_CHANGED != true ]]; then
146
146
-
OPTIONS+=("-b:a", "${BASH_REMATCH[3]}k")
151
151
+
OPTIONS+=("-b:a" "${BASH_REMATCH[3]}k")
147
152
fi
148
153
else
149
154
INVALID_FORMAT=true