Last active
August 4, 2024 02:54
-
-
Save borisisok/f9cd2ff36c755ca93eb0a01d121a08d7 to your computer and use it in GitHub Desktop.
Bash functions for movie processing
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
function ffmpeg_c112 { # create content for acer c112 pico beamer | |
m=$(dirname "$1") | |
n=$(basename "$1" | sed 's/mp4$//') | |
dir=/run/media/bgom/FCA7-F289/avi.c112 | |
ffmpeg -i "${m}/${n}mp4" -c:v libx264 -profile:v baseline -c:a libmp3lame -b:a 128k -vf scale=720:406 -r 30 -pix_fmt yuv420p -ar 44100 "${dir}/${n}avi" | |
} | |
# Target: Odroid Go Ultra | |
scale=854:480 | |
# Target: SD | |
scale=1280:720 | |
# Example: crop black bars away and scale for OGU | |
ffmpeg -ss 290 -i "http://mediapi.fritz.box/video/Kung%20Fu%20Panda%202.mkv" -vframes 10 -vf cropdetect -f null - | |
ffplay -vf crop=1920:816:0:134,scale=854:480 -i "http://mediapi.fritz.box/video/Kung%20Fu%20Panda%202.mkv" | |
ffmpeg -i "http://mediapi.fritz.box/video/Kung%20Fu%20Panda%202.mkv" -c:v libx264 -profile:v baseline -c:a libmp3lame -b:a 128k -vf crop=1920:816:0:134,scale=854:480 -r 30 -pix_fmt yuv420p -ar 44100 "ogu_KungFuPanda 2.avi" | |
# Refs | |
https://superuser.com/questions/810471/remove-mp4-video-top-and-bottom-black-bars-using-ffmpeg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment