Changes of Revision 90

ffhevc.changes Changed
x
 
1
@@ -1,4 +1,11 @@
2
 -------------------------------------------------------------------
3
+Thu Feb 22 10:40:00 UTC 2018 - neutrino8@opensuse.org
4
+
5
+- Update to version 3.5.9
6
+  * Support per-file HDR side data when running in batch mode
7
+  * Minor code optimizations
8
+
9
+-------------------------------------------------------------------
10
 Sat Feb 17 11:52:00 UTC 2018 - neutrino8@opensuse.org
11
 
12
 - Update to version 3.5.8
13
ffhevc.spec Changed
10
 
1
@@ -17,7 +17,7 @@
2
 
3
 
4
 Name:           ffhevc
5
-Version:        3.5.8
6
+Version:        3.5.9
7
 Release:        0
8
 Summary:        A small shell script for encoding to H.265/HEVC with ffmpeg
9
 License:        GPL-2.0+
10
ffhevc-3.5.8.tar.gz/ChangeLog -> ffhevc-3.5.9.tar.gz/ChangeLog Changed
9
 
1
@@ -1,3 +1,7 @@
2
+2018-02-22 - ffhevc 3.5.9
3
+   * Support per-file HDR side data when running in batch mode
4
+   * Minor code optimizations
5
+   
6
 2018-02-17 - ffhevc 3.5.8
7
    * Fixed an issue where in some cases write-testing the output
8
      directory will fail due usage of readlink -f instead of
9
ffhevc-3.5.8.tar.gz/ffhevc -> ffhevc-3.5.9.tar.gz/ffhevc Changed
97
 
1
@@ -2,8 +2,8 @@
2
 #
3
 # Small script to encode to H.265/HEVC video using FFmpeg and libx265.
4
 # Author: Grozdan "microchip" Nikolov <neutrino8@opensuse.org>
5
-# Version: 3.5.8
6
-# Date: 2018-02-17
7
+# Version: 3.5.9
8
+# Date: 2018-02-22
9
 #
10
 # ffhevc is free software ; you can redistribute it and/or modify
11
 # it under the terms of the GNU General Public License as published by
12
@@ -24,7 +24,7 @@
13
 brown() { echo -e "\e[0;33m$1\e[0;39;49m"; }
14
 error() { echo -e "\e[1;31m$1\e[0;39;49m"; }
15
 
16
-version="3.5.8"
17
+version="3.5.9"
18
 
19
 CFG="$HOME/.ffhevc"
20
 cfgversion="38"
21
@@ -1304,9 +1304,7 @@
22
            sdarray=([0]=green_x [1]=green_y [2]=blue_x [3]=blue_y [4]=red_x [5]=red_y [6]=white_point_x [7]=white_point_y [8]=min_luminance [9]=max_luminance [10]=max_content [11]=max_average)
23
            for i in {0..11}; do
24
                hdrsd[i]="$(grep "^${sdarray[i]}" "$HDRFILE" | tail -1 | awk -F= '{print $2}' | awk -F/ '{print $1}')"
25
-               if [ -z "${hdrsd[i]}" ]; then
26
-                   hdrsd[i]="ENOT_AVAIL"
27
-               fi
28
+               test -z "${hdrsd[i]}" && hdrsd[i]="ENOT_AVAIL"
29
            done
30
            rm -f "$HDRFILE"
31
            echo
32
@@ -1346,6 +1344,31 @@
33
    if [ ! -z "$master_display" -o ! -z "$max_cll" -o ! -z "$dhdr10" ]; then
34
        hdr_encopts=":open-gop=0:repeat-headers=1"
35
    fi
36
+   
37
+   if [ ! -z "$batchmode" ]; then
38
+       printf "Auto-Detect and Add HDR Side Data to All Encodes? [y/N]: "
39
+       read addhdr
40
+       if [ "$addhdr" = "y" -o "$addhdr" = "Y" ]; then
41
+           echo
42
+           error "-> NOTE: all input files must contain valid HDR side data (master-display and max-cll)!"
43
+           echo
44
+           hdr_sd_func() {
45
+               echo "    HDRFILE=\"$(dirname "$OUTPUT")/hdr_sd_$$\""
46
+               echo "    $FFPROBE -i \"\$i\" -v quiet -select_streams v:0 -show_entries side_data -read_intervals %+1 > \"\$HDRFILE\""
47
+               echo "    sdarray=([0]=green_x [1]=green_y [2]=blue_x [3]=blue_y [4]=red_x [5]=red_y [6]=white_point_x [7]=white_point_y [8]=min_luminance [9]=max_luminance [10]=max_content [11]=max_average)"
48
+               echo "    for sd in {0..11}; do"
49
+               echo "        hdrsd[sd]=\"\$(grep \"^\${sdarray[sd]}\" \"\$HDRFILE\" | tail -1 | awk -F= '{print \$2}' | awk -F/ '{print \$1}')\""
50
+               echo "    done"
51
+               echo "    rm -f \"\$HDRFILE\""
52
+               echo "    hdr_encopts=\":open-gop=0:repeat-headers=1\""
53
+               echo "    mast_disp=\"G(\${hdrsd[0]},\${hdrsd[1]})B(\${hdrsd[2]},\${hdrsd[3]})R(\${hdrsd[4]},\${hdrsd[5]})WP(\${hdrsd[6]},\${hdrsd[7]})L(\${hdrsd[9]},\${hdrsd[8]})\""
54
+               echo "    max_cll=\":max-cll=\${hdrsd[10]},\${hdrsd[11]}\""
55
+           }
56
+           hdr_encopts="\$hdr_encopts"
57
+           master_display=":master-display=\"\$mast_disp\""
58
+           max_cll="\$max_cll"
59
+       fi
60
+   fi
61
 fi
62
 
63
 # Used by cropping and bitrate
64
@@ -1353,7 +1376,7 @@
65
 video_length_func() {
66
    case "$1" in
67
        file)   VLENGTH="$($FFPROBE -i "$input" -v quiet -select_streams v:0 -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 | tail -1 | awk -F. '{print $1}')" ;;
68
-       batch)  echo "VLENGTH=\"\$($FFPROBE -i \"\$i\" -v quiet -select_streams v:0 -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 | tail -1 | awk -F. '{print \$1}')\"" ;;
69
+       batch)  echo "    VLENGTH=\"\$($FFPROBE -i \"\$i\" -v quiet -select_streams v:0 -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 | tail -1 | awk -F. '{print \$1}')\"" ;;
70
    esac
71
 }
72
 
73
@@ -1362,8 +1385,8 @@
74
        printf "Auto-Crop the Input Files? [y/N]: "
75
        read autocrop
76
        if [ "$autocrop" = "y" -o "$autocrop" = "Y" ]; then
77
-           CROPVAL="\$($FFMPEG -ss \$((\$VLENGTH/2)) -i \"\$i\" -map 0:0 -vf cropdetect=24:4 -frames:v 1000 -f null - 2>&1 | awk '/crop/ {print \$NF}' | awk -F= '{print \$2}' | tail -1)"
78
-           crop="crop=\$CROPVAL,"
79
+           CROPVAL="    \$($FFMPEG -ss \$((\$VLENGTH/2)) -i \"\$i\" -map 0:0 -vf cropdetect=24:4 -frames:v 1000 -f null - 2>&1 | awk '/crop/ {print \$NF}' | awk -F= '{print \$2}' | tail -1)"
80
+           crop="    crop=\$CROPVAL,"
81
        fi
82
    else
83
        echo
84
@@ -3125,8 +3148,11 @@
85
    echo "" >> "$OUTFILE"
86
    echo "$FORLOOP_START" >> "$OUTFILE"
87
    echo "$CHKFILE_START" >> "$OUTFILE"
88
-   if [ "$autocrop" = "y" -o "$autocrop" = "Y" ]; then
89
+   if [ "$addhdr" = "y" -o "$addhdr" = "Y" ]; then
90
+       hdr_sd_func >> "$OUTFILE"
91
        echo "" >> "$OUTFILE"
92
+   fi
93
+   if [ "$autocrop" = "y" -o "$autocrop" = "Y" ]; then
94
        echo "echo" >> "$OUTFILE"
95
        echo "green \"-> Detecting crop values for '\$(basename \"\$i\")'...\"" >> "$OUTFILE"
96
        video_length_func batch >> "$OUTFILE"
97
ffhevc-3.5.8.tar.gz/hdr -> ffhevc-3.5.9.tar.gz/hdr Changed
21
 
1
@@ -1,6 +1,6 @@
2
 #!/bin/bash
3
-# Small and dirty script to get HDR values which
4
-# can be fed to ffhevc's HDR options menu
5
+# Small script to get HDR values which can
6
+# be fed to ffhevc's HDR options menu
7
 
8
 test -z "$1" && echo "Usage: hdr <file>" && exit 1
9
 
10
@@ -14,9 +14,7 @@
11
 
12
 for i in {0..11}; do
13
    hdr[i]="$(grep "^${sdarray[i]}" "$hdrfile" | tail -1 | awk -F= '{print $2}' | awk -F/ '{print $1}')"
14
-   if [ -z "${hdr[i]}" ]; then
15
-       hdr[i]="ENOT_AVAIL"
16
-   fi
17
+   test -z "${hdr[i]}" && hdr[i]="ENOT_AVAIL"
18
 done
19
 
20
 echo "-> master-display: G(${hdr[0]},${hdr[1]})B(${hdr[2]},${hdr[3]})R(${hdr[4]},${hdr[5]})WP(${hdr[6]},${hdr[7]})L(${hdr[9]},${hdr[8]})"
21