Projects
Multimedia
ffhevc
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 35
View file
ffhevc.changes
Changed
@@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Thu Jan 12 00:26:00 UTC 2017 - neutrino8@opensuse.org + +- Update to version 3.1.2 + * Added support for pixel format conversion + * Added support for colorspace conversion + +------------------------------------------------------------------- Mon Jan 09 12:45:00 UTC 2017 - neutrino8@opensuse.org - Update to version 3.1.1
View file
ffhevc.spec
Changed
@@ -17,7 +17,7 @@ Name: ffhevc -Version: 3.1.1 +Version: 3.1.2 Release: 0 Summary: A small shell script for encoding to H.265/HEVC with ffmpeg License: GPL-2.0+
View file
ffhevc-3.1.1.tar.gz/ChangeLog -> ffhevc-3.1.2.tar.gz/ChangeLog
Changed
@@ -1,3 +1,7 @@ +2017-01-12 - ffhevc 3.1.2 + * Added support for pixel format conversion + * Added support for colorspace conversion + 2017-01-09 - ffhevc 3.1.1 * Fix a possible issue when detecting the FPS value that occurs with some files
View file
ffhevc-3.1.1.tar.gz/ffhevc -> ffhevc-3.1.2.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.1.1 -# Date: 2017-01-09 +# Version: 3.1.2 +# Date: 2017-01-12 # # 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,10 +24,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.1" +version="3.1.2" CFG="$HOME/.ffhevc" -cfgversion="33" +cfgversion="34" genconfig_func() { cat<<EOF>>"$CFG" @@ -86,6 +86,8 @@ VID_ROTATE="y" VID_DEINTERLACE="y" VID_DETELECINE="y" +VID_PIXEL_FORMAT="y" +VID_COLORSPACE="y" # Audio filters AUD_NORMALIZE="y" @@ -840,6 +842,153 @@ fi } +video_pixfmt_func() { + printf "Do a Pixel Format Conversion? [y/N]: " + read pix + if [ "$pix" = "y" -o "$pix" = "Y" ]; then + echo + brown " Pixel Formats" + brown " ~~~~~~~~~~~~~" + echo " 0 -> yuv420p" + echo " 1 -> yuv420p10 (requires 10-bits encoder)" + echo " 2 -> yuv420p12 (requires 12-bits encoder)" + echo " 3 -> yuv422p" + echo " 4 -> yuv422p10 (requires 10-bits encoder)" + echo " 5 -> yuv422p12 (requires 12-bits encoder)" + echo " 6 -> yuv444p" + echo " 7 -> yuv444p10 (requires 10-bits encoder)" + echo " 8 -> yuv444p12 (requires 12-bits encoder)" + echo + printf "Specify the Pixel Format option [default is 0]: " + read pixopt + case "$pixopt" in + 0|"") pixfmt="yuv420p" ;; + 1) pixfmt="yuv420p10" ;; + 2) pixfmt="yuv420p12" ;; + 3) pixfmt="yuv422p" ;; + 4) pixfmt="yuv422p10" ;; + 5) pixfmt="yuv422p12" ;; + 6) pixfmt="yuv444p" ;; + 7) pixfmt="yuv444p10" ;; + 8) pixfmt="yuv444p12" ;; + *) + error "-> Invalid option!" + exit 1 + ;; + esac + pixformat="format=pix_fmts=$pixfmt," + fi +} + +video_colorspace_func() { + printf "Do a Colorspace/Transfer/Primaries Conversion? [y/N]: " + read ctp + if [ "$ctp" = "y" -o "$ctp" = "Y" ]; then + video_csmisc_func() { + printf "Use 10- or 12-bits BT2020 Transfer? [default is 10]: " + read bdepth + case "$bdepth" in + 10|"") bd="-10" ;; + 12) bd="-12" ;; + *) + error "-> Invalid value!" + exit 1 + ;; + esac + printf "Use Constant or Non-Constant Matrix? [c/n - default is n]: " + read mtype + case "$mtype" in + n|N|"") cm="nc" ;; + c|C) cm="c" ;; + *) + error "-> Invalid value!" + exit 1 + ;; + esac + } + echo + brown " Colorspace Conversion" + brown " ~~~~~~~~~~~~~~~~~~~~~" + echo " 1 --> SMPTE170M (NTSC) -> BT470BG (PAL)" + echo " 2 --> SMPTE170M (NTSC) -> BT709 (HD/FHD)" + echo " 3 --> SMPTE170M (NTSC) -> BT2020 (4K/UHD)" + echo " 4 --> BT470BG (PAL) -> SMPTE170M (NTSC)" + echo " 5 --> BT470BG (PAL) -> BT709 (HD/FHD)" + echo " 6 --> BT470BG (PAL) -> BT2020 (4K/UHD)" + echo " 7 --> BT709 (HD/FHD) -> SMPTE170M (NTSC)" + echo " 8 --> BT709 (HD/FHD) -> BT470BG (PAL)" + echo " 9 --> BT709 (HD/FHD) -> BT2020 (4K/UHD)" + echo " 10 -> BT2020 (4K/UHD) -> SMPTE170M (NTSC)" + echo " 11 -> BT2020 (4K/UHD) -> BT470BG (PAL)" + echo " 12 -> BT2020 (4K/UHD) -> BT709 (HD/FHD)" + echo + printf "Specify the Colorspace Conversion option [press 'Enter' to skip]: " + read csopt + case "$csopt" in + 1) + cspace="iall=smpte170m:ispace=smpte170m:itrc=smpte170m:iprimaries=smpte170m:irange=mpeg:all=bt470bg:space=bt470bg:trc=bt470bg:primaries=bt470bg:range=mpeg:dither=fsb" + colorprim=":colormatrix=bt470bg:colorprim=bt470bg:transfer=bt470bg" + ;; + 2) + cspace="iall=smpte170m:ispace=smpte170m:itrc=smpte170m:iprimaries=smpte170m:irange=mpeg:all=bt709:space=bt709:trc=bt709:primaries=bt709:range=mpeg:dither=fsb" + colorprim=":colormatrix=bt709:colorprim=bt709:transfer=bt709" + ;; + 3) + video_csmisc_func + cspace="iall=smpte170m:ispace=smpte170m:itrc=smpte170m:iprimaries=smpte170m:irange=mpeg:all=bt2020:space=bt2020ncl:trc=bt2020$bd:primaries=bt2020:range=mpeg:dither=fsb" + colorprim=":colormatrix=bt2020$cm:colorprim=bt2020:transfer=bt2020$bd" + ;; + 4) + cspace="iall=bt470bg:ispace=bt470bg:itrc=bt470bg:iprimaries=bt470bg:irange=mpeg:all=smpte170m:space=smpte170m:trc=smpte170m:primaries=smpte170m:range=mpeg:dither=fsb" + colorprim=":colormatrix=bt470bg:colorprim=bt470bg:transfer=bt470bg" + ;; + 5) + cspace="iall=bt470bg:ispace=bt470bg:itrc=bt470bg:iprimaries=bt470bg:irange=mpeg:all=bt709:space=bt709:trc=bt709:primaries=bt709:range=mpeg:dither=fsb" + colorprim=":colormatrix=bt709:colorprim=bt709:transfer=bt709" + ;; + 6) + video_csmisc_func + cspace="iall=bt470bg:ispace=bt470bg:itrc=bt470bg:iprimaries=bt470bg:irange=mpeg:all=bt2020:space=bt2020ncl:trc=bt2020$bd:primaries=bt2020:range=mpeg:dither=fsb" + colorprim=":colormatrix=bt2020$cm:colorprim=bt2020:transfer=bt2020$bd" + ;; + 7) + cspace="iall=bt709:ispace=bt709:itrc=bt709:iprimaries=bt709:irange=mpeg:all=smpte170m:space=smpte170m:trc=smpte170m:primaries=smpte170m:range=mpeg:dither=fsb" + colorprim=":colormatrix=smpte170m:colorprim=smpte170m:transfer=smpte170m" + ;; + 8) + cspace="iall=bt709:ispace=bt709:itrc=bt709:iprimaries=bt709:irange=mpeg:all=bt470bg:space=bt470bg:trc=bt470bg:primaries=bt470bg:range=mpeg:dither=fsb" + colorprim=":colormatrix=bt470bg:colorprim=bt470bg:transfer=bt470bg" + ;; + 9) + video_csmisc_func + cspace="iall=bt709:ispace=bt709:itrc=bt709:iprimaries=bt709:irange=mpeg:all=bt2020:space=bt2020ncl:trc=bt2020$bd:primaries=bt2020:range=mpeg:dither=fsb" + colorprim=":colormatrix=bt2020$cm:colorprim=bt2020:transfer=bt2020$bd" + ;; + 10) + video_csmisc_func + cspace="iall=bt2020:ispace=bt2020:itrc=bt2020$bd:iprimaries=bt2020:irange=mpeg:all=smpte170m:space=smpte170m:trc=smpte170m:primaries=smpte170m:range=mpeg:dither=fsb" + colorprim=":colormatrix=smpte170m:colorprim=smpte170m:transfer=smpte170m" + ;; + 11) + video_csmisc_func + cspace="iall=bt2020:ispace=bt2020:itrc=bt2020$bd:iprimaries=bt2020:irange=mpeg:all=bt470bg:space=bt470bg:trc=bt470bg:primaries=bt470bg:range=mpeg:dither=fsb" + colorprim=":colormatrix=bt470bg:colorprim=bt470bg:transfer=bt470bg" + ;; + 12) + video_csmisc_func + cspace="iall=bt2020:ispace=bt2020:itrc=bt2020$bd:iprimaries=bt2020:irange=mpeg:all=bt709:space=bt709:trc=bt709:primaries=bt709:range=mpeg:dither=fsb" + colorprim=":colormatrix=bt709:colorprim=bt709:transfer=bt709" + ;; + "") true ;; + *) + error "-> Invalid option!" + exit 1 + ;; + esac + test ! -z "$cspace" && colorspace="colorspace=$cspace," + fi +} + printf "Use Post-Processing Video Filters? [y/N]: " read postproc if [ "$postproc" = "y" -o "$postproc" = "Y" ]; then @@ -847,6 +996,8 @@ test "$VID_DEBLOCK" = "y" && video_deblock_func test "$VID_DEINTERLACE" = "y" && video_deinterlace_func test "$VID_DETELECINE" = "y" && video_detelecine_func + test "$VID_PIXEL_FORMAT" = "y" && video_pixfmt_func + test "$VID_COLORSPACE" = "y" && video_colorspace_func test "$VID_ROTATE" = "y" && video_rotate_func fi @@ -956,47 +1107,49 @@ fi fi -printf "Define the Color Primaries? [y/N]: " -read cprim -if [ "$cprim" = "y" -o "$cprim" = "Y" ]; then - echo - brown " Color Primaries" - brown " ~~~~~~~~~~~~~~~" - echo " 0 -> smpte170m (NTSC DVD)" - echo " 1 -> bt470bg (PAL DVD)" - echo " 2 -> bt709 (HD/Full HD)" - echo " 3 -> bt2020nc & bt2020-10 (4K/UHD)" - echo " 4 -> bt2020nc & bt2020-12 (4K/UHD)" - echo " 5 -> bt2020c & bt2020-10 (4K/UHD)" - echo " 6 -> bt2020c & bt2020-12 (4K/UHD)" - echo " 7 -> Undefined" - echo - printf "Specify the Color Primaries [default is 7]: " - read colprim - case "$colprim" in - 0) matrix="smpte170m"; prim="smpte170m"; transfer="smpte170m" ;; - 1) matrix="bt470bg"; prim="bt470bg"; transfer="bt470bg" ;; - 2) matrix="bt709"; prim="bt709"; transfer="bt709" ;; - 3) matrix="bt2020nc"; prim="bt2020"; transfer="bt2020-10" ;; - 4) matrix="bt2020nc"; prim="bt2020"; transfer="bt2020-12" ;; - 5) matrix="bt2020c"; prim="bt2020"; transfer="bt2020-10" ;; - 6) matrix="bt2020c"; prim="bt2020"; transfer="bt2020-12" ;; - 7|"") matrix="undef"; prim="undef"; transfer="undef" ;; - *) - error "-> Invalid option!" - exit 1 - ;; - esac - case "$colprim" in - [3-6]) - printf "Use SMPTE-ST-2084 Transfer Characteristics? [y/N]: " - read smpte - if [ "$smpte" = "y" -o "$smpte" = "Y" ]; then - transfer="smpte-st-2084" - fi - ;; - esac - colorprim=":colormatrix=$matrix:colorprim=$prim:transfer=$transfer" +if [ -z "$cspace" ]; then + printf "Define the Color Primaries? [y/N]: " + read cprim + if [ "$cprim" = "y" -o "$cprim" = "Y" ]; then + echo + brown " Color Primaries" + brown " ~~~~~~~~~~~~~~~" + echo " 0 -> smpte170m (NTSC DVD)" + echo " 1 -> bt470bg (PAL DVD)" + echo " 2 -> bt709 (HD/Full HD)" + echo " 3 -> bt2020nc & bt2020-10 (4K/UHD)" + echo " 4 -> bt2020nc & bt2020-12 (4K/UHD)" + echo " 5 -> bt2020c & bt2020-10 (4K/UHD)" + echo " 6 -> bt2020c & bt2020-12 (4K/UHD)" + echo " 7 -> Undefined" + echo + printf "Specify the Color Primaries [default is 7]: " + read colprim + case "$colprim" in + 0) matrix="smpte170m"; prim="smpte170m"; transfer="smpte170m" ;; + 1) matrix="bt470bg"; prim="bt470bg"; transfer="bt470bg" ;; + 2) matrix="bt709"; prim="bt709"; transfer="bt709" ;; + 3) matrix="bt2020nc"; prim="bt2020"; transfer="bt2020-10" ;; + 4) matrix="bt2020nc"; prim="bt2020"; transfer="bt2020-12" ;; + 5) matrix="bt2020c"; prim="bt2020"; transfer="bt2020-10" ;; + 6) matrix="bt2020c"; prim="bt2020"; transfer="bt2020-12" ;; + 7|"") matrix="undef"; prim="undef"; transfer="undef" ;; + *) + error "-> Invalid option!" + exit 1 + ;; + esac + case "$colprim" in + [3-6]) + printf "Use SMPTE-ST-2084 Transfer Characteristics? [y/N]: " + read smpte + if [ "$smpte" = "y" -o "$smpte" = "Y" ]; then + transfer="smpte-st-2084" + fi + ;; + esac + colorprim=":colormatrix=$matrix:colorprim=$prim:transfer=$transfer" + fi fi if [ "$VID_FPS_CONVERT" = "y" ]; then @@ -1997,7 +2150,7 @@ test "$CHAPS" = "n" && CHPS="-map_chapters -1" -vidfilters="$(echo "$deinterlace$detelecine$crop$deblock$denoise$scale$rotate$setpts$fps" | sed 's|,$||')" +vidfilters="$(echo "$deinterlace$detelecine$pixformat$colorspace$crop$deblock$denoise$scale$rotate$setpts$fps" | sed 's|,$||')" test ! -z "$vidfilters" && vfilters="-vf $vidfilters"
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
.