Projects
Multimedia
ffhevc
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 14
View file
ffhevc.changes
Changed
@@ -1,4 +1,21 @@ ------------------------------------------------------------------- +Thu Nov 10 21:15:00 UTC 2016 - neutrino8@opensuse.org + +- Update to version 2.9.8 + * Check if name of input file matches that of output file and warn + and exit. Requires the realpath utility + * Added support for the m2ts, mts and ts containers + * Merged the code that checks if an audio codec is supported by a + container with that that checks for additional output containers. + Removes code duplication and maintainability + * Update to the audio sample rates. Sync them with + ffmpeg -h encoder=<encoder> + * Restrict TrueHD channels to 2, 5 and 6 as that's what the encoder + supports + * Updated the README file + + +------------------------------------------------------------------- Wed Nov 09 07:00:00 UTC 2016 - neutrino8@opensuse.org - Update to version 2.9.7
View file
ffhevc.spec
Changed
@@ -17,7 +17,7 @@ Name: ffhevc -Version: 2.9.7 +Version: 2.9.8 Release: 0 Summary: A small shell script for encoding to H.265/HEVC with ffmpeg License: GPL-2.0+
View file
ffhevc-2.9.7.tar.gz/ChangeLog -> ffhevc-2.9.8.tar.gz/ChangeLog
Changed
@@ -1,3 +1,15 @@ +2016-11-10 - ffhevc 2.9.8 + * Check if name of input file matches that of output file and warn + and exit. Requires the realpath utility + * Added support for the m2ts, mts and ts containers + * Merged the code that checks if an audio codec is supported by a + container with that that checks for additional output containers. + Removes code duplication and maintainability + * Update to the audio sample rates. Sync them with ffmpeg -h encoder=<encoder> + * Restrict TrueHD channels to 2, 5 and 6 as that's what the encoder + supports + * Updated the README file + 2016-11-09 - ffhevc 2.9.7 * Renamed config var CON to CONFMT. Updates config file version to 29 * Reduced some duplication in the audio codec checks for the container
View file
ffhevc-2.9.7.tar.gz/README -> ffhevc-2.9.8.tar.gz/README
Changed
@@ -27,7 +27,7 @@ - it supports cover art for the MKV container. - it supports the x265 presets and tune profiles. - it supports custom written preset files. -- it can output to more than one container. +- it can output to more than one container format. Parameters:
View file
ffhevc-2.9.7.tar.gz/ffhevc -> ffhevc-2.9.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: 2.9.7 -# Date: 2016-11-09 +# Version: 2.9.8 +# Date: 2016-11-10 # # ffhevc is free software ; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ brown() { echo -e "\e[0;33m$1\e[0;39;49m"; } error() { echo -e "\e[1;31m$1\e[0;39;49m"; } -version="2.9.7" +version="2.9.8" CFG="$HOME/.ffhevc" cfgversion="29" @@ -371,12 +371,28 @@ CONFMT="$(echo "$CONFMT" | tr '[:upper:]' '[:lower:]')" + OUTPUT="$OUTPUT.$CONFMT" + + if [ -x "$(which realpath 2>/dev/null)" ]; then + if [ "$(realpath -s "$input")" = "$(realpath -s "$OUTPUT")" ]; then + error "-> Input file matches output file!" + exit 1 + fi + fi + + if [ -e "$OUTPUT" ]; then + echo + error "-> Renaming existing file to '$OUTPUT.old'" + echo + mv -f "$OUTPUT" "$OUTPUT.old" + fi + case "$CONFMT" in - mp4|mov) movflags="-movflags +faststart" ;; - mkv) true ;; + mp4|mov) movflags="-movflags +faststart" ;; + mkv|m2ts|mts|ts) true ;; *) error "-> HEVC video not supported by chosen container!" - error "-> Supported containers are: mkv, mp4 and mov" + error "-> Supported containers are: mkv, mp4, mov, m2ts, mts and ts" error "-> Check your config file, if needed, in '$CFG'" exit 1 ;; @@ -385,7 +401,7 @@ printf "Output to Additional Container Formats? [y/N]: " read acf if [ "$acf" = "y" -o "$acf" = "Y" ]; then - printf "Specify the Container Formats [example: mkv,mp4,mov - press 'Enter' to skip]: " + printf "Specify the Container Formats [example: mp4,mov,m2ts - press 'Enter' to skip]: " read econ test ! -z "$econ" && extracon="$(echo "$econ" | sed 's|,| |g' | tr '[:upper:]' '[:lower:]')" if [ ! -z "$extracon" ]; then @@ -400,7 +416,7 @@ mov) green "-> ac3|eac3|dts|aac|fdk-aac|mp3|vorbis|flac|copy|nosound" ;; other) error "-> HEVC video not supported by the $i container!" - error "-> Supported containers are: mkv, mp4 and mov" + error "-> Supported containers are: mkv, mp4, mov, m2ts, mts and ts" echo exit 1 ;; @@ -414,20 +430,16 @@ fi echo case "$i" in - mkv) green "-> Note: additional container $i supports all the audio codecs" ;; - mp4) container_func mp4 ;; - mov) container_func mov ;; - *) container_func other ;; + mkv|m2ts|ts) green "-> Note: additional container $i supports all the audio codecs" ;; + mp4) container_func mp4 ;; + mov) container_func mov ;; + *) container_func other ;; esac done echo fi fi - OUTPUT="$OUTPUT.$CONFMT" - - test -e "$OUTPUT" && mv -f "$OUTPUT" "$OUTPUT.old" - METATITLE="-metadata title=\"$(basename "${OUTPUT%.*}")\" -metadata:s:v:0 title=\"$(basename "${OUTPUT%.*}")\"" fi @@ -1190,24 +1202,33 @@ ;; esac - case "$CONFMT" in - mp4) - case "${acodec[i]}" in - pcm|opus|flac|truehd) asupport[i]="0" ;; - esac - ;; - mov) - case "${acodec[i]}" in - pcm|opus|truehd) asupport[i]="0" ;; - esac - ;; - esac - - if [ ! -z "${asupport[i]}" ]; then - error "-> ${acodec[i]} is not supported by the $CONFMT container!" - error "-> Check your config file, if needed, in '$CFG'" + conerror_func() { + if [ ! -z "$extracon" ]; then + error "-> Additional container $c does not support ${acodec[i]} audio!" + else + error "-> The $c container does not support ${acodec[i]} audio!" + error "-> Check your config file, if needed, in '$CFG'" + fi + error "-> See: https://en.wikipedia.org/wiki/Comparison_of_video_container_formats" exit 1 - fi + } + + # mkv/m2ts/mts/ts are missing from the list since they + # support all the audio codecs supported by the script + for c in $CONFMT $extracon; do + case "$c" in + mp4) + case "${acodec[i]}" in + pcm|opus|flac|truehd) conerror_func ;; + esac + ;; + mov) + case "${acodec[i]}" in + pcm|opus|truehd) conerror_func ;; + esac + ;; + esac + done if [ "${acodec[i]}" != "copy" ]; then case "${acodec[i]}" in @@ -1258,9 +1279,11 @@ esac case "${acodec[i]}" in - ac3|eac3|truehd|dts|"") chanrange[i]="1-6"; defchan[i]="6" ;; + ac3|eac3|"") chanrange[i]="1-6"; defchan[i]="6" ;; aac|opus|vorbis|flac|pcm) chanrange[i]="1-8"; defchan[i]="8" ;; mp3) chanrange[i]="1-2"; defchan[i]="2" ;; + truehd) chanrange[i]="2/5/6"; defchan[i]="6" ;; + dts) chanrange[i]="1/2/4/5/6"; defchan[i]="6" ;; fdk*) case "${aacprof[i]}" in aac_low|aac_he) chanrange[i]="1-8"; defchan[i]="8" ;; @@ -1288,19 +1311,27 @@ esac case "${acodec[i]}" in - ac3|eac3|truehd|"") + ac3|eac3|"") case "${ach[i]}" in [1-6]) true ;; *) case "${acodec[i]}" in ac3|"") error "-> AC-3 supports only 1-6 channels!" ;; eac3) error "-> E-AC-3 encoder in ffmpeg supports only 1-6 channels!" ;; - truehd) error "-> TrueHD encoder in ffmpeg supports only 1-6 channels!" ;; esac exit 1 ;; esac ;; + truehd) + case "${ach[i]}" in + 2|5|6) true ;; + *) + error "-> TrueHD encoder in ffmpeg supports only 2, 5 and 6 channels!" + exit 1 + ;; + esac + ;; dts) case "${ach[i]}" in 1|2|4|5|6) true ;; @@ -1371,10 +1402,10 @@ error "-> Track $i: could not detect the audio sample rate!" fi echo + brown " Supported Sample Rates" + brown " ~~~~~~~~~~~~~~~~~~~~~~" case "${acodec[i]}" in - mp3|ac3|eac3|dts|"") - brown " Supported Sample Rates" - brown " ~~~~~~~~~~~~~~~~~~~~~~" + ac3|eac3|"") echo " 0 -> 32000 Hz" echo " 1 -> 44100 Hz" echo " 2 -> 48000 Hz" @@ -1391,14 +1422,12 @@ ;; esac ;; - aac|fdk*|flac) - brown " Supported Sample Rates" - brown " ~~~~~~~~~~~~~~~~~~~~~~" - echo " 0 -> 8000 Hz 5 -> 24000 Hz 10 -> 88200 Hz" - echo " 1 -> 11025 Hz 6 -> 32000 Hz 11 -> 96000 Hz" + mp3|dts) + echo " 0 -> 8000 Hz 5 -> 24000 Hz" + echo " 1 -> 11025 Hz 6 -> 32000 Hz" echo " 2 -> 12000 Hz 7 -> 44100 Hz" echo " 3 -> 16000 Hz 8 -> 48000 Hz" - echo " 4 -> 22050 Hz 9 -> 64000 Hz" + echo " 4 -> 22050 Hz" echo printf "Track $i: Specify the Audio Sample Rate option [default is 8]: " read arate[i] @@ -1412,9 +1441,61 @@ 6) audhz[i]="32000" ;; 7) audhz[i]="44100" ;; 8|"") audhz[i]="48000" ;; - 9) audhz[i]="64000" ;; - 10) audhz[i]="88200" ;; - 11) audhz[i]="96000" ;; + *) + error "-> Invalid option!" + exit 1 + ;; + esac + ;; + aac|fdk*) + echo " 0 -> 7350 Hz 5 -> 22050 Hz 10 -> 64000 Hz" + echo " 1 -> 8000 Hz 6 -> 24000 Hz 11 -> 88200 Hz" + echo " 2 -> 11025 Hz 7 -> 32000 Hz 12 -> 96000 Hz" + echo " 3 -> 12000 Hz 8 -> 44100 Hz" + echo " 4 -> 16000 Hz 9 -> 48000 Hz" + echo + printf "Track $i: Specify the Audio Sample Rate option [default is 9]: " + read arate[i] + case "${arate[i]}" in + 0) audhz[i]="7350" ;; + 1) audhz[i]="8000" ;; + 2) audhz[i]="11025" ;; + 3) audhz[i]="12000" ;; + 4) audhz[i]="16000" ;; + 5) audhz[i]="22050" ;; + 6) audhz[i]="24000" ;; + 7) audhz[i]="32000" ;; + 8) audhz[i]="44100" ;; + 9|"") audhz[i]="48000" ;; + 10) audhz[i]="64000" ;; + 11) audhz[i]="88200" ;; + 12) audhz[i]="96000" ;; + *) + error "-> Invalid option!" + exit 1 + ;; + esac + ;; + flac) + echo " 0 -> 8000 Hz 4 -> 32000 Hz 8 -> 96000 Hz" + echo " 1 -> 16000 Hz 5 -> 44100 Hz 9 -> 176400 Hz" + echo " 2 -> 22050 Hz 6 -> 48000 Hz 10 -> 192000 Hz" + echo " 3 -> 24000 Hz 7 -> 88200 Hz" + echo + printf "Track $i: Specify the Audio Sample Rate option [default is 6]: " + read arate[i] + case "${arate[i]}" in + 0) audhz[i]="8000" ;; + 1) audhz[i]="16000" ;; + 2) audhz[i]="22050" ;; + 3) audhz[i]="24000" ;; + 4) audhz[i]="32000" ;; + 5) audhz[i]="44100" ;; + 6|"") audhz[i]="48000" ;; + 7) audhz[i]="88200" ;; + 8) audhz[i]="96000" ;; + 9) audhz[i]="176400" ;; + 10) audhz[i]="192000" ;; *) error "-> Invalid option!" exit 1 @@ -1422,35 +1503,47 @@ esac ;; opus) - brown " Supported Sample Rates" - brown " ~~~~~~~~~~~~~~~~~~~~~~" - echo " 0 -> 8000 Hz 5 -> 24000 Hz" - echo " 1 -> 11025 Hz 6 -> 32000 Hz" - echo " 2 -> 12000 Hz 7 -> 44100 Hz" - echo " 3 -> 16000 Hz 8 -> 48000 Hz" - echo " 4 -> 22050 Hz " + echo " 0 -> 8000 Hz" + echo " 1 -> 12000 Hz" + echo " 2 -> 16000 Hz" + echo " 3 -> 24000 Hz " + echo " 4 -> 48000 Hz" echo - printf "Track $i: Specify the Audio Sample Rate option [default is 8]: " + printf "Track $i: Specify the Audio Sample Rate option [default is 4]: " read arate[i] case "${arate[i]}" in 0) audhz[i]="8000" ;; - 1) audhz[i]="11025" ;; - 2) audhz[i]="12000" ;; - 3) audhz[i]="16000" ;; - 4) audhz[i]="22050" ;; - 5) audhz[i]="24000" ;; - 6) audhz[i]="32000" ;; - 7) audhz[i]="44100" ;; - 8|"") audhz[i]="48000" ;; + 1) audhz[i]="12000" ;; + 2) audhz[i]="16000" ;; + 3) audhz[i]="24000" ;; + 4|"") audhz[i]="48000" ;; *) error "-> Invalid option!" exit 1 ;; esac ;; - vorbis|pcm|truehd) - brown " Supported Sample Rates" - brown " ~~~~~~~~~~~~~~~~~~~~~~" + truehd) + echo " 0 -> 44100 Hz 3 -> 96000 Hz " + echo " 1 -> 48000 Hz 4 -> 176400 Hz" + echo " 2 -> 88200 Hz 5 -> 192000 Hz" + echo + printf "Track $i: Specify the Audio Sample Rate option [default is 1]: " + read arate[i] + case "${arate[i]}" in + 0) audhz[i]="44100" ;; + 1|"") audhz[i]="48000" ;; + 2) audhz[i]="88200" ;; + 3) audhz[i]="96000" ;; + 4) audhz[i]="176400" ;; + 5) audhz[i]="192000" ;; + *) + error "-> Invalid option!" + exit 1 + ;; + esac + ;; + vorbis|pcm) echo " 0 -> 8000 Hz 5 -> 24000 Hz 10 -> 88200 Hz" echo " 1 -> 11025 Hz 6 -> 32000 Hz 11 -> 96000 Hz" echo " 2 -> 12000 Hz 7 -> 44100 Hz 12 -> 176400 Hz" @@ -1495,34 +1588,6 @@ fi done -if [ ! -z "$extracon" ]; then - conerror_func() { - error "-> Additional container $i does not support ${acodec[a]} audio!" - error "-> See: https://en.wikipedia.org/wiki/Comparison_of_video_container_formats#Formats_supported" - exit 1 - } - for i in $extracon; do - case "$i" in - # MKV is missing from the list since it supports - # all the supported audio codecs by the script - mp4) - for a in $(eval echo "{1..$MAX_AUD_TRACKS}"); do - case "${acodec[a]}" in - pcm|opus|flac|truehd) conerror_func ;; - esac - done - ;; - mov) - for a in $(eval echo "{1..$MAX_AUD_TRACKS}"); do - case "${acodec[a]}" in - pcm|opus|truehd) conerror_func ;; - esac - done - ;; - esac - done -fi - if [ ! -z "$skipsetpts" ]; then echo error "-> FPS conversion with the 'setpts' and 'atempo' filters has"
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
.