[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
0

Configure Feed

Select the types of activity you want to include in your feed.

Use dash prefix to pass args directly to ffmpeg/magick

Kasper (May 6, 2019, 12:07 AM +0200) 9c304b98 8e12140c

+8 -10
+2 -3
README.md
··· 21 21 -v, --verbose If you love logs. 22 22 -h, --help Show this help message. 23 23 24 - Video/audio formats support FFmpeg options (see $ ffmpeg -h). 25 - Image formats support ImageMagick options (see $ man magick). 26 - Long FFmpeg/ImageMagick arguments need quotes, like "-ac 128k". 24 + Prefix arguments with - to pass them directly to 25 + FFmpeg or ImageMagick, like --ac -128k. 27 26 ``` 28 27 29 28 # Formats
+6 -7
bin/to
··· 22 22 `cyan -v, --verbose` If you love logs. 23 23 `cyan -h, --help` Show this help message. 24 24 25 - Video/audio formats support FFmpeg options (see `yellow $ ffmpeg -h`). 26 - Image formats support ImageMagick options (see `yellow $ man magick`). 27 - Long FFmpeg/ImageMagick arguments need quotes, like `yellow \\"-ac 128k\\"`. 25 + Prefix arguments with `yellow -` to pass them directly to 26 + FFmpeg or ImageMagick, like `yellow --ac -128k`. 28 27 " 29 28 } 30 29 ··· 73 72 ;; 74 73 -*) 75 74 CUSTOM_OPTIONS=true 76 - OPTIONS+=("$ARG") 75 + OPTIONS+=("${ARG#?}") 77 76 ;; 78 77 *) 79 78 # dont save file if arg is first (aka format) ··· 198 197 NEW_FILE_TEMP="$FILE_WITHOUT_EXT CONVERTING... $((10000 + RANDOM)).$FORMAT" 199 198 200 199 if [[ $CMD == "ffmpeg" ]]; then 201 - ffmpeg -i "$FILE" ${OPTIONS[@]} "$NEW_FILE_TEMP" || { echo `red Error:` Convertion failed; exit 1; } 202 - else 203 - magick ${OPTIONS[@]} "$FILE""[0]" "$NEW_FILE_TEMP" || { echo `red Error:` Convertion failed; exit 1; } 200 + ffmpeg -i "$FILE" "${OPTIONS[@]}" "$NEW_FILE_TEMP" || { echo `red Error:` Convertion failed; exit 1; } 201 + elif [[ $CMD == "magick" ]]; then 202 + magick "${OPTIONS[@]}" "$FILE""[0]" "$NEW_FILE_TEMP" || { echo `red Error:` Convertion failed; exit 1; } 204 203 fi 205 204 206 205 COUNT=1