Projects
Multimedia
ffhevc
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 30
View file
ffhevc.changes
Changed
@@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Thu Jan 05 11:35:00 UTC 2017 - neutrino8@opensuse.org + +- Update to version 3.0.8 + * Support per-file auto-cropping when running in batch mode + * Use internally full paths for input and output + * Add a test case for output directory to the script that gets + sourced for encoding + +------------------------------------------------------------------- Wed Jan 04 13:02:00 UTC 2017 - neutrino8@opensuse.org - Update to version 3.0.7
View file
ffhevc.spec
Changed
@@ -17,7 +17,7 @@ Name: ffhevc -Version: 3.0.7 +Version: 3.0.8 Release: 0 Summary: A small shell script for encoding to H.265/HEVC with ffmpeg License: GPL-2.0+
View file
ffhevc-3.0.7.tar.gz/ChangeLog -> ffhevc-3.0.8.tar.gz/ChangeLog
Changed
@@ -1,3 +1,9 @@ +2017-01-05 - ffhevc 3.0.8 + * Support per-file auto-cropping when running in batch mode + * Use internally full paths for input and output + * Add a test case for output directory to the script that gets + sourced for encoding + 2017-01-04 - ffhevc 3.0.7 * Use readlink to get the full path to the cover art image. Fixes an issue when running in batch mode
View file
ffhevc-3.0.7.tar.gz/README -> ffhevc-3.0.8.tar.gz/README
Changed
@@ -14,3 +14,7 @@ Run 'ffhevc -h' in a console to see a list of supported parameters or read the man page (man ffhevc). + +Donations: + +PayPal address: neutrino8@gmail.com
View file
ffhevc-3.0.7.tar.gz/ffhevc -> ffhevc-3.0.8.tar.gz/ffhevc
Changed
@@ -2,8 +2,8 @@ # # Small script to encode to H.265/HEVC video using FFmpeg and libx265. # Author: Grozdan "microchip" Nikolov <neutrino8@opensuse.org> -# Version: 3.0.7 -# Date: 2017-01-04 +# Version: 3.0.8 +# Date: 2017-01-05 # # ffhevc is free software ; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,7 +24,7 @@ brown() { echo -e "\e[0;33m$1\e[0;39;49m"; } error() { echo -e "\e[1;31m$1\e[0;39;49m"; } -version="3.0.7" +version="3.0.8" CFG="$HOME/.ffhevc" cfgversion="33" @@ -414,15 +414,21 @@ exit 1 fi +input="$(readlink -f "$input")" + if [ ! -z "$batchmode" ]; then OUTPUT="$OUTDIR/$(basename $0)_$$" printf "Specify the Output Directory [default is $OUTPUT]: " read -e output - test -z "$output" && OUTPUT="$OUTPUT/\$i" || OUTPUT="$output/\$i" - mkdir -p "$(dirname "$OUTPUT")" 2>/dev/null - if [ $? != 0 ]; then - error "-> Could not create the output directory!" - exit 1 + if [ -z "$output" ]; then + OUTPUT="$OUTPUT/\$i" + else + mkdir -p "$(dirname "$output/\$i")" 2>/dev/null + if [ $? != 0 ]; then + error "-> Could not create the output directory!" + exit 1 + fi + OUTPUT="$(readlink -f "$output/\$i")" fi else printf "Specify a Name for the Output: " @@ -437,7 +443,7 @@ error "-> Could not create the output directory!" exit 1 fi - OUTPUT="$output" + OUTPUT="$(readlink -f "$output")" else OUTPUT="$OUTDIR/$output" fi @@ -838,35 +844,45 @@ # Used by cropping and bitrate # calc for target file size video_length_func() { - VLENGTH="$($FFPROBE -i "$input" -v error -select_streams v:0 -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 | awk -F. '{print $1}')" + case "$1" in + file) VLENGTH="$($FFPROBE -i "$input" -v error -select_streams v:0 -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 | awk -F. '{print $1}')" ;; + batch) echo "VLENGTH=\"\$($FFPROBE -i \"\$i\" -v error -select_streams v:0 -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 | awk -F. '{print \$1}')\"" ;; + esac } if [ "$AUTOCROP" = "y" ]; then - echo - green "-> Detecting crop values..." - video_length_func - if [ -z "$VLENGTH" -o "$VLENGTH" = "N/A" ]; then - vlength="300" - else - vlength="$VLENGTH" - fi - CROPVAL="$($FFMPEG -ss $(($vlength/2)) -i "$input" -map 0:0 -vf cropdetect=24:4 -frames:v 1000 -f null - 2>&1 | awk '/crop/ {print $NF}' | awk -F= '{print $2}' | tail -1)" - if [ ! -z "$CROPVAL" ]; then - green "-> Found crop values: $CROPVAL" + if [ ! -z "$batchmode" ]; then + printf "Auto-Crop the Input Files? [y/N]: " + read autocrop + CROPVAL="\$($FFMPEG -ss \$((\$VLENGTH/2)) -i \"\$i\" -map 0:0 -vf cropdetect=24:4 -frames:v 1000 -f null - 2>&1 | awk '/crop/ {print \$NF}' | awk -F= '{print \$2}' | tail -1)" + crop="crop=\$CROPVAL," else - error "-> Could not find the crop values!" - CDEF="???" - fi - echo - printf "Specify the Crop Values [default is $CROPVAL$CDEF]: " - read cropval - if [ ! -z "$CDEF" -a -z "$cropval" ]; then echo - error "-> No crop values provided!" - error "-> Skipping!" + green "-> Detecting crop values..." + video_length_func file + if [ -z "$VLENGTH" -o "$VLENGTH" = "N/A" ]; then + vlength="300" + else + vlength="$VLENGTH" + fi + CROPVAL="$($FFMPEG -ss $(($vlength/2)) -i "$input" -map 0:0 -vf cropdetect=24:4 -frames:v 1000 -f null - 2>&1 | awk '/crop/ {print $NF}' | awk -F= '{print $2}' | tail -1)" + if [ ! -z "$CROPVAL" ]; then + green "-> Found crop values: $CROPVAL" + else + error "-> Could not find the crop values!" + CDEF="???" + fi echo - else - test -z "$cropval" && crop="crop=$CROPVAL," || crop="crop=$cropval," + printf "Specify the Crop Values [default is $CROPVAL$CDEF]: " + read cropval + if [ ! -z "$CDEF" -a -z "$cropval" ]; then + echo + error "-> No crop values provided!" + error "-> Skipping!" + echo + else + test -z "$cropval" && crop="crop=$CROPVAL," || crop="crop=$cropval," + fi fi else printf "Specify the Crop Values [press 'Enter' to skip]: " @@ -1863,7 +1879,7 @@ printf "Specify the Target File Size in MiB [default is 5120]: " read tsize test -z "$tsize" && target="5120" || target="$tsize" - video_length_func + video_length_func file if [ -z "$VLENGTH" -o "$VLENGTH" = "N/A" ]; then echo error "-> Could not detect the video length!" @@ -1994,17 +2010,30 @@ echo "#!/usr/bin/env bash" > "$OUTFILE" echo "" >> "$OUTFILE" +echo "green() { echo -e \"\e[1;32m\$1\e[0;39;49m\"; }" >> "$OUTFILE" +echo "red() { echo -e \"\e[1;31m\$1\e[0;39;49m\"; }" >> "$OUTFILE" +echo "" >> "$OUTFILE" +echo "test ! -d \"\$(dirname \"$OUTFILE\")\" && mkdir -p \"\$(dirname \"$OUTFILE\")\"" >> "$OUTFILE" +echo "" >> "$OUTFILE" if [ ! -z "$batchmode" ]; then echo "$CHDIR" >> "$OUTFILE" echo "" >> "$OUTFILE" echo "$FORLOOP_START" >> "$OUTFILE" echo "$CHKFILE_START" >> "$OUTFILE" + if [ "$autocrop" = "y" -o "$autocrop" = "Y" ]; then + echo "" >> "$OUTFILE" + echo "echo" >> "$OUTFILE" + echo "green \"-> Detecting crop values for '\$(basename \"\$i\")'...\"" >> "$OUTFILE" + echo "echo" >> "$OUTFILE" + echo "" >> "$OUTFILE" + video_length_func batch >> "$OUTFILE" + echo "CROPVAL=\"$CROPVAL\"" >> "$OUTFILE" + echo "" >> "$OUTFILE" + fi fi encoder_func $encmode >> "$OUTFILE" echo "" >> "$OUTFILE" if [ ! -z "$remuxcon" ]; then - echo "green() { echo -e \"\e[1;32m\$1\e[0;39;49m\"; }" >> "$OUTFILE" - echo "red() { echo -e \"\e[1;31m\$1\e[0;39;49m\"; }" >> "$OUTFILE" for i in $remuxcon; do echo "" >> "$OUTFILE" echo "echo" >> "$OUTFILE"
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.