Projects
Multimedia
ffx264
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 31
View file
ffx264.changes
Changed
@@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Thu Jan 05 11:35:00 UTC 2017 - neutrino8@opensuse.org + +- Update to version 3.2.4 + * 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.2.3
View file
ffx264.spec
Changed
@@ -17,7 +17,7 @@ Name: ffx264 -Version: 3.2.3 +Version: 3.2.4 Release: 0 Summary: A small shell script for encoding to H.264 with ffmpeg License: GPL-2.0+
View file
ffx264-3.2.3.tar.gz/ChangeLog -> ffx264-3.2.4.tar.gz/ChangeLog
Changed
@@ -1,3 +1,9 @@ +2017-01-05 - ffx264 3.2.4 + * 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 - ffx264 3.2.3 * Use readlink to get the full path to the cover art image. Fixes an issue when running in batch mode
View file
ffx264-3.2.3.tar.gz/README -> ffx264-3.2.4.tar.gz/README
Changed
@@ -14,3 +14,7 @@ Run 'ffx264 -h' in a console to see a list of supported parameters or read the man page (man ffx264). + +Donations: + +PayPal address: neutrino8@gmail.com
View file
ffx264-3.2.3.tar.gz/ffx264 -> ffx264-3.2.4.tar.gz/ffx264
Changed
@@ -2,8 +2,8 @@ # # Small script to encode to H.264/AVC video using FFmpeg and libx264. # Author: Grozdan "microchip" Nikolov <neutrino8@opensuse.org> -# Version: 3.2.3 -# Date: 2017-01-04 +# Version: 3.2.4 +# Date: 2017-01-05 # # ffx264 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.2.3" +version="3.2.4" CFG="$HOME/.ffx264" cfgversion="29" @@ -416,15 +416,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: " @@ -439,7 +445,7 @@ error "-> Could not create the output directory!" exit 1 fi - OUTPUT="$output" + OUTPUT="$(readlink -f "$output")" else OUTPUT="$OUTDIR/$output" fi @@ -851,35 +857,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]: " @@ -1891,7 +1907,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!" @@ -2023,17 +2039,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
.