Projects
Multimedia
h264enc
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 373
View file
h264enc.spec
Changed
@@ -1,7 +1,7 @@ # norootforbuild Name: h264enc -Version: 10.2.7 +Version: 10.2.8 Release: 1 License: GPL-2.0+ @@ -58,7 +58,23 @@ %changelog -* Thu Sep 25 2014 Grozdan Nikolov \neutrino8@gmail.com> 10.2.7 +* Fri Sep 26 2014 Grozdan Nikolov <neutrino8@gmail.com> 10.2.8 + * Get rid of the get_resolution_func() and audio_stream_copy_func() functions + * Detecting Blu-ray resolution can be sometimes problematic when using -vo null + -ao null. Switch to using -nosound instead of -ao null + * Check the value set, if any, in the DEFAULT_VID_CRFQP variable in the config + file and restrict the maximum to 51 + * Add the $cache var for Blu-rays to the audio_resample_func() function and + to the audio detection code for stream copy + * For audio copy, move the audio detection into its own audio_copy_func() + function. It makes it possible to correctly copy TrueHD audio regardless + of the preset used, except for restricted presets that do not support + audio copy. DTS HD MA is not supported yet as there's no way detecting it + due to no decode support in libavcodec + * Remove the -nocache option from the MPOPTS var + * Cosmetics + +* Thu Sep 25 2014 Grozdan Nikolov <neutrino8@gmail.com> 10.2.7 * Fix incorrect Aspect Ratio (AR) and Pixel Aspect Ratio (PAR) calculations for cropped resolutions * Do not run the get_resolution_func() function if we do cropping as it's
View file
h264enc-10.2.7.tar.gz/doc/ChangeLog -> h264enc-10.2.8.tar.gz/doc/ChangeLog
Changed
@@ -1,3 +1,19 @@ +2014-09-26 - h264enc 10.2.8 + * Get rid of the get_resolution_func() and audio_stream_copy_func() functions + * Detecting Blu-ray resolution can be sometimes problematic when using -vo null + -ao null. Switch to using -nosound instead of -ao null + * Check the value set, if any, in the DEFAULT_VID_CRFQP variable in the config + file and restrict the maximum to 51 + * Add the $cache var for Blu-rays to the audio_resample_func() function and + to the audio detection code for stream copy + * For audio copy, move the audio detection into its own audio_copy_func() + function. It makes it possible to correctly copy TrueHD audio regardless + of the preset used, except for restricted presets that do not support + audio copy. DTS HD MA is not supported yet as there's no way detecting it + due to no decode support in libavcodec + * Remove the -nocache option from the MPOPTS var + * Cosmetics + 2014-09-25 - h264enc 10.2.7 * Fix incorrect Aspect Ratio (AR) and Pixel Aspect Ratio (PAR) calculations for cropped resolutions
View file
h264enc-10.2.7.tar.gz/h264enc -> h264enc-10.2.8.tar.gz/h264enc
Changed
@@ -1,5 +1,5 @@ #!/usr/bin/env bash -# $Id: h264enc, v 10.2.7, 2014/09/25, gn Exp $ +# $Id: h264enc, v 10.2.8, 2014/09/26, gn Exp $ # # Encode BDs/DVDs/VCDs/video files to the H.264/AVC/MPEG-4 Part 10 # video format using MEncoder from MPlayer @@ -23,7 +23,7 @@ shopt -u expand_aliases export PATH=$PATH:/usr/local/bin -version=10.2.7 +version=10.2.8 configversion=32 green() { echo -e "\e[1;32m$1\e[0;39;49m"; } @@ -356,7 +356,7 @@ # then end of the MPlayer CMD. Note # that it is not used everywhere as # sometimes we need different options -MPOPTS="-vo null -ao null -frames 1 -identify -nocache" +MPOPTS="-vo null -ao null -frames 1 -identify" # Remove temp dir on # user error/exit @@ -4346,13 +4346,6 @@ # was used, then default resolution value # will be the original one from the source -get_resolution_func() { - if [ "$source" = "bd" ]; then - demuxer="-demuxer lavf" - fi - $MPLAYER "$sourcetype" $MPLAYEROPTS $device $vid $demuxer $cache -vo null -ao null -identify -frames 1 2>/dev/null > "$TEMPDIR/resolution" -} - ratio_and_pixels_func() { case "$1" in detect) @@ -4399,7 +4392,10 @@ else restype="Original" green "-> Detecting original resolution..." - get_resolution_func + if [ "$source" = "bd" ]; then + demuxer="-demuxer lavf" + fi + $MPLAYER "$sourcetype" $MPLAYEROPTS $device $vid $demuxer $cache -vo null -nosound -identify -frames 1 2>/dev/null > "$TEMPDIR/resolution" GETRES="$(grep '^VIDEO:' "$TEMPDIR/resolution" | tail -n 1 | awk '{print $3}' | sed 's|,$||')" fi @@ -4673,14 +4669,14 @@ -qp|-crf) if [ ! -z "$DEFAULT_VID_CRFQP" ]; then case "$DEFAULT_VID_CRFQP" in - [0-9]|[0-9].[0-9]|1[0-9]|1[0-9].[0-9]|2[0-9]|2[0-9].[0-9]|3[0-9]|3[0-9].[0-9]|4[0-9]|4[0-9].[0-9]|5[0-1]|5[0-1].[0-9]) + [0-9]|[0-9].[0-9]|1[0-9]|1[0-9].[0-9]|2[0-9]|2[0-9].[0-9]|3[0-9]|3[0-9].[0-9]|4[0-9]|4[0-9].[0-9]|50.[0-9]|51|51.0) green "-> Using default CRF/QP value from the config file: $DEFAULT_VID_CRFQP" bitrate="$(echo $1 | sed 's|-||')=$DEFAULT_VID_CRFQP" ;; *) error "-> Invalid CRF/QP value in the config file: $DEFAULT_VID_CRFQP" - error "-> Using default value of 19" - bitrate="$(echo $1 | sed 's|-||')=19" + error "-> Using default value of 18" + bitrate="$(echo $1 | sed 's|-||')=18" echo ;; esac @@ -5865,7 +5861,7 @@ file|vcd|dvd|bd) echo green "-> Track $i: Detecting audio sample rate..." - AUDSAMPLE[$i]=$($MPLAYER "$sourcetype" $MPLAYEROPTS $device ${aid[$i]} $demuxer $MPOPTS 2>/dev/null \ + AUDSAMPLE[$i]=$($MPLAYER "$sourcetype" $MPLAYEROPTS $device ${aid[$i]} $demuxer $cache $MPOPTS 2>/dev/null \ | grep '^ID_AUDIO_RATE' | tail -n 1 | awk -F= '{print $2}') if [ ! -z "${AUDSAMPLE[$i]}" ]; then green "-> Track $i: Detected: ${AUDSAMPLE[$i]} Hz ($(echo "scale=1; ${AUDSAMPLE[$i]} / 1000" | $BC -l) kHz)" @@ -5970,9 +5966,9 @@ *) if [ "${AUDSAMPLE[$i]}" = "${hertz[$i]}" ]; then echo - green "-> Track $i: Detected sample rate equals selected one!" - green "-> Track $i: ${AUDSAMPLE[$i]} Hz <=> ${hertz[$i]} Hz" - green "-> Track $i: Skipping resampling" + error "-> Track $i: Detected sample rate equals selected one!" + error "-> Track $i: ${AUDSAMPLE[$i]} Hz = ${hertz[$i]} Hz" + error "-> Track $i: Skipping resampling" resample[$i]= else audio_resample_filters_func @@ -6217,22 +6213,6 @@ esac } -audio_stream_copy_func() { - case "$source" in - dir) - case "${audiocodec[1]}" in - copy) - echo - error "-> Audio stream copy is not recommended with" - error " directory batch encoding if you are going" - error " to remux the encodes to MKV/MP4/TS/OGM" - echo - ;; - esac - ;; - esac -} - audio_track_echo_func() { for e in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do if [ "$e" != "1" ]; then @@ -6256,7 +6236,6 @@ echo error "-> 'aften' is missing from your system!" error "-> Falling back to the lavc encoder" - echo audiocodec[$i]="lavcac3" lavc_ac3_audio_func else @@ -6307,7 +6286,19 @@ read audiocodec[$i] audiocodec[$i]="$(echo ${audiocodec[$i]} | tr '[:upper:]' '[:lower:]')" check_audio_codec_func - audio_stream_copy_func + case "$source" in + dir) + case "${audiocodec[1]}" in + copy) + echo + error "-> Audio stream copy is not recommended with" + error " directory batch encoding if you are going" + error " to remux the encodes to MKV/MP4/TS/OGM!" + echo + ;; + esac + ;; + esac fi done audio_track_echo_func @@ -6324,7 +6315,7 @@ ;; *) echo - error "-> Unsupported audio codec: '$DEF_AUD_CODEC'" + error "-> Unsupported default audio codec: '$DEF_AUD_CODEC'" error "-> Please check your config file in '$H264ENCDIR'" echo exit_func 1 @@ -6362,6 +6353,21 @@ fi } +audio_copy_func() { + # In case we try to copy AAC audio we need + # to pass MEncoder the proper audio format + CPAUD[$i]="$($MPLAYER "$sourcetype" $MPLAYEROPTS $device $demuxer $cache ${aid[$i]} -vo null -ao null -frames 1 -identify 2>/dev/null | grep '^ID_AUDIO_CODEC' | tail -n 1 | awk -F= '{print $2}')" + if [ "${CPAUD[$i]}" = "ffaac" ]; then + audiofmt[$i]="-fafmttag 0x706d" + fi + # For TrueHD audio + if [ "${CPAUD[$i]}" = "fftruehd" ]; then + acodec[$i]="-nosound" + else + acodec[$i]="-oac copy -mc 0 -noskip -msglevel demuxer=-1 ${audiofmt[$i]}" + fi +} + # Call the audio functions above. # Order is important here and the # correct way to call the functions @@ -6477,7 +6483,7 @@ audio_track_echo_func ;; copy) - acodec[$i]="-oac copy -mc 0 -noskip -msglevel demuxer=-1" + audio_copy_func ;; nosound) acodec[$i]="-nosound" @@ -6503,7 +6509,7 @@ audio_track_echo_func ;; copy) - acodec[$i]="-oac copy -mc 0 -noskip -msglevel demuxer=-1" + audio_copy_func ;; nosound) acodec[$i]="-nosound" @@ -6543,7 +6549,7 @@ audio_track_echo_func ;; copy) - acodec[$i]="-oac copy -mc 0 -noskip -msglevel demuxer=-1" + audio_copy_func ;; nosound) acodec[$i]="-nosound" @@ -6686,18 +6692,7 @@ audio_track_echo_func ;; copy) - # In case we try to copy AAC audio we need - # to pass MEncoder the proper audio format - CPAUD[$i]="$($MPLAYER "$sourcetype" $MPLAYEROPTS $device $demuxer $cache ${aid[$i]} -vo null -ao null -frames 1 -identify 2>/dev/null | grep '^ID_AUDIO_CODEC' | tail -n 1 | awk -F= '{print $2}')" - if [ "${CPAUD[$i]}" = "ffaac" ]; then - audiofmt[$i]="-fafmttag 0x706d" - fi - # For TrueHD audio - if [ "${CPAUD[$i]}" = "fftruehd" ]; then - acodec[$i]="-nosound" - else - acodec[$i]="-oac copy -mc 0 -noskip -msglevel demuxer=-1 ${audiofmt[$i]}" - fi + audio_copy_func ;; nosound) acodec[$i]="-nosound" @@ -7423,7 +7418,7 @@ copy) echo green "-> Track $i: Detecting audio codec..." - AUDCODEC[$i]=$($MPLAYER "$sourcetype" $MPLAYEROPTS $device ${aid[$i]} $demuxer -vo null -frames 1 -identify -nocache 2>/dev/null | grep '^ID_AUDIO_CODEC' | tail -n 1 | awk -F= '{print $2}') + AUDCODEC[$i]=$($MPLAYER "$sourcetype" $MPLAYEROPTS $device ${aid[$i]} $demuxer $cache -vo null -frames 1 -identify 2>/dev/null | grep '^ID_AUDIO_CODEC' | tail -n 1 | awk -F= '{print $2}') case "${AUDCODEC[$i]}" in *a52*|*ac3*) audiocodec[$i]="ffac3"; detectaud[$i]="AC-3" ;; *eac3*) audiocodec[$i]="ffeac3"; detectaud[$i]="E-AC-3" ;; @@ -8251,7 +8246,7 @@ for i in $(seq 2 $MAX_AMOUNT_AUD_TRACKS); do if [ "${TRACKID[$i]}" = "yes" ]; then case "${audiocodec[$i]}" in - ffmp3|ffvorbis|ffac3|ffaac) + ff*) # Stream copy if [ "${audiocodec[$i]}" = "ffmp3" ]; then audinfo[$i]="${detectaud[$i]}" @@ -8604,7 +8599,7 @@ if [ "${TRACKID[$i]}" = "yes" ]; then case "${audiocodec[$i]}" in # audio stream copy - ffac3|ffmp3|ffvorbis|ffpcm) + ff*) OGMAUD[$i]="-c LANGUAGE=${AUDLANG[$i]} \"$TEMPDIR/audio$i.${audext[$i]}\"" ;; mp3)
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
.