Projects
Multimedia
ffx264
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 26
View file
ffx264.changes
Changed
@@ -1,4 +1,25 @@ ------------------------------------------------------------------- +Sun Nov 20 14:02:00 UTC 2016 - neutrino8@opensuse.org + +- Update to version 3.2.0 + * Moved checks for supported containers into its own function, + check_container_func() + * Improvements to gathering information about the input file. + Saves us piping to sed and in some cases piping to awk and tail + * Removed the NOSOUND option since the user can specify 0 for + amount of audio tracks which equals to encoding with the NOSOUND + option + * Placed both subcopy and subcpy variables into a single subparams + variable. This also removes the NOSUBS variable + * Placed the video length detection code into its own function, + video_length_func(), as it is used in two places so we can + save writing the same stuff twice + * Instead of skipping bitrate calc for target file size in case + we can't detect the video length, ask the user to provide it + * Removed install script and added a Makefile for installation + * Added new INSTALL file with install/uninstall instructions + +------------------------------------------------------------------- Fri Nov 18 01:35:00 UTC 2016 - neutrino8@opensuse.org - Update to version 3.1.9
View file
ffx264.spec
Changed
@@ -17,7 +17,7 @@ Name: ffx264 -Version: 3.1.9 +Version: 3.2.0 Release: 0 Summary: A small shell script for encoding to H.264 with ffmpeg License: GPL-2.0+
View file
ffx264-3.1.9.tar.gz/install
Deleted
@@ -1,75 +0,0 @@ -#!/usr/bin/env bash -# -# installation script for ffx264 -# - -PREFIX=/usr/local - -# Check for root -if [ $PREFIX = "/usr/local" ] && [ $UID != 0 ]; then - echo "-> Login as root to install!" - exit 1 -fi - -BINDIR=$PREFIX/bin -DOCDIR=$PREFIX/share/doc/ffx264 -MANDIR=$PREFIX/man/man1 - -# Remove previously installed doc dir -test -d $DOCDIR && rm -rf $DOCDIR - -# make dirs if needed -for i in $BINDIR $DOCDIR $MANDIR; do - if [ ! -d $i ]; then - mkdir -p -m 755 $i 2>/dev/null - if [ $? != 0 ]; then - echo "-> Failed to make directories... exiting!" - exit 1 - fi - fi -done - -# Copy ffx264 script & doc/man files -cp -f $(pwd)/ffx264 $BINDIR && chmod 755 $BINDIR/ffx264 -cp -f $(pwd)/ffx264.1 $MANDIR && gzip -9 $MANDIR/ffx264.1 && chmod 644 $MANDIR/ffx264.1.gz -for i in AUTHORS ChangeLog LICENSE README preset.txt; do - cp -f $(pwd)/$i $DOCDIR -done -chmod 644 $DOCDIR/* - -# Create uninstall script in $DOCDIR -cat<<EOF>>$DOCDIR/uninstall -#!/usr/bin/env bash - -if [ \$UID != 0 ]; then - echo "-> Login as root to uninstall!" - exit 1 -fi - -rm -f $BINDIR/ffx264 -rm -f $MANDIR/ffx264.1.gz -rm -rf $DOCDIR -echo "" -echo "-> Done" -echo "-> Thanks for using ffx264!" -echo "" - -exit 0 -EOF - -echo -echo "-> Installation successful" -echo -echo "-> Script is installed in $BINDIR" -echo "-> Doc files are installed in $DOCDIR" -echo "-> Man page is installed in $MANDIR" -echo -if [ -f $DOCDIR/uninstall ]; then - chmod 755 $DOCDIR/uninstall - echo "If you want to uninstall the program and all of its files" - echo "afterwards, go to the doc directory in $DOCDIR" - echo "and run as root the 'uninstall' script" -fi -echo - -exit 0
View file
ffx264-3.1.9.tar.gz/ChangeLog -> ffx264-3.2.0.tar.gz/ChangeLog
Changed
@@ -1,3 +1,21 @@ +2016-11-20 - ffx264 3.2.0 + * Moved checks for supported containers into its own function, + check_container_func() + * Improvements to gathering information about the input file. + Saves us piping to sed and in some cases piping to awk and tail + * Removed the NOSOUND option since the user can specify 0 for + amount of audio tracks which equals to encoding with the NOSOUND + option + * Placed both subcopy and subcpy variables into a single subparams + variable. This also removes the NOSUBS variable + * Placed the video length detection code into its own function, + video_length_func(), as it is used in two places so we can + save writing the same stuff twice + * Instead of skipping bitrate calc for target file size in case + we can't detect the video length, ask the user to provide it + * Removed install script and added a Makefile for installation + * Added new INSTALL file with install/uninstall instructions + 2016-11-18 - ffx264 3.1.9 * Use process number instead of .old when renaming existing files * Added support for detelecining (IVTC). Bumps up config file
View file
ffx264-3.2.0.tar.gz/INSTALL
Added
@@ -0,0 +1,17 @@ + +To install ffx264: + + * open a terminal and cd to its directory + * run: sudo make install + + To install in a non-standard directory, run: + + * sudo make install PREFIX=/your/directory + +To uninstall ffx264: + + * As above, but this time run: sudo make uninstall + + If installed with a different prefix, run: + + * sudo make uninstall PREFIX=/your/directory
View file
ffx264-3.2.0.tar.gz/Makefile
Added
@@ -0,0 +1,18 @@ +# Makefile for ffx264 + +PREFIX=/usr/local +DOCDIR=$(PREFIX)/share/doc +MANDIR=$(PREFIX)/share/man/man1 + +install: + mkdir -p -m 755 $(PREFIX)/bin $(DOCDIR)/ffx264 $(MANDIR) + + cp -fa ffx264 $(PREFIX)/bin + cp -fa AUTHORS LICENSE README ChangeLog preset.txt $(DOCDIR)/ffx264 + cp -fa ffx264.1 $(MANDIR) + gzip -9 $(MANDIR)/ffx264.1 + +uninstall: + rm -f $(PREFIX)/bin/ffx264 + rm -f $(MANDIR)/ffx264.1.gz + rm -rf $(DOCDIR)/ffx264
View file
ffx264-3.1.9.tar.gz/README -> ffx264-3.2.0.tar.gz/README
Changed
@@ -12,5 +12,5 @@ Parameters: -Run 'ffx264 -h' in a console to see a list of supported parameters or -read the man page (man ffx264). +Run 'ffx264 -h' in a console to see a list of supported parameters +or read the man page (man ffx264).
View file
ffx264-3.1.9.tar.gz/ffx264 -> ffx264-3.2.0.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.1.9 -# Date: 2016-11-18 +# Version: 3.2.0 +# Date: 2016-11-20 # # 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.1.9" +version="3.2.0" CFG="$HOME/.ffx264" cfgversion="29" @@ -377,6 +377,28 @@ fi fi +# Called twice. Here, to check what is set in +# the config file, and when setting the +# container format at runtime +check_container_func() { + CONFMT="$(echo "$CONFMT" | tr '[:upper:]' '[:lower:]')" + if [ ! -z "$CONFMT" ]; then + case "$CONFMT" in + mp4|m4v|mov) movflags="-movflags +faststart" ;; + avi|m2ts|mts|ts) annexb="-bsf:v h264_mp4toannexb" ;; + mkv|flv) true ;; + *) + error "-> H.264 video not supported by the chosen container!" + error "-> Supported containers are: mkv, mp4, mov, m4v, m2ts, mts, ts, flv and avi" + error "-> Check your config file, if needed, in '$CFG'" + exit 1 + ;; + esac + fi +} + +check_container_func + if [ ! -z "$batchmode" ]; then error "-> Note: batch mode is in effect!" error "-> Be careful which settings you use as they will" @@ -442,7 +464,7 @@ test -z "$confmt" && CONFMT="mkv" || CONFMT="$confmt" fi -CONFMT="$(echo "$CONFMT" | tr '[:upper:]' '[:lower:]')" +check_container_func OUTPUT="$OUTPUT.$CONFMT" @@ -478,18 +500,6 @@ METATITLE="-metadata title=\"$(basename "${OUTPUT%.*}")\" -metadata:s:v:0 title=\"$(basename "${OUTPUT%.*}")\"" -case "$CONFMT" in - mp4|m4v|mov) movflags="-movflags +faststart" ;; - avi|m2ts|mts|ts) annexb="-bsf:v h264_mp4toannexb" ;; - mkv|flv) true ;; - *) - error "-> H.264 video not supported by the chosen container!" - error "-> Supported containers are: mkv, mp4, mov, m4v, m2ts, mts, ts, flv and avi" - error "-> Check your config file, if needed, in '$CFG'" - exit 1 - ;; -esac - printf "Output to Additional Container Formats? [y/N]: " read acf if [ "$acf" = "y" -o "$acf" = "Y" ]; then @@ -695,7 +705,7 @@ # Used by mc/bobbing deinterlace and FPS conversion video_fps_func() { - GETFPS="$($FFPROBE -i "$input" -select_streams v:0 -show_entries stream=r_frame_rate 2>&1 | sed -n 's|^r_frame_rate=||p')" + GETFPS="$($FFPROBE -i "$input" -v error -select_streams v:0 -show_entries stream=r_frame_rate -of default=noprint_wrappers=1:nokey=1 2>&1)" } # Used by mc/bobbing deinterlace, IVTC and interlace-aware encoding @@ -703,7 +713,7 @@ echo green "-> Detecting Field Parity..." sleep 1 - FPAR="$($FFPROBE -i "$input" -show_streams -select_streams v:0 -show_frames -read_intervals %+10 2>&1 | sed -n 's|^field_order=||p' | tail -1)" + FPAR="$($FFPROBE -i "$input" -v error -select_streams v:0 -show_entries stream=field_order -of default=noprint_wrappers=1:nokey=1 2>&1)" case "$FPAR" in t*|T*) fp="tff"; fparity="Top Field First (TFF)" ;; b*|B*) fp="bff"; fparity="Bottom Field First (BFF)" ;; @@ -841,11 +851,22 @@ fi fi +# 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 2>&1 | awk -F. '{print $1}')" +} + if [ "$AUTOCROP" = "y" ]; then echo green "-> Detecting crop values..." - VDUR="$($FFPROBE -i "$input" -select_streams v:0 -show_format 2>&1 | sed -n 's|^duration=||p' | awk -F. '{print $1}')" - CROPVAL="$($FFMPEG -ss $(($VDUR/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)" + 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" else @@ -1253,9 +1274,10 @@ exit 1 ;; esac + subparams="${subcopy[*]} ${subcpy[*]}" fi -test -z "${subcopy[*]}" -a -z "${subcpy[*]}" && NOSUBS="-sn" +test -z "$(echo "$subparams" | sed 's| ||g')" && subparams="-sn" ################ Audio stuff ################ @@ -1277,7 +1299,7 @@ printf "How many Audio Tracks to Encode or Copy? [0-inf - default is 1]: " read atracks case "$atracks" in - 0) audparams[1]="-an"; ATRACKS="0" ;; + 0) audparams[1]="-an"; abitrate[1]="0"; ATRACKS="0" ;; [1-9]*) ATRACKS="$atracks" ;; "") ATRACKS="1" ;; *) @@ -1314,7 +1336,6 @@ echo " FLAC ----> Channels Support: 8 (codec max)" echo " PCM -----> Channels Support: 8 (ffmpeg max)" echo " COPY ----> Channels Support: depends on audio codec" - echo " NOSOUND -> Channels Support: N/A" else echo green "-> Using default audio codec set in config file: $DEFAULT_AUD_CODEC" @@ -1420,19 +1441,6 @@ ofps= fi ;; - nosound) - # nosound takes precedence so - # clear any audio options given - for t in $(eval echo "{1..$ATRACKS}"); do - audparams[t]= - auddispo[t]= - done - echo - error "-> NOSOUND chosen. Clearing all other audio options!" - audparams[1]="-an" - abitrate[1]="0" - break - ;; *) error "-> Unsupported audio codec: ${acodec[i]}" exit 1 @@ -1864,17 +1872,28 @@ printf "Specify the Target File Size in MiB [default is 5120]: " read tsize test -z "$tsize" && target="5120" || target="$tsize" - VLENGTH="$($FFPROBE -i "$input" -select_streams v:0 -show_format 2>&1 | sed -n 's|^duration=||p' | awk -F. '{print $1}')" - if [ -z "$VLENGTH" ]; then + video_length_func + if [ -z "$VLENGTH" -o "$VLENGTH" = "N/A" ]; then echo - error "-> Could not detect video length!" - error "-> Skipping bitrate calculation!" - else + error "-> Could not detect the video length!" + echo + printf "Specify the Video Length in seconds [no default!]: " + read vls + if [ -z "$vls" ]; then + echo + error "-> No value given!" + error "-> Skipping bitrate calc!" + skipbitcalc="1" + else + VLENGHT="$vls" + fi + fi + if [ -z "$skipbitcalc" ]; then # Audio copy, get bitrate for i in $(eval echo "{1..$ATRACKS}"); do if [ "${acodec[i]}" = "copy" ]; then aid[i]="$(($(echo "${atrack[i]}" | awk -F: '{print $2}')-1))" - abtr[i]="$($FFPROBE -i "$input" -show_streams -select_streams a:${aid[i]} 2>&1 | sed -n 's|^bit_rate=||p')" + abtr[i]="$($FFPROBE -i "$input" -v error -select_streams a:${aid[i]} -show_entries stream=bit_rate -of default=noprint_wrappers=1:nokey=1 2>&1)" case "${abtr[i]}" in [1-9]*) abitrate[i]="$((${abtr[i]}/1000))" ;; ""|*) abitrate[i]="0" ;; @@ -1950,24 +1969,24 @@ test ! -z "$COMMENT" && METACOMMENT="-metadata comment=\"$COMMENT\"" encoder_func() { - VIDOPTS="${EXTSUBS[*]} -map 0:0 -disposition:v:0 default $ofps $annexb $NOSUBS $MDATA $CHPS $METATITLE $METAGENRE $METAYEAR $METACOMMENT $vfilters $sws" + VIDOPTS="${EXTSUBS[*]} -map 0:0 -disposition:v:0 default $ofps $annexb $MDATA $CHPS $METATITLE $METAGENRE $METAYEAR $METACOMMENT $vfilters $sws" case "$1" in 1p|crf) test "$encmode" = "1p" && passone="bitrate=$vbitrate" || passone="crf=$CRF" - OPTS1="${audparams[*]} ${subcopy[*]} ${subcpy[*]} $strict $movflags $METACOVER \"$OUTPUT\"" + OPTS1="${audparams[*]} $subparams $strict $movflags $METACOVER \"$OUTPUT\"" ;; 2p) passone="stats=\"${OUTFILE%.*}.log\":pass=1:bitrate=$vbitrate" passtwo="stats=\"${OUTFILE%.*}.log\":pass=2:bitrate=$vbitrate" OPTS1="-an -f null -y /dev/null" - OPTS2="${audparams[*]} ${subcopy[*]} ${subcpy[*]} $strict $movflags $METACOVER \"$OUTPUT\"" + OPTS2="${audparams[*]} $subparams $strict $movflags $METACOVER \"$OUTPUT\"" ;; 3p) passone="stats=\"${OUTFILE%.*}.log\":pass=1:bitrate=$vbitrate" passtwo="stats=\"${OUTFILE%.*}.log\":pass=3:bitrate=$vbitrate" OPTS1="-an -f null -y /dev/null" OPTS2="-an -f null -y /dev/null" - OPTS3="${audparams[*]} ${subcopy[*]} ${subcpy[*]} $strict $movflags $METACOVER \"$OUTPUT\"" + OPTS3="${audparams[*]} $subparams $strict $movflags $METACOVER \"$OUTPUT\"" ;; esac echo "nice -n $NICE $FFMPEG -i \"$input\" $VIDOPTS -c:v libx264 -x264opts $passone$X264PARAMS $OPTS1"
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
.