Projects
Multimedia
ffx264
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 14
View file
ffx264.changes
Changed
@@ -1,4 +1,17 @@ ------------------------------------------------------------------- +Wed Nov 09 07:00:00 UTC 2016 - neutrino8@opensuse.org + +- Update to version 3.1.3 + * Renamed config var CON to CONFMT. Updates config file version + to 25 + * Reduced some duplication in the audio codec checks for the + container formats + * Reduced some error message duplication when checking if an + additional container supports an audio codec + * Rework to the additional container selection code + * Added color functions for the additional container conversion + +------------------------------------------------------------------- Tue Nov 08 10:10:00 UTC 2016 - neutrino8@opensuse.org - Update to version 3.1.2
View file
ffx264.spec
Changed
@@ -17,7 +17,7 @@ Name: ffx264 -Version: 3.1.2 +Version: 3.1.3 Release: 0 Summary: A small shell script for encoding to H.264 with ffmpeg License: GPL-2.0+
View file
ffx264-3.1.2.tar.gz/ChangeLog -> ffx264-3.1.3.tar.gz/ChangeLog
Changed
@@ -1,3 +1,12 @@ +2016-11-09 - ffx264 3.1.3 + * Renamed config var CON to CONFMT. Updates config file version to 25 + * Reduced some duplication in the audio codec checks for the container + formats + * Reduced some error message duplication when checking if an additional + container supports an audio codec + * Rework to the additional container selection code + * Added color functions for the additional container conversion + 2016-11-08 - ffx264 3.1.2 * Added support for encoding to TrueHD audio. Requires a very recent ffmpeg version, preferably latest from git
View file
ffx264-3.1.2.tar.gz/ffx264 -> ffx264-3.1.3.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.2 -# Date: 2016-11-08 +# Version: 3.1.3 +# Date: 2016-11-09 # # ffx264 is free software ; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,10 +23,10 @@ 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.2" +version="3.1.3" CFG="$HOME/.ffx264" -cfgversion="24" +cfgversion="25" genconfig_func() { cat<<EOF>>"$CFG" @@ -42,9 +42,9 @@ # time if a path is provided OUTDIR="$HOME" -# Container extension +# Container format extension # Leave empty to ask each time -CON="mkv" +CONFMT="mkv" # Nice value (0-19) NICE="19" @@ -273,7 +273,7 @@ brown "| |_| |_\ \/ / __) | '_ \| || |_" brown "| _| _|> < / __/| (_) |__ _|" brown "|_| |_| /_/\_\_____|\___/ |_|" -brown "v$version" +brown "v$version by microchip" echo if [ -f "$CFG" ]; then @@ -364,15 +364,15 @@ rm -f "$WRITE" fi - if [ -z "$CON" ]; then + if [ -z "$CONFMT" ]; then printf "Which Container Format to use? [default is mkv]: " read confmt - test -z "$confmt" && CON="mkv" || CON="$confmt" + test -z "$confmt" && CONFMT="mkv" || CONFMT="$confmt" fi - CON="$(echo "$CON" | tr '[:upper:]' '[:lower:]')" + CONFMT="$(echo "$CONFMT" | tr '[:upper:]' '[:lower:]')" - case "$CON" in + case "$CONFMT" in mp4|m4v|mov) movflags="-movflags +faststart" ;; avi) annexb="-bsf:v h264_mp4toannexb" ;; mkv) true ;; @@ -391,47 +391,46 @@ read econ test ! -z "$econ" && extracon="$(echo "$econ" | sed 's|,| |g' | tr '[:upper:]' '[:lower:]')" if [ ! -z "$extracon" ]; then - for i in $extracon; do - if [ "$i" = "$CON" ]; then - error "-> Additional container matches the main output container!" - exit 1 - fi - case "$i" in - mkv|mp4|mov|m4v|avi) true ;; - *) + container_func() { + case "$1" in + mp4|mov|m4v|avi) + green "-> Note: additional container $i supports the following audio codecs:" + ;; + esac + case "$1" in + mp4) green "-> ac3|eac3|dts|aac|fdk-aac|mp3|vorbis|copy|nosound" ;; + mov) green "-> ac3|eac3|dts|aac|fdk-aac|mp3|vorbis|flac|copy|nosound" ;; + m4v) green "-> ac3|aac|fdk-aac|copy|nosound" ;; + avi) green "-> ac3|eac3|dts|aac|fdk-aac|mp3|vorbis|pcm|flac|copy|nosound" ;; + other) error "-> H.264 video not supported by the $i container!" error "-> Supported containers are: mkv, mp4, mov, m4v and avi" + echo exit 1 ;; esac + } + + for i in $extracon; do + if [ "$i" = "$CONFMT" ]; then + error "-> Additional container matches the main output container!" + exit 1 + fi echo case "$i" in - mkv) - green "-> Note: additional container $i supports all the audio codecs" - ;; - mp4) - green "-> Note: additional container $i supports the following audio codecs:" - green "-> ac3|eac3|dts|aac|fdk-aac|mp3|vorbis|copy|nosound" - ;; - mov) - green "-> Note: additional container $i supports the following audio codecs:" - green "-> ac3|eac3|dts|aac|fdk-aac|mp3|vorbis|flac|copy|nosound" - ;; - m4v) - green "-> Note: additional container $i supports the following audio codecs:" - green "-> ac3|aac|fdk-aac|copy|nosound" - ;; - avi) - green "-> Note: additional container $i supports the following audio codecs:" - green "-> ac3|eac3|dts|aac|fdk-aac|mp3|vorbis|pcm|flac|copy|nosound" - ;; + mkv) green "-> Note: additional container $i supports all the audio codecs" ;; + mp4) container_func mp4 ;; + mov) container_func mov ;; + m4v) container_func m4v ;; + avi) container_func avi ;; + *) container_func other ;; esac done echo fi fi - OUTPUT="$OUTPUT.$CON" + OUTPUT="$OUTPUT.$CONFMT" test -e "$OUTPUT" && mv -f "$OUTPUT" "$OUTPUT.old" @@ -452,7 +451,7 @@ test ! -z "$comment" && COMMENT="$comment" fi -if [ "$CON" = "mkv" ]; then +if [ "$CONFMT" = "mkv" ]; then printf "Specify a Cover Image in JPG/PNG format [press 'Enter' to skip]: " read -e cover if [ ! -z "$cover" ]; then @@ -1197,46 +1196,36 @@ exit 1 ;; esac - - case "$CON" in + + case "$CONFMT" in mp4) case "${acodec[i]}" in - pcm|opus|flac|truehd) - error "-> $(echo "${acodec[i]}" | tr '[:lower:]' '[:upper:]') is not supported by the MP4 container!" - error "-> Check your config file, if needed, in '$CFG'" - exit 1 - ;; + pcm|opus|flac|truehd) asupport[i]="0" ;; esac ;; mov) case "${acodec[i]}" in - pcm|opus|truehd) - error "-> $(echo "${acodec[i]}" | tr '[:lower:]' '[:upper:]') is not supported by the MOV container!" - error "-> Check your config file, if needed, in '$CFG'" - exit 1 - ;; + pcm|opus|truehd) asupport[i]="0" ;; esac ;; m4v) case "${acodec[i]}" in - eac3|dts|vorbis|flac|pcm|opus|truehd) - error "-> $(echo "${acodec[i]}" | tr '[:lower:]' '[:upper:]') is not supported by the M4V container!" - error "-> Check your config file, if needed, in '$CFG'" - exit 1 - ;; + eac3|dts|vorbis|flac|pcm|opus|truehd) asupport[i]="0" ;; esac ;; avi) case "${acodec[i]}" in - opus|truehd) - error "-> $(echo "${acodec[i]}" | tr '[:lower:]' '[:upper:]') is not supported by the AVI container!" - error "-> Check your config file, if needed, in '$CFG'" - exit 1 - ;; + opus|truehd) asupport[i]="0" ;; esac ;; esac + if [ ! -z "${asupport[i]}" ]; then + error "-> ${acodec[i]} audio is not supported by the $CONFMT container!" + error "-> Check your config file, if needed, in '$CFG'" + exit 1 + fi + if [ "${acodec[i]}" != "copy" ]; then case "${acodec[i]}" in fdk*) @@ -1314,6 +1303,7 @@ exit 1 ;; esac + case "${acodec[i]}" in ac3|eac3|truehd|"") case "${ach[i]}" in @@ -1523,7 +1513,11 @@ done if [ ! -z "$extracon" ]; then - formats_url="https://en.wikipedia.org/wiki/Comparison_of_video_container_formats#Formats_supported" + 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 @@ -1531,44 +1525,28 @@ mp4) for a in $(eval echo "{1..$MAX_AUD_TRACKS}"); do case "${acodec[a]}" in - pcm|opus|flac|truehd) - error "-> Additional container $i does not support ${acodec[a]} audio!" - error "-> See: $formats_url" - exit 1 - ;; + 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) - error "-> Additional container $i does not support ${acodec[a]} audio!" - error "-> See: $formats_url" - exit 1 - ;; + pcm|opus|truehd) conerror_func ;; esac done ;; m4v) for a in $(eval echo "{1..$MAX_AUD_TRACKS}"); do case "${acodec[a]}" in - eac3|dts|vorbis|flac|pcm|opus|truehd) - error "-> Additional container $i does not support ${acodec[a]} audio!" - error "-> See: $formats_url" - exit 1 - ;; + eac3|dts|vorbis|flac|pcm|opus|truehd) conerror_func ;; esac done ;; avi) for a in $(eval echo "{1..$MAX_AUD_TRACKS}"); do case "${acodec[a]}" in - opus|truehd) - error "-> Additional container $i does not support ${acodec[a]} audio!" - error "-> See: $formats_url" - exit 1 - ;; + opus|truehd) conerror_func ;; esac done ;; @@ -1707,14 +1685,18 @@ encoder_func $mode >> "$OUTFILE.sh" echo "" >> "$OUTFILE.sh" if [ ! -z "$extracon" ]; then + echo "grn() { echo -e \"\e[1;32m\$1\e[0;39;49m\"; }" >> "$OUTFILE.sh" + echo "red() { echo -e \"\e[1;31m\$1\e[0;39;49m\"; }" >> "$OUTFILE.sh" for i in $extracon; do + echo "" >> "$OUTFILE.sh" echo "echo" >> "$OUTFILE.sh" - echo "echo -e \"\e[1;32m-> Converting to $i...\e[0;39;49m\"" >> "$OUTFILE.sh" + echo "grn \"-> Converting to $i...\"" >> "$OUTFILE.sh" + echo "" >> "$OUTFILE.sh" case "$i" in avi) echo "$FFMPEG -i \"$OUTPUT\" -map 0 -c copy -bsf:v h264_mp4toannexb \"${OUTPUT%.*}.$i\" >/dev/null 2>&1" >> "$OUTFILE.sh" ;; *) echo "$FFMPEG -i \"$OUTPUT\" -map 0 -c copy \"${OUTPUT%.*}.$i\" >/dev/null 2>&1" >> "$OUTFILE.sh" ;; esac - echo "test \"\$?\" = \"0\" && echo -e \"\e[1;32m-> Done\e[0;39;49m\" || echo -e \"\e[1;31m-> Failed!\e[0;39;49m\"" >> "$OUTFILE.sh" + echo "test \"\$?\" = \"0\" && grn \"-> Done\" || red \"-> Failed!\"" >> "$OUTFILE.sh" done echo "echo" >> "$OUTFILE.sh" fi
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
.