Projects
Multimedia
ffhevc
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 25
View file
ffhevc.changes
Changed
@@ -1,4 +1,25 @@ ------------------------------------------------------------------- +Sun Nov 20 14:02:00 UTC 2016 - neutrino8@opensuse.org + +- Update to version 3.0.4 + * 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.0.3
View file
ffhevc.spec
Changed
@@ -17,7 +17,7 @@ Name: ffhevc -Version: 3.0.3 +Version: 3.0.4 Release: 0 Summary: A small shell script for encoding to H.265/HEVC with ffmpeg License: GPL-2.0+
View file
ffhevc-3.0.3.tar.gz/install
Deleted
@@ -1,75 +0,0 @@ -#!/usr/bin/env bash -# -# installation script for ffhevc -# - -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/ffhevc -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 ffhevc script & doc/man files -cp -f $(pwd)/ffhevc $BINDIR && chmod 755 $BINDIR/ffhevc -cp -f $(pwd)/ffhevc.1 $MANDIR && gzip -9 $MANDIR/ffhevc.1 && chmod 644 $MANDIR/ffhevc.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/ffhevc -rm -f $MANDIR/ffhevc.1.gz -rm -rf $DOCDIR -echo "" -echo "-> Done" -echo "-> Thanks for using ffhevc!" -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
ffhevc-3.0.3.tar.gz/ChangeLog -> ffhevc-3.0.4.tar.gz/ChangeLog
Changed
@@ -1,3 +1,21 @@ +2016-11-20 - ffhevc 3.0.4 + * 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 - ffhevc 3.0.3 * Use process number instead of .old when renaming existing files * Added support for detelecining (IVTC). Bumps up config file
View file
ffhevc-3.0.4.tar.gz/INSTALL
Added
@@ -0,0 +1,17 @@ + +To install ffhevc: + + * 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 ffhevc: + + * As above, but this time run: sudo make uninstall + + If installed with a different prefix, run: + + * sudo make uninstall PREFIX=/your/directory
View file
ffhevc-3.0.4.tar.gz/Makefile
Added
@@ -0,0 +1,18 @@ +# Makefile for ffhevc + +PREFIX=/usr/local +DOCDIR=$(PREFIX)/share/doc +MANDIR=$(PREFIX)/share/man/man1 + +install: + mkdir -p -m 755 $(PREFIX)/bin $(DOCDIR)/ffhevc $(MANDIR) + + cp -fa ffhevc $(PREFIX)/bin + cp -fa AUTHORS LICENSE README ChangeLog preset.txt $(DOCDIR)/ffhevc + cp -fa ffhevc.1 $(MANDIR) + gzip -9 $(MANDIR)/ffhevc.1 + +uninstall: + rm -f $(PREFIX)/bin/ffhevc + rm -f $(MANDIR)/ffhevc.1.gz + rm -rf $(DOCDIR)/ffhevc
View file
ffhevc-3.0.3.tar.gz/README -> ffhevc-3.0.4.tar.gz/README
Changed
@@ -12,5 +12,5 @@ Parameters: -Run 'ffhevc -h' in a console to see a list of supported parameters or -read the man page (man ffhevc). +Run 'ffhevc -h' in a console to see a list of supported parameters +or read the man page (man ffhevc).
View file
ffhevc-3.0.3.tar.gz/ffhevc -> ffhevc-3.0.4.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.3 -# Date: 2016-11-18 +# Version: 3.0.4 +# Date: 2016-11-20 # # 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.3" +version="3.0.4" CFG="$HOME/.ffhevc" cfgversion="33" @@ -376,6 +376,27 @@ 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|mov) movflags="-movflags +faststart" ;; + mkv|m2ts|mts|ts) true ;; + *) + error "-> HEVC video not supported by the chosen container!" + error "-> Supported containers are: mkv, mp4, mov, m2ts, mts and ts" + 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" @@ -441,7 +462,7 @@ test -z "$confmt" && CONFMT="mkv" || CONFMT="$confmt" fi -CONFMT="$(echo "$CONFMT" | tr '[:upper:]' '[:lower:]')" +check_container_func OUTPUT="$OUTPUT.$CONFMT" @@ -477,17 +498,6 @@ METATITLE="-metadata title=\"$(basename "${OUTPUT%.*}")\" -metadata:s:v:0 title=\"$(basename "${OUTPUT%.*}")\"" -case "$CONFMT" in - mp4|mov) movflags="-movflags +faststart" ;; - mkv|m2ts|mts|ts) true ;; - *) - error "-> HEVC video not supported by the chosen container!" - error "-> Supported containers are: mkv, mp4, mov, m2ts, mts and ts" - 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 @@ -682,7 +692,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 @@ -690,7 +700,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)" ;; @@ -828,11 +838,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 @@ -1240,9 +1261,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 ################ @@ -1264,7 +1286,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" ;; *) @@ -1301,7 +1323,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" @@ -1407,19 +1428,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 @@ -1836,17 +1844,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" ;; @@ -1921,24 +1940,24 @@ test ! -z "$COMMENT" && METACOMMENT="-metadata comment=\"$COMMENT\"" encoder_func() { - VIDOPTS="${EXTSUBS[*]} -map 0:0 -disposition:v:0 default $ofps $NOSUBS $MDATA $CHPS $METATITLE $METAGENRE $METAYEAR $METACOMMENT $vfilters $sws" + VIDOPTS="${EXTSUBS[*]} -map 0:0 -disposition:v:0 default $ofps $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 libx265 -x265-params $passone$X265PARAMS $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
.