Last active
June 14, 2016 05:00
-
-
Save christopher-baek/c727215d3fd95494dcc62c97543c8b73 to your computer and use it in GitHub Desktop.
Media Conversion Examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# method 1 | |
convert *.png -crop 1280x1024-0+87 -crop 1280x1024+0-40 output.png | |
# method 2 | |
# crop an area of 643 by 393 pixels, starting at 7 pixels from the left and 83 pixels from the top of the image | |
mogrify -crop {Width}x{Height}+{X}+{Y} image.png | |
mogrify -crop 643×393+7+83 image.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# batch resize images | |
# Resample image so height and width aren't greater than specified size. | |
sips -Z 300 *.png | |
-Z pixelsWH | |
--resampleHeightWidthMax pixelsWH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i %INPUT%.flac -ab 320k -map_metadata 0 -id3v2_version 3 %OUTPUT%.mp3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flac -cd "${FILE}" | lame -b 320 - "${FILE%.flac}".mp3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install libav-tools | |
# target 245k with a range of 220-260 | |
avconv -i ${INPUT}.flac -qscale:a 0 ${OUTPUT}.mp3 | |
# 320k | |
avconv -i ${INPUT}.flac -c:a libmp3lame -b:a 320k ${OUTPUT}.mp3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hdiutil convert -format UDRW -o ${OUTPUT_FILE} ${INPUT_FILE} | |
dd if=${OUTPUT_FILE} of=/dev/rdiskN bs=1m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i "${FILE}" -acodec libmp3lame -ab 320k "${FILE%.m4a}.mp3" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install libav-tools | |
avconv -i ${INPUT}.m4a ${OUTPUT}.mp3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment