Projects
Multimedia
ffx264
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 7
View file
ffx264.changes
Changed
@@ -1,4 +1,20 @@ ------------------------------------------------------------------- +Fri Nov 04 10:43:00 UTC 2016 - neutrino8@opensuse.org + +- Update to version 3.0.8 + * Bugfix: the scale variable was used twice for different things + causing an overwrite of the scale filter parameters, which + eventually results in ffmpeg complaining and exiting + * Added support for NTSC <-> NTSC and NTSC <-> PAL frame rate + conversions + * New var in config file, VID_FPS_CONVERT, to enable/disable + FPS conversion. Bumps up config file version to 24 + * Moved the FPS detection code into its own function so it can + be easily reused + * Minor cosmetics + * Updated the README file + +------------------------------------------------------------------- Thu Nov 03 15:31:00 UTC 2016 - neutrino8@gmail.com - Update to version 3.0.7
View file
ffx264.spec
Changed
@@ -17,7 +17,7 @@ Name: ffx264 -Version: 3.0.7 +Version: 3.0.8 Release: 0 Summary: A small shell script for encoding to H.264 with ffmpeg License: GPL-2.0+
View file
ffx264-3.0.7.tar.gz/ChangeLog -> ffx264-3.0.8.tar.gz/ChangeLog
Changed
@@ -1,3 +1,16 @@ +2016-11-04 - ffx264 3.0.8 + * Bugfix: the scale variable was used twice for different things + causing an overwrite of the scale filter parameters, which + eventually results in ffmpeg complaining and exiting + * Added support for NTSC <-> NTSC and NTSC <-> PAL frame rate + conversions + * New var in config file, VID_FPS_CONVERT, to enable/disable + FPS conversion. Bumps up config file version to 24 + * Moved the FPS detection code into its own function so it can + be easily reused + * Minor cosmetics + * Updated the README file + 2016-11-03 - ffx264 3.0.7 * Added support for interlace-aware encoding * Added support for the spp, uspp and pp7 deblockers
View file
ffx264-3.0.7.tar.gz/README -> ffx264-3.0.8.tar.gz/README
Changed
@@ -1,6 +1,7 @@ -ffx264 is a small and basic shell script for encoding to H.264/AVC video -using ffmpeg and the libx264 library. I wrote it for my own use as there -are some cases where my h264enc script has issues encoding some Blu-ray remuxes. +ffx264 is a small shell script for encoding to H.264/AVC video using +ffmpeg and the libx264 library. I wrote it for my own use as there +are some cases where my h264enc script has issues encoding some +Blu-ray remuxes. ffx264 can do the following: @@ -21,6 +22,8 @@ - it supports a limited amount of user-provided metadata. - it optionally scales the video. - it optionally deinterlaces the input file. +- it supports interlace-aware encoding. +- it supports FPS conversion. - it supports cover art for the MKV container. - it supports the x264 presets and tune profiles. - it supports custom written preset files.
View file
ffx264-3.0.7.tar.gz/ffx264 -> ffx264-3.0.8.tar.gz/ffx264
Changed
@@ -2,18 +2,18 @@ # # Small script to encode to H.264/AVC video using FFmpeg and libx264. # Author: Grozdan "microchip" Nikolov <neutrino8@gmail.com> -# Version: 3.0.7 -# Date: 2016-11-03 +# Version: 3.0.8 +# Date: 2016-11-04 # License: GNU GPLv2+ green() { echo -e "\e[1;32m$1\e[0;39;49m"; } 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.7" +version="3.0.8" CFG="$HOME/.ffx264" -cfgversion="23" +cfgversion="24" genconfig_func() { cat<<EOF>>"$CFG" @@ -43,7 +43,7 @@ # Automatically crop the input? AUTOCROP="y" -# Enable software scaling support +# Enable software scaling support? SCALE="y" # Leave empty to ask each time or @@ -62,6 +62,10 @@ # SCALER="" +# Support NTSC <-> PAL or +# NTSC <-> NTSC FPS conversion? +VID_FPS_CONVERT="y" + # Video filters VID_DENOISE="y" VID_DEBLOCK="y" @@ -505,6 +509,12 @@ fi fi +# Used by mc deinterlace and FPS conversion +video_fps_func() { + FPSOUT="$(dirname "$OUTPUT")/.ff_fps$$" + $FFPROBE -i "$input" -select_streams v:0 -show_entries stream=r_frame_rate > "$FPSOUT" 2>&1 +} + if [ "$VID_DEINTERLACE" = "y" ]; then video_deinterlace_func() { printf "Use Motion-Compensation Deinterlacing? [y/N]: " @@ -541,8 +551,7 @@ case "$dmethod" in 0|"") video_deinterlace_func ofps ;; 1) - FPSOUT="$(dirname "$OUTPUT")/.ff_fps$$" - $FFPROBE -i "$input" -select_streams v:0 -show_entries stream=r_frame_rate > "$FPSOUT" 2>&1 + video_fps_func FPS1="$(cat "$FPSOUT" | sed -n 's|r_frame_rate=||p' | awk -F/ '{print $1}')" FPS2="$(cat "$FPSOUT" | sed -n 's|r_frame_rate=||p' | awk -F/ '{print $2}')" rm -f "$FPSOUT" @@ -651,8 +660,8 @@ echo " 9 -> Natural Bicubic Spline" echo printf "Sepcify the Software Scaler [default is 9]: " - read scale - case "$scale" in + read swscaler + case "$swscaler" in 0) scaler="fast_bilinear" ;; 1) scaler="bilinear" ;; 2) scaler="bicubic" ;; @@ -709,16 +718,136 @@ colorprim=":colormatrix=$matrix:colorprim=$prim:transfer=$transfer" fi +if [ "$VID_FPS_CONVERT" = "y" ]; then + # Not supported with interlaced encoding + # and deinterlacing with a bobber + if [ -z "$interlaced" -a -z "$fp" ]; then + printf "Do an NTSC <-> PAL or NTSC <-> NTSC FPS conversion? [y/N]: " + read fpscon + if [ "$fpscon" = "y" -o "$fpscon" = "Y" ]; then + echo + green "-> Detecting FPS value..." + sleep 1 + video_fps_func + FPS="$(cat "$FPSOUT" | sed -n 's|r_frame_rate=||p')" + rm -f "$FPSOUT" + green "-> Detected: $FPS FPS" + case "$FPS" in + 24/1|25/1|24000/1001|30000/1001) true ;; + *) + echo + error "-> Detected FPS is not supported yet!" + error "-> Supported FPS are: 24/1, 25/1, 24000/1001 and 30000/1001" + error "-> Skipping FPS conversion!" + skipfps="1" + ;; + esac + echo + if [ -z "$skipfps" ]; then + brown " NTSC <-> PAL and NTSC <-> NTSC FPS Conversion" + brown " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + echo " 0 --> 23.976 FPS (24000/1001) to 24 FPS" + echo " 1 --> 23.976 FPS (24000/1001) to 25 FPS" + echo " 2 --> 23.976 FPS (24000/1001) to 29.970 FPS" + echo + echo " 3 --> 24 FPS to 23.976 FPS (24000/1001)" + echo " 4 --> 24 FPS to 25 FPS" + echo " 5 --> 24 FPS to 29.970 FPS (30000/1001)" + echo + echo " 6 --> 25 FPS to 23.976 FPS (24000/1001)" + echo " 7 --> 25 FPS to 24 FPS" + echo " 8 --> 25 FPS to 29.970 FPS (30000/1001)" + echo + echo " 9 --> 29.970 FPS (30000/1001) to 23.976 FPS (24000/1001)" + echo " 10 -> 29.970 FPS (30000/1001) to 24 FPS" + echo " 11 -> 29.970 FPS (30000/1001) to 25 FPS" + echo + printf "Specify the FPS Conversion option [press 'Enter' to skip]: " + read fpsopt + case "$fpsopt" in + 0) + setpts="setpts=23976/24000*PTS," + atempo="atempo=1.001001001," + ofps="-r 24/1" + ;; + 1) + setpts="setpts=23976/25000*PTS," + atempo="atempo=1.04270937604270937604," + ofps="-r 25/1" + ;; + 2) + setpts="setpts=23976/29970*PTS," + atempo="atempo=1.25," + ofps="-r 30000/1001" + ;; + 3) + setpts="setpts=24000/23976*PTS," + atempo="atempo=0.999," + ofps="-r 24000/1001" + ;; + 4) + setpts="setpts=24000/25000*PTS," + atempo="atempo=1.04166666667," + ofps="-r 25/1" + ;; + 5) + setpts="setpts=24000/29970*PTS," + atempo="atempo=1.24875," + ofps="-r 30000/1001" + ;; + 6) + setpts="setpts=25000/23976*PTS," + atempo="atempo=0.95904," + ofps="-r 24000/1001" + ;; + 7) + setpts="setpts=25000/24000*PTS," + atempo="atempo=0.96," + ofps="-r 24/1" + ;; + 8) + setpts="setpts=25000/29970*PTS," + atempo="atempo=1.1988," + ofps="-r 30000/1001" + ;; + 9) + setpts="setpts=29970/23976*PTS," + atempo="atempo=0.8," + ofps="-r 24000/1001" + ;; + 10) + setpts="setpts=29970/24000*PTS," + atempo="atempo=0.800800800801," + ofps="-r 24/1" + ;; + 11) + setpts="setpts=29970/25000*PTS," + atempo="atempo=0.83416750083416750083," + ofps="-r 25/1" + ;; + "") + true + ;; + *) + error "-> Invalid option!" + exit 1 + ;; + esac + fi + fi + fi +fi + ################ Subs stuff ################# if [ "$SUBS" = "y" ]; then - echo + test -z "$skipfps" && echo green "-> Detecting subtitles..." - echo sleep 1 SUBSDETECT="$($FFPROBE -i "$input" 2>&1 | grep 'Stream #' | grep 'Subtitle' | sed 's| ||g')" if [ ! -z "$SUBSDETECT" ]; then SUBT="$(echo "$SUBSDETECT" | wc -l)" + echo green "$SUBSDETECT" echo error "-> Note: not all containers support all types of subs!" @@ -754,7 +883,7 @@ ################ Audio stuff ################ -echo +test -z "$skipfps" && echo green "-> Detecting audio tracks..." echo sleep 1 @@ -882,6 +1011,14 @@ copy) acdc[i]="copy" skiptfs="1" + # FPS conversion is incompatible with audio stream copy for + # obvious reasons. We can't speed up or slow down audio that's + # being copied. Audio filters have no effect on stream copy. + # We only clear the video filter and fps here. No need to + # also clear the audio filter since it never reaches the + # below $afilters filter chain. + setpts= + ofps= ;; nosound) audparams[1]="-an" @@ -1147,7 +1284,7 @@ fi fi - afilters[i]="$(echo "${aresample[i]}${anormalize[i]}${avolume[i]}" | sed 's|,$||')" + afilters[i]="$(echo "${aresample[i]}${anormalize[i]}${avolume[i]}$atempo" | sed 's|,$||')" if [ ! -z "${afilters[i]}" ]; then audfilters[i]="-filter:a:${audmapval[i]} ${afilters[i]}" fi @@ -1197,7 +1334,7 @@ test "$CHAPS" = "n" && CHPS="-map_chapters -1" -vidfilters="$(echo "$deinterlace$crop$deblock$denoise$scale$rotate" | sed 's|,$||')" +vidfilters="$(echo "$deinterlace$crop$deblock$denoise$scale$rotate$setpts" | sed 's|,$||')" test ! -z "$vidfilters" && vfilters="-vf $vidfilters" @@ -1241,7 +1378,7 @@ case "$1" in 1p|crf) test "$mode" = "1p" && pmode="bitrate=$vbitrate" || pmode="crf=$CRF" - OPTS1="-map 0:0 -disposition:v:0 default $fps $NOSUBS $MDATA $CHPS $METATITLE $METAGENRE $METAYEAR $METACOMMENT $vfilters $sws" + OPTS1="-map 0:0 -disposition:v:0 default $fps $ofps $NOSUBS $MDATA $CHPS $METATITLE $METAGENRE $METAYEAR $METACOMMENT $vfilters $sws" OPTS2="${audparams[*]} ${auddis[*]} ${subcopy[*]} ${subdis[*]} $strict $movflags $METACOVER \"$OUTPUT\"" ;; 2p) @@ -1249,7 +1386,7 @@ passtwo="stats=\"$OUTFILE.log\":pass=2:bitrate=$vbitrate" OPTS1="-map 0:0" OPTS2="-an -f null -y /dev/null" - OPTS3="-map 0:0 -disposition:v:0 default $fps $NOSUBS $MDATA $CHPS $METATITLE $METAGENRE $METAYEAR $METACOMMENT $vfilters $sws" + OPTS3="-map 0:0 -disposition:v:0 default $fps $ofps $NOSUBS $MDATA $CHPS $METATITLE $METAGENRE $METAYEAR $METACOMMENT $vfilters $sws" OPTS4="${audparams[*]} ${auddis[*]} ${subcopy[*]} ${subdis[*]} $strict $movflags $METACOVER \"$OUTPUT\"" ;; esac
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
.