Projects
Multimedia
ffxvid
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 71
View file
ffxvid.changes
Changed
@@ -1,4 +1,14 @@ ------------------------------------------------------------------- +Wed Oct 23 03:15:00 UTC 2019 - neutrino8@opensuse.org + +- Update to version 1.5.3 + * Set default audio codec based on output container format + * Add colr option for MP4Box to the video_colorspace_func() + function and the color primaries code. Only used for MOV + * Add -color_primaries, -color_trc and -colorspace to the + FFmpeg command line options + +------------------------------------------------------------------- Tue Oct 22 04:20:00 UTC 2019 - neutrino8@opensuse.org - Update to version 1.5.2
View file
ffxvid.spec
Changed
@@ -17,9 +17,9 @@ Name: ffxvid -Version: 1.5.2 +Version: 1.5.3 Release: 0 -Summary: A small shell script for encoding to H.264 with ffmpeg +Summary: A small shell script for encoding to Xvid with FFmpeg License: GPL-2.0+ Group: Productivity/Multimedia/Video/Editors and Convertors Url: https://ffxvid.teambelgium.net @@ -27,13 +27,13 @@ Requires: ffmpeg Requires: bc Requires: MPlayer -Requires: gpac +Requires: gpac >= 0.8.0 BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch %description -A small shell script for encoding video files to the MPEG4 Part 2/Xvid video format -using the ffmpeg encoder. +A small shell script for encoding video files to the MPEG-4 Part 2/Xvid video format +using FFmpeg and libxvid. %prep %setup -q
View file
ffxvid-1.5.2.tar.gz/ChangeLog -> ffxvid-1.5.3.tar.gz/ChangeLog
Changed
@@ -1,3 +1,10 @@ +2019-10-23 - ffxvid 1.5.3 + * Set default audio codec based on output container format + * Add colr option for MP4Box to the video_colorspace_func() + function and the color primaries code. Only used for MOV + * Add -color_primaries, -color_trc and -colorspace to the + FFmpeg command line options + 2019-10-22 - ffxvid 1.5.2 * Add support for SRT/SSA/AAS subtitles for the MOV container * Remove the colorprim lines from the video_colorspace_func()
View file
ffxvid-1.5.2.tar.gz/ffxvid -> ffxvid-1.5.3.tar.gz/ffxvid
Changed
@@ -2,8 +2,8 @@ # # Small script to encode to Xvid video using FFmpeg. # Author: Grozdan "microchip" Nikolov <neutrino8@opensuse.org> -# Version: 1.5.2 -# Date: 2019-10-22 +# Version: 1.5.3 +# Date: 2019-10-23 # # 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="1.5.2" +version="1.5.3" CFG="$HOME/.ffxvid" cfgversion="14" @@ -1110,17 +1110,34 @@ echo else case "${VCHARS[3]}" in - smpte2084|bt2020-10) ztrans="bt2020-10" ;; - bt2020-12) ztrans="bt2020-12" ;; - *) ztrans="${VCHARS[3]}" ;; + smpte2084|bt2020-10) ztrans="bt2020-10"; trc="bt2020_10bit"; tc="14" ;; + bt2020-12) ztrans="bt2020-12"; trc="bt2020_12bit"; tc="15" ;; + *) ztrans="${VCHARS[3]}"; trc="bt2020_10bit"; tc="2" ;; esac + printf "Use SMPTE-2084 Transfer? [y/N]: " + read smpte2084 + if [ "$smpte2084" = "y" -o "$smpte2084" = "Y" ]; then + trc="smpte2084" + ztrans="smpte2084" + tc="16" + fi zscale="zscale=transfer=$ztrans" + coloroptions="-color_primaries ${VCHARS[4]} -color_trc $trc -colorspace ${VCHARS[2]}" colcopy="1" + case "${VCHARS[4]}" in + bt709) colchar="1,1,1" ;; + bt470bg) colchar="5,5,5" ;; + smpte170m) colchar="6,6,6" ;; + bt470m) colchar="4,4,6" ;; + bt2020) colchar="9,$tc,9" ;; + *) colchar="2,2,2" ;; + esac + colr=":colr=nclc,$colchar" fi ;; - 1) zscale="zscale=transfer=bt709"; colorspace="colormatrix=bt2020:bt709,colorspace=all=bt709:dither=fsb" ;; - 2) zscale="zscale=transfer=bt470bg"; colorspace="colormatrix=bt2020:bt470bg,colorspace=all=bt470bg:dither=fsb" ;; - 3) zscale="zscale=transfer=smpte170m"; colorspace="colormatrix=bt2020:smpte170m,colorspace=all=smpte170m:dither=fsb" ;; + 1) zscale="zscale=transfer=bt709"; colorspace="colormatrix=bt2020:bt709,colorspace=all=bt709:dither=fsb"; coloroptions="-color_primaries bt709 -color_trc bt709 -colorspace bt709"; colr=":colr=nclc,1,1,1" ;; + 2) zscale="zscale=transfer=bt470bg"; colorspace="colormatrix=bt2020:bt470bg,colorspace=all=bt470bg:dither=fsb"; coloroptions="-color_primaries bt470bg -color_trc gamma28 -colorspace bt470bg"; colr=":colr=nclc,5,5,5" ;; + 3) zscale="zscale=transfer=smpte170m"; colorspace="colormatrix=bt2020:smpte170m,colorspace=all=smpte170m:dither=fsb"; coloroptions="-color_primaries smpte170m -color_trc smpte170m -colorspace smpte170m"; colr=":colr=nclc,6,6,6" ;; *) error "-> Invalid option!" exit 1 @@ -1171,8 +1188,8 @@ printf "Use 10- or 12-bits BT2020 Transfer? [default is 10]: " read bdepth case "$bdepth" in - 10|"") bd="-10" ;; - 12) bd="-12" ;; + 10|"") bd="-10"; bd2="_10bit"; trsr="14" ;; + 12) bd="-12"; bd2="_12bit"; trsr="15" ;; *) error "-> Invalid value!" exit 1 @@ -1212,71 +1229,111 @@ case "$csopt" in 1) cspace="iall=bt470m:ispace=bt470m:itrc=bt470m:iprimaries=bt470m:irange=$irange:all=smpte170m:space=smpte170m:trc=smpte170m:primaries=smpte170m:range=$orange:dither=fsb" + coloroptions="-color_primaries smpte170m -color_trc smpte170m -colorspace smpte170m" + colr=":colr=nclc,6,6,6" ;; 2) cspace="iall=bt470m:ispace=bt470m:itrc=bt470m:iprimaries=bt470m:irange=$irange:all=bt470bg:space=bt470bg:trc=bt470bg:primaries=bt470bg:range=$orange:dither=fsb" + coloroptions="-color_primaries bt470bg -color_trc gamma28 -colorspace bt470bg" + colr=":colr=nclc,5,5,5" ;; 3) cspace="iall=bt470m:ispace=bt470m:itrc=bt470m:iprimaries=bt470m:irange=$irange:all=bt709:space=bt709:trc=bt709:primaries=bt709:range=$orange:dither=fsb" + coloroptions="-color_primaries bt709 -color_trc bt709 -colorspace bt709" + colr=":colr=nclc,1,1,1" ;; 4) video_csmisc_func cspace="iall=bt470m:ispace=bt470m:itrc=bt470m:iprimaries=bt470m:irange=$irange:all=bt2020:space=bt2020ncl:trc=bt2020$bd:primaries=bt2020:range=$orange:dither=fsb" + coloroptions="-color_primaries bt2020 -color_trc bt2020$bd2 -colorspace bt2020$cm" + colr=":colr=nclc,9,$trsr,$cmatrix" ;; 5) cspace="iall=smpte170m:ispace=smpte170m:itrc=smpte170m:iprimaries=smpte170m:irange=$irange:all=bt470m:space=bt470m:trc=bt470m:primaries=bt470m:range=$orange:dither=fsb" + coloroptions="-color_primaries bt470m -color_trc gamma22 -colorspace smpte170m" + colr=":colr=nclc,4,4,6" ;; 6) cspace="iall=smpte170m:ispace=smpte170m:itrc=smpte170m:iprimaries=smpte170m:irange=$irange:all=bt470bg:space=bt470bg:trc=bt470bg:primaries=bt470bg:range=$orange:dither=fsb" + coloroptions="-color_primaries bt470bg -color_trc gamma28 -colorspace bt470bg" + colr=":colr=nclc,5,5,5" ;; 7) cspace="iall=smpte170m:ispace=smpte170m:itrc=smpte170m:iprimaries=smpte170m:irange=$irange:all=bt709:space=bt709:trc=bt709:primaries=bt709:range=$orange:dither=fsb" + coloroptions="-color_primaries bt709 -color_trc bt709 -colorspace bt709" + colr=":colr=nclc,1,1,1" ;; 8) video_csmisc_func cspace="iall=smpte170m:ispace=smpte170m:itrc=smpte170m:iprimaries=smpte170m:irange=$irange:all=bt2020:space=bt2020ncl:trc=bt2020$bd:primaries=bt2020:range=$orange:dither=fsb" + coloroptions="-color_primaries bt2020 -color_trc bt2020$bd2 -colorspace bt2020$cm" + colr=":colr=nclc,9,$trsr,$cmatrix" ;; 9) cspace="iall=bt470bg:ispace=bt470bg:itrc=bt470bg:iprimaries=bt470bg:irange=$irange:all=bt470m:space=bt470m:trc=bt470m:primaries=bt470m:range=$orange:dither=fsb" + coloroptions="-color_primaries bt470m -color_trc gamma22 -colorspace smpte170m" + colr=":colr=nclc,4,4,6" ;; 10) cspace="iall=bt470bg:ispace=bt470bg:itrc=bt470bg:iprimaries=bt470bg:irange=$irange:all=smpte170m:space=smpte170m:trc=smpte170m:primaries=smpte170m:range=$orange:dither=fsb" + coloroptions="-color_primaries smpte170m -color_trc smpte170m -colorspace smpte170m" + colr=":colr=nclc,6,6,6" ;; 11) cspace="iall=bt470bg:ispace=bt470bg:itrc=bt470bg:iprimaries=bt470bg:irange=$irange:all=bt709:space=bt709:trc=bt709:primaries=bt709:range=$orange:dither=fsb" + coloroptions="-color_primaries bt709 -color_trc bt709 -colorspace bt709" + colr=":colr=nclc,1,1,1" ;; 12) video_csmisc_func cspace="iall=bt470bg:ispace=bt470bg:itrc=bt470bg:iprimaries=bt470bg:irange=$irange:all=bt2020:space=bt2020ncl:trc=bt2020$bd:primaries=bt2020:range=$orange:dither=fsb" + coloroptions="-color_primaries bt2020 -color_trc bt2020$bd2 -colorspace bt2020$cm" + colr=":colr=nclc,9,$trsr,$cmatrix" ;; 13) cspace="iall=bt709:ispace=bt709:itrc=bt709:iprimaries=bt709:irange=$irange:all=bt470m:space=bt470m:trc=bt470m:primaries=bt470m:range=$orange:dither=fsb" + coloroptions="-color_primaries bt470m -color_trc gamma22 -colorspace smpte170m" + colr=":colr=nclc,4,4,6" ;; 14) cspace="iall=bt709:ispace=bt709:itrc=bt709:iprimaries=bt709:irange=$irange:all=smpte170m:space=smpte170m:trc=smpte170m:primaries=smpte170m:range=$orange:dither=fsb" + coloroptions="-color_primaries smpte170m -color_trc smpte170m -colorspace smpte170m" + colr=":colr=nclc,6,6,6" ;; 15) cspace="iall=bt709:ispace=bt709:itrc=bt709:iprimaries=bt709:irange=$irange:all=bt470bg:space=bt470bg:trc=bt470bg:primaries=bt470bg:range=$orange:dither=fsb" + coloroptions="-color_primaries bt470bg -color_trc gamma28 -colorspace bt470bg" + colr=":colr=nclc,5,5,5" ;; 16) video_csmisc_func cspace="iall=bt709:ispace=bt709:itrc=bt709:iprimaries=bt709:irange=$irange:all=bt2020:space=bt2020ncl:trc=bt2020$bd:primaries=bt2020:range=$orange:dither=fsb" + coloroptions="-color_primaries bt2020 -color_trc bt2020$bd2 -colorspace bt2020$cm" + colr=":colr=nclc,9,$trsr,$cmatrix" ;; 17) video_csmisc_func cspace="iall=bt2020:ispace=bt2020ncl:itrc=bt2020$bd:iprimaries=bt2020:irange=$irange:all=bt470m:space=bt470m:trc=bt470m:primaries=bt470m:range=$orange:dither=fsb" + coloroptions="-color_primaries bt470m -color_trc gamma22 -colorspace smpte170m" + colr=":colr=nclc,4,4,6" ;; 18) video_csmisc_func cspace="iall=bt2020:ispace=bt2020ncl:itrc=bt2020$bd:iprimaries=bt2020:irange=$irange:all=smpte170m:space=smpte170m:trc=smpte170m:primaries=smpte170m:range=$orange:dither=fsb" + coloroptions="-color_primaries smpte170m -color_trc smpte170m -colorspace smpte170m" + colr=":colr=nclc,6,6,6" ;; 19) video_csmisc_func cspace="iall=bt2020:ispace=bt2020ncl:itrc=bt2020$bd:iprimaries=bt2020:irange=$irange:all=bt470bg:space=bt470bg:trc=bt470bg:primaries=bt470bg:range=$orange:dither=fsb" + coloroptions="-color_primaries bt470bg -color_trc gamma28 -colorspace bt470bg" + colr=":colr=nclc,5,5,5" ;; 20) video_csmisc_func cspace="iall=bt2020:ispace=bt2020ncl:itrc=bt2020$bd:iprimaries=bt2020:irange=$irange:all=bt709:space=bt709:trc=bt709:primaries=bt709:range=$orange:dither=fsb" + coloroptions="-color_primaries bt709 -color_trc bt709 -colorspace bt709" + colr=":colr=nclc,1,1,1" ;; "") true ;; *) @@ -2126,14 +2183,21 @@ auddispo[i]="-disposition:a:${audindex[i]} $adispo" if [ -z "$DEFAULT_AUD_CODEC" ]; then - printf "Track $i: Specify the Audio Codec [default is AC3]: " + case "${OUTPUT##*.}" in + mp4|m4v|mov) defacodec[i]="AAC" ;; + avi) defacodec[i]="MP3" ;; + wmv) defacodec[i]="WMAv2" ;; + *) defacodec[i]="AC3" ;; + esac + printf "Track $i: Specify the Audio Codec [default is ${defacodec[i]}]: " read acodec[i] else acodec[i]="$DEFAULT_AUD_CODEC" fi + test -z "${acodec[i]}" && acodec[i]="${defacodec[i]}" acodec[i]="$(echo "${acodec[i]}" | tr '[:upper:]' '[:lower:]')" case "${acodec[i]}" in - ac3|"") + ac3) acdc[i]="ac3" ameta[i]="AC-3" abropts[i]="192/384/448/640" @@ -2331,7 +2395,7 @@ esac case "${acodec[i]}" in - ac3|eac3|truehd|dts|aac|fdk*|mp3|vorbis|libopus|opus|wmav1|wmav2|"") + ac3|eac3|truehd|dts|aac|fdk*|mp3|vorbis|libopus|opus|wmav1|wmav2) printf "Track $i: Specify the Audio Bitrate in kbps [${abropts[i]} - default is ${abrdef[i]}]: " read abr[i] test -z "${abr[i]}" && abitrate[i]="${abrdef[i]}k" || abitrate[i]="${abr[i]}k" @@ -2341,7 +2405,7 @@ esac case "${acodec[i]}" in - ac3|eac3|"") chanrange[i]="1-6"; defchan[i]="6" ;; + ac3|eac3) chanrange[i]="1-6"; defchan[i]="6" ;; aac|libopus|vorbis|flac|alac|pcm) chanrange[i]="1-8"; defchan[i]="8" ;; mp3|opus|wmav1|wmav2) chanrange[i]="1-2"; defchan[i]="2" ;; truehd) chanrange[i]="2/5/6"; defchan[i]="6" ;; @@ -2358,7 +2422,7 @@ read achan[i] test -z "${achan[i]}" && ach[i]="${defchan[i]}" || ach[i]="${achan[i]}" case "${acodec[i]}" in - ac3|eac3|"") + ac3|eac3) case "${ach[i]}" in [1-6]) true ;; *) @@ -2437,7 +2501,7 @@ brown " Audio Channel Layouts" brown " ~~~~~~~~~~~~~~~~~~~~~" case "${acodec[i]}" in - ac3|eac3|"") + ac3|eac3) echo " 0 -> Mono 4 -> Quad 8 --> 5.0" echo " 1 -> Stereo 5 -> Quad(side) 9 --> 5.0(side)" echo " 2 -> 3.0 6 -> 4.0 10 -> 5.1" @@ -2710,7 +2774,7 @@ esac case "${acodec[i]}" in - ac3|eac3|"") + ac3|eac3) printf "Track $i: Specify the Dialog Level Normalization in dB [-31 to -1 - default is -31]: " read adn[i] test -z "${adn[i]}" && auddialnorm[i]="-dialnorm:a:${audindex[i]} -31" || auddialnorm[i]="-dialnorm:a:${audindex[i]} ${adn[i]}" @@ -2767,7 +2831,7 @@ ;; esac ;; - ac3|eac3|"") + ac3|eac3) echo " 0 -> 32000 Hz" echo " 1 -> 44100 Hz" echo " 2 -> 48000 Hz" @@ -3162,7 +3226,7 @@ test ! -z "$COMMENT" && METACOMMENT="-metadata comment=\"$COMMENT\"" encoder_func() { - VIDOPTS="${EXTSUBS[*]} $vidmap -disposition:v:0 default $aspect $ofps $METADATA $CHAPS $METATITLE $METAGENRE $METAYEAR $METACOMMENT $vfilters" + VIDOPTS="${EXTSUBS[*]} $vidmap -disposition:v:0 default $aspect $ofps $METADATA $CHAPS $METATITLE $METAGENRE $METAYEAR $METACOMMENT $vfilters $coloroptions" case "$1" in 1p|cq) test "$encmode" = "1p" && passone="-b:v $vbitrate" || passone="-q:v $CQ" @@ -3218,9 +3282,12 @@ case "$CONFMT" in mp4|m4v|mov) if [ ! -z "$MP4COVER" ]; then + case "$CONFMT" in + mov) color="$colr" ;; + esac echo "echo" >> "$OUTFILE" echo "green \"-> Adding cover image...\"" >> "$OUTFILE" - echo "$MP4BOX -add \"$OUTPUT\" -itags cover=\"$(readlink -e "$cover")\":name=\"$(basename "${OUTPUT%.*}")\":genre=\"$genre\":created=\"$year\":comment=\"$COMMENT\" -mpeg4 -new \"${OUTPUT%.*}_COVER_$$.$CONFMT\" >/dev/null 2>&1" >> "$OUTFILE" + echo "$MP4BOX -add \"$OUTPUT\"$color -itags cover=\"$(readlink -e "$cover")\":name=\"$(basename "${OUTPUT%.*}")\":genre=\"$genre\":created=\"$year\":comment=\"$COMMENT\" -mpeg4 -new \"${OUTPUT%.*}_COVER_$$.$CONFMT\" >/dev/null 2>&1" >> "$OUTFILE" echo "RET=\$?" >> "$OUTFILE" echo "test \"\$RET\" = \"0\" && green \"-> Done\" || red \"-> Failed!\"" >> "$OUTFILE" echo "if [ \"\$RET\" = \"0\" ]; then" >> "$OUTFILE" @@ -3238,6 +3305,7 @@ echo "green \"-> Remuxing to $i...\"" >> "$OUTFILE" case "$i" in wmv) vflags="-fflags +genpts"; MKVCOVER2="" ;; + mov) vflags=""; color="$colr"; MKVCOVER2="" ;; mkv) vflags="" if [ ! -z "$MP4COVER" ]; then @@ -3258,7 +3326,7 @@ ;; esac fi - echo "$FFMPEG $vflags -i \"$OUTPUT\" -map 0 -c:v copy -c:a copy $suboption $strict $MKVCOVER2 $METADATA $CHAPS $METATITLE $METAGENRE $METAYEAR $METACOMMENT ${audmeta[*]} ${audlang[*]} ${sublang[*]} ${sublng[*]} \"${OUTPUT%.*}.$i\" >/dev/null 2>&1" >> "$OUTFILE" + echo "$FFMPEG $vflags -i \"$OUTPUT\" -map 0 -c:v copy -c:a copy $suboption $strict $coloroptions $MKVCOVER2 $METADATA $CHAPS $METATITLE $METAGENRE $METAYEAR $METACOMMENT ${audmeta[*]} ${audlang[*]} ${sublang[*]} ${sublng[*]} \"${OUTPUT%.*}.$i\" >/dev/null 2>&1" >> "$OUTFILE" echo "test \"\$?\" = \"0\" && green \"-> Done\" || red \"-> Failed!\"" >> "$OUTFILE" case "$i" in mp4|m4v|mov) @@ -3266,7 +3334,7 @@ echo "" >> "$OUTFILE" echo "echo" >> "$OUTFILE" echo "green \"-> Adding cover image...\"" >> "$OUTFILE" - echo "$MP4BOX -add \"${OUTPUT%.*}.$i\" -itags cover=\"$(readlink -e "$cover")\":name=\"$(basename "${OUTPUT%.*}")\":genre=\"$genre\":created=\"$year\":comment=\"$COMMENT\" -mpeg4 -new \"${OUTPUT%.*}_COVER_$$.$i\" >/dev/null 2>&1" >> "$OUTFILE" + echo "$MP4BOX -add \"${OUTPUT%.*}.$i\"$color -itags cover=\"$(readlink -e "$cover")\":name=\"$(basename "${OUTPUT%.*}")\":genre=\"$genre\":created=\"$year\":comment=\"$COMMENT\" -mpeg4 -new \"${OUTPUT%.*}_COVER_$$.$i\" >/dev/null 2>&1" >> "$OUTFILE" echo "RET=\$?" >> "$OUTFILE" echo "test \"\$RET\" = \"0\" && green \"-> Done\" || red \"-> Failed!\"" >> "$OUTFILE" echo "if [ \"\$RET\" = \"0\" ]; then" >> "$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
.