diff -ur src.orig/idvid src/idvid
old
|
new
|
|
203 | 203 | # (ID_V(ideo), ID_A(udio), and ID_L(ength)) |
204 | 204 | # Grep out special characters ()[ |
205 | 205 | # # put the VARS in a file |
206 | | grep "^ID_[VAL]" < "$SCRATCH_FILE" | grep -v "[()\[]" | sed 's/$/"/;s/=/="/' > "$SCRATCH_FILE".vars |
| 206 | grep "^ID_[VAL]" < "$SCRATCH_FILE" | grep -v "[()\[]" | gsed 's/$/"/;s/=/="/' > "$SCRATCH_FILE".vars |
207 | 207 | # source the file to set the variables |
208 | 208 | . "$SCRATCH_FILE".vars |
209 | 209 | # (If you've got a problem with eval, give me an alternative that |
… |
… |
|
237 | 237 | # Find out which channel is the video channel ( 1st ) |
238 | 238 | # TODO Do we want to worry about videos with multiple channels of video ? |
239 | 239 | VIDEO_INFO=$(grep "Video:" "$SCRATCH_FILE") |
240 | | ID_VIDEO_TRACKS=( $(sed -r 's/.*Stream #([0-9]\.[0-9]+).*/\1/' <<< "$VIDEO_INFO") ) |
| 240 | ID_VIDEO_TRACKS=( $(gsed -r 's/.*Stream #([0-9]\.[0-9]+).*/\1/' <<< "$VIDEO_INFO") ) |
241 | 241 | ID_VIDEO_TRACK="${ID_VIDEO_TRACKS[0]}" |
242 | 242 | # Find out what audio channels are available |
243 | 243 | if test -n "$ID_AUDIO_ID"; then |
244 | 244 | AUDIO_INFO=$(grep "Audio:" "$SCRATCH_FILE") |
245 | 245 | # ID_AUDIO_ID needs "TRACKS" var to remain in columns |
246 | | TRACKS=$(sed -r 's/.*Stream #([0-9]\.[0-9]+).*/\1/' <<< "$AUDIO_INFO") |
| 246 | TRACKS=$(gsed -r 's/.*Stream #([0-9]\.[0-9]+).*/\1/' <<< "$AUDIO_INFO") |
247 | 247 | A_TRACKS=(${TRACKS//$'\n'/ }) |
248 | 248 | # Get hexadecimal track IDs, if present |
249 | 249 | if grep -q "\[0x[0-9a-fA-F]*]" <<< $AUDIO_INFO; then |
250 | | HEX_TRACKS=$(sed -r 's/Stream .*\[0x([0-9a-fA-F]*)]:.*$/\1/' <<< "$AUDIO_INFO") |
| 250 | HEX_TRACKS=$(gsed -r 's/Stream .*\[0x([0-9a-fA-F]*)]:.*$/\1/' <<< "$AUDIO_INFO") |
251 | 251 | HEX_TRACKS=(${HEX_TRACKS//$'\n'/ }) |
252 | 252 | USE_HEX_TRACKS=: |
253 | 253 | else |
… |
… |
|
257 | 257 | for ((i=0; i<${#A_TRACKS[@]}; i++)); do |
258 | 258 | CUR_CHAN=$(grep "Stream #${A_TRACKS[i]}" <<< "$AUDIO_INFO") |
259 | 259 | A_SAMPRATES=("${A_SAMPRATES[@]}" "$(echo $CUR_CHAN | \ |
260 | | sed -r 's/.* ([0-9]+) Hz.*/\1/')") |
| 260 | gsed -r 's/.* ([0-9]+) Hz.*/\1/')") |
261 | 261 | A_BITRATES=("${A_BITRATES[@]}" "$(echo $CUR_CHAN | \ |
262 | | sed -r 's/.* ([0-9]+) kb\/s.*/\1/')") |
| 262 | gsed -r 's/.* ([0-9]+) kb\/s.*/\1/')") |
263 | 263 | # make sure the above is a number, else set A_BITRATE to 0 |
264 | 264 | if ! test_is_number ${A_BITRATES[i]}; then |
265 | 265 | A_BITRATES[i]=0 |
266 | 266 | fi |
267 | 267 | A_CODECS=("${A_CODECS[@]}" "$(echo $CUR_CHAN | \ |
268 | | sed -r 's/.*Audio: ([^,]+),.*/\1/')") |
| 268 | gsed -r 's/.*Audio: ([^,]+),.*/\1/')") |
269 | 269 | if $USE_HEX_TRACKS; then |
270 | 270 | MP_TRACKNUM=$((16#${HEX_TRACKS[i]})) |
271 | 271 | else |
… |
… |
|
296 | 296 | if grep -q 5:1 <<< ${AUDIO_NCH[chn]}; then |
297 | 297 | ID_AUDIO_NCH[chn]=6 |
298 | 298 | elif grep -q channels <<< ${AUDIO_NCH[chn]}; then |
299 | | ID_AUDIO_NCH[chn]=$(sed -r 's/.* ([0-9]+) channels.*/\1/' \ |
| 299 | ID_AUDIO_NCH[chn]=$(gsed -r 's/.* ([0-9]+) channels.*/\1/' \ |
300 | 300 | <<< ${AUDIO_NCH[chn]}) |
301 | 301 | else |
302 | 302 | ID_AUDIO_NCH[chn]=2 |
… |
… |
|
336 | 336 | else |
337 | 337 | # Infer aspect ratio from width/height of mplayer playback |
338 | 338 | MPLAYER_RES=$(grep '^VO:' "$SCRATCH_FILE" | \ |
339 | | sed -e "s/..*=> *//g" -e "s/ .*$//g") |
| 339 | gsed -e "s/..*=> *//g" -e "s/ .*$//g") |
340 | 340 | #PLAY_WIDTH=$(echo $MPLAYER_RES | awk -F 'x' '{print $1}') |
341 | 341 | #PLAY_HEIGHT=$(echo $MPLAYER_RES | awk -F 'x' '{print $2}') |
342 | 342 | # patch from ML: |
… |
… |
|
351 | 351 | fi |
352 | 352 | # Normalized aspect ratio |
353 | 353 | V_ASPECT_RATIO=$(echo $V_ASPECT_WIDTH | \ |
354 | | sed -r -e 's/([0-9]*)([0-9][0-9])/\1.\2:1/g') |
| 354 | gsed -r -e 's/([0-9]*)([0-9][0-9])/\1.\2:1/g') |
355 | 355 | |
356 | 356 | NAV_LOG="${INFILE}.nav_log" |
357 | 357 | USE_NAVLOG=false |
… |
… |
|
414 | 414 | fi |
415 | 415 | |
416 | 416 | # Use mplayer-reported length as a last resort (truncate floating-point) |
417 | | test -z $V_DURATION && V_DURATION=$(echo $ID_LENGTH | sed 's/\.[0-9]*//') |
| 417 | test -z $V_DURATION && V_DURATION=$(echo $ID_LENGTH | gsed 's/\.[0-9]*//') |
418 | 418 | |
419 | 419 | # TODO: WARN if video is less than one second! |
420 | 420 | |
… |
… |
|
486 | 486 | echo "V_ASPECT_WIDTH=$V_ASPECT_WIDTH" |
487 | 487 | echo "ID_VIDEO_FRAMES=$ID_VIDEO_FRAMES" |
488 | 488 | elif $TABULAR; then |
489 | | FILE_SIZE=$(du -Dh "$INFILE" | awk '{print $1}') |
| 489 | FILE_SIZE=$(gdu -Dh "$INFILE" | awk '{print $1}') |
490 | 490 | echo "$INFILE||$FILE_SIZE||${ID_VIDEO_WIDTH}x${ID_VIDEO_HEIGHT}||$ID_VIDEO_FPS||$ID_VIDEO_BITRATE||$ID_AUDIO_BITRATE" >> "$TABLE" |
491 | 491 | else |
492 | 492 | echo $SEPARATOR |
diff -ur src.orig/make_titlesets src/make_titlesets
old
|
new
|
|
56 | 56 | # else test if the file name path passed in exists |
57 | 57 | while ! (( script_exists )); do |
58 | 58 | read script_name |
59 | | script_name=$(readlink -f "$script_name") |
| 59 | script_name=$(greadlink -f "$script_name") |
60 | 60 | if [[ -e "$script_name" ]] ; then |
61 | 61 | script_exists=1 |
62 | 62 | else |
… |
… |
|
97 | 97 | { |
98 | 98 | file="$1" |
99 | 99 | # remove shebang and PATH |
100 | | sed -i '/\#\!\/usr\/bin\/env bash/d;/PATH/d' "$file" |
| 100 | gsed -i '/\#\!\/usr\/bin\/env bash/d;/PATH/d' "$file" |
101 | 101 | # remove todisc command |
102 | | sed -i '/^todisc \\$/d' "$file" |
| 102 | gsed -i '/^todisc \\$/d' "$file" |
103 | 103 | # remove opening blank lines |
104 | | sed -i '/./,/^$/!d' "$file" |
| 104 | gsed -i '/./,/^$/!d' "$file" |
105 | 105 | } |
106 | 106 | |
107 | 107 | ############################################################################## |
… |
… |
|
131 | 131 | new_name=$(TMPDIR=`pwd` mktemp -t todisc_commands.bash.XXXXXX) |
132 | 132 | echo "The file we will use to save options: \"${final_script}\", |
133 | 133 | exists in the current directory. It will be renamed: |
134 | | to $new_name if you continue." |sed 's/^[ \t]*//;s/[ \t]*$//' |
| 134 | to $new_name if you continue." |gsed 's/^[ \t]*//;s/[ \t]*$//' |
135 | 135 | echo "press <ENTER> to continue..." |
136 | 136 | read cont |
137 | 137 | fi |
… |
… |
|
172 | 172 | fi |
173 | 173 | done |
174 | 174 | # add backslash to last line; add -vmgm and -titles; add menu titles |
175 | | sed -i "\$s/$/ \\\/" "$todisc_tmp" |
176 | | sed -i '$ a -vmgm \\' "$todisc_tmp" |
177 | | sed -i '$ a -titles \\' "$todisc_tmp" |
| 175 | gsed -i "\$s/$/ \\\/" "$todisc_tmp" |
| 176 | gsed -i '$ a -vmgm \\' "$todisc_tmp" |
| 177 | gsed -i '$ a -titles \\' "$todisc_tmp" |
178 | 178 | printf '"%s" \\\n' "${MENU_TITLES[@]}" >> "$todisc_tmp" |
179 | 179 | mv "$todisc_tmp" "$final_tmp_script" |
180 | 180 | |
… |
… |
|
197 | 197 | run_gui |
198 | 198 | clean_script "$todisc_tmp" |
199 | 199 | # add backslash to last line |
200 | | sed -i "\$s/$/ \\\/" "$todisc_tmp" |
| 200 | gsed -i "\$s/$/ \\\/" "$todisc_tmp" |
201 | 201 | # add -end-vmgm as last line |
202 | | sed -i '$ a -end-vmgm \\' "$todisc_tmp" |
| 202 | gsed -i '$ a -end-vmgm \\' "$todisc_tmp" |
203 | 203 | cat "$todisc_tmp" >> "$final_tmp_script" |
204 | 204 | rm -f "$todisc_tmp" |
205 | 205 | done=0 |
… |
… |
|
232 | 232 | run_gui |
233 | 233 | clean_script "$todisc_tmp" |
234 | 234 | # add backslash to last line of temp file |
235 | | sed -i "\$s/$/ \\\/" "$todisc_tmp" |
| 235 | gsed -i "\$s/$/ \\\/" "$todisc_tmp" |
236 | 236 | # add "-titleset \" as 1st line |
237 | | sed -i '1i -titleset \\' "$todisc_tmp" |
| 237 | gsed -i '1i -titleset \\' "$todisc_tmp" |
238 | 238 | # add "-end-titleset" as last line |
239 | | sed -i '$a -end-titleset \\' "$todisc_tmp" |
| 239 | gsed -i '$a -end-titleset \\' "$todisc_tmp" |
240 | 240 | # concatenate |
241 | 241 | cat "$todisc_tmp" >> "$final_tmp_script" |
242 | 242 | rm -f "$todisc_tmp" |
… |
… |
|
248 | 248 | ############################################################################### |
249 | 249 | |
250 | 250 | # remove backslash on last line |
251 | | sed -i "\$s/\\\//" "$final_tmp_script" |
| 251 | gsed -i "\$s/\\\//" "$final_tmp_script" |
252 | 252 | echo $SEP |
253 | 253 | mv "$final_tmp_script" "$final_script" |
254 | 254 | echo final script is "$final_script" |
diff -ur src.orig/makedvd src/makedvd
old
|
new
|
|
214 | 214 | done |
215 | 215 | |
216 | 216 | if test -e "$1"; then |
217 | | DISC_NAME=$(readlink -f "$1") |
| 217 | DISC_NAME=$(greadlink -f "$1") |
218 | 218 | else |
219 | 219 | usage_error "File or DVD directory '$1' does not exist." |
220 | 220 | fi |
… |
… |
|
302 | 302 | DISC_SUM=0 |
303 | 303 | while test $i -le $NUM_VOBS; do |
304 | 304 | VOB=$(echo "$VOB_LIST" | awk -F ':' '{ print $'$i' }') |
305 | | VOB_SIZE=$(du -D -B M "$VOB" | awk -F ' ' '{print $1}' | tr -d M) |
| 305 | VOB_SIZE=$(gdu -D -B M "$VOB" | awk -F ' ' '{print $1}' | tr -d M) |
306 | 306 | DISC_SUM=$(expr $VOB_SIZE \+ $DISC_SUM) |
307 | 307 | i=$(expr $i \+ 1) |
308 | 308 | done |
309 | | OUTDIR=$(readlink -f "$OUT_DIR") |
310 | | AVAIL_SPACE=$(df -B M -P "${OUTDIR%/*}" | awk 'NR != 1 {print $4;}' | tr -d M) |
| 309 | OUTDIR=$(greadlink -f "$OUT_DIR") |
| 310 | AVAIL_SPACE=$(gdf -B M -P "${OUTDIR%/*}" | awk 'NR != 1 {print $4;}' | tr -d M) |
311 | 311 | |
312 | 312 | if test $DISC_SUM -gt $AVAIL_SPACE; then |
313 | 313 | echo $SEPARATOR |
… |
… |
|
369 | 369 | fi |
370 | 370 | |
371 | 371 | GROWISOFS_VER=$(growisofs -version | grep version | \ |
372 | | awk '{ print $6 }' | sed 's/,//g') |
| 372 | awk '{ print $6 }' | gsed 's/,//g') |
373 | 373 | |
374 | 374 | # Make sure there is a blank disc to write to |
375 | 375 | probe_media |
… |
… |
|
424 | 424 | probe_media |
425 | 425 | fi |
426 | 426 | |
427 | | DISC_SUM=$(du -s -B M "$OUT_DIR" | awk '{print $1}' | tr -d M) |
| 427 | DISC_SUM=$(gdu -s -B M "$OUT_DIR" | awk '{print $1}' | tr -d M) |
428 | 428 | if test $DISC_SUM -gt $DISC_CAPACITY; then |
429 | 429 | echo $SEPARATOR |
430 | 430 | echo "Cannot continue! DVD image (${DISC_SUM}MB) exceeds the DVD's capacity (${DISC_CAPACITY}MB)." |
diff -ur src.orig/makemenu src/makemenu
old
|
new
|
|
657 | 657 | |
658 | 658 | # Calculate number of \n characters in title, so menu title height |
659 | 659 | # will be set correctly |
660 | | TITLE_LINES=$(echo "$MENU_TITLE" | sed 's/!//g;s/\\n/!/g;s/[^!]//g' | wc -c) |
| 660 | TITLE_LINES=$(echo "$MENU_TITLE" | gsed 's/!//g;s/\\n/!/g;s/[^!]//g' | wc -c) |
661 | 661 | TITLE_HEIGHT=$((100 * $TITLE_LINES)) |
662 | 662 | |
663 | 663 | # Draw the menu title and pad the bottom with TILE_HEIGHT pixels |
… |
… |
|
787 | 787 | # Calculate video length from length of audio |
788 | 788 | VID_LENGTH=$(mplayer -quiet -identify -frames 0 -vo null -ao null \ |
789 | 789 | "$AUDIO_STREAM" 2>&1 | grep '^ID_LENGTH' | awk -F '=' '{print $2}' | \ |
790 | | sed -e "s/\.[0-9]*//g") |
| 790 | gsed -e "s/\.[0-9]*//g") |
791 | 791 | VID_LENGTH=$(expr "$VID_LENGTH" \* $FPS \/ 100) |
792 | 792 | |
793 | 793 | # Make sure VID_LENGTH is nonzero |
diff -ur src.orig/makempg src/makempg
old
|
new
|
|
289 | 289 | # Args: $@ == text string containing complete command-line |
290 | 290 | # To filter/prettify the subprocess output before writing it to the log file, |
291 | 291 | # set the LOG_FILTER variable before calling this function, to e.g. |
292 | | # LOG_FILTER="sed {s/\r/\n/g}" # Replace LF with CR/LF |
| 292 | # LOG_FILTER="gsed {s/\r/\n/g}" # Replace LF with CR/LF |
293 | 293 | # ****************************************************************************** |
294 | | CRLF="sed {s/\r/\n/g}" # Turn carriage-returns into newlines |
| 294 | CRLF="gsed {s/\r/\n/g}" # Turn carriage-returns into newlines |
295 | 295 | FOLD="fold -bs" |
296 | 296 | function cmd_exec() |
297 | 297 | { |
… |
… |
|
325 | 325 | function check_disk_space() |
326 | 326 | { |
327 | 327 | # Determine space available in current directory (in MB) |
328 | | AVAIL_SPACE=$(df -mP . | awk 'NR != 1 {print $4;}') |
| 328 | AVAIL_SPACE=$(gdf -mP . | awk 'NR != 1 {print $4;}') |
329 | 329 | # Rough estimates of KB/sec for different formats |
330 | 330 | K_PER_SEC=200 |
331 | 331 | test "$TGT_RES" = "VCD" && K_PER_SEC=172 |
… |
… |
|
338 | 338 | # based on original file size |
339 | 339 | $SLICE && VIDEO_DURATION=$CLIP_LENGTH || VIDEO_DURATION=$V_DURATION |
340 | 340 | if test "$VIDEO_DURATION" = "0"; then |
341 | | CUR_SIZE=$(du -Dck \"$IN_FILE\" | awk 'END{print $1}') |
| 341 | CUR_SIZE=$(gdu -Dck \"$IN_FILE\" | awk 'END{print $1}') |
342 | 342 | NEED_SPACE=$(expr $CUR_SIZE \* 2) |
343 | 343 | yecho "The encoding process will require about" |
344 | 344 | # Estimate space based as kbps * duration |
… |
… |
|
441 | 441 | ;; |
442 | 442 | "-safe" ) |
443 | 443 | shift |
444 | | SAFE_AREA=$(echo $1 | sed 's/%//g') |
| 444 | SAFE_AREA=$(echo $1 | gsed 's/%//g') |
445 | 445 | ;; |
446 | 446 | "-crop" ) |
447 | 447 | USE_FILTERS=1 |
… |
… |
|
452 | 452 | USE_FILTERS=1 |
453 | 453 | shift |
454 | 454 | # Parse comma-separated values |
455 | | for FILTER in $(echo "$1" | sed 's/,/ /g'); do |
| 455 | for FILTER in $(echo "$1" | gsed 's/,/ /g'); do |
456 | 456 | case "$FILTER" in |
457 | 457 | "none" ) |
458 | 458 | DO_DENOISE=false |
… |
… |
|
532 | 532 | "-subtitles" ) |
533 | 533 | shift |
534 | 534 | if test -e "$1"; then |
535 | | SUBS_FILE=$(readlink -f "$1") |
| 535 | SUBS_FILE=$(greadlink -f "$1") |
536 | 536 | SUBTITLES="-sub \"$SUBS_FILE\"" |
537 | 537 | DO_SUBS=: |
538 | 538 | else |
… |
… |
|
675 | 675 | { |
676 | 676 | # Get total size of all output files |
677 | 677 | cd "$(dirname "$OUT_FILENAME")" |
678 | | FINAL_SIZE=$(du -c -k "$OUT_PREFIX"*.mpg | awk 'END{print $1}') |
| 678 | FINAL_SIZE=$(gdu -c -k "$OUT_PREFIX"*.mpg | awk 'END{print $1}') |
679 | 679 | test -z $FINAL_SIZE && FINAL_SIZE=0 |
680 | 680 | |
681 | 681 | if $FAKE; then |
682 | 682 | : |
683 | 683 | else |
684 | 684 | yecho "Output files:" |
685 | | du -shc "$OUT_PREFIX".mpg "$OUT_PREFIX".[0-9].mpg 2>/dev/null |
| 685 | gdu -shc "$OUT_PREFIX".mpg "$OUT_PREFIX".[0-9].mpg 2>/dev/null |
686 | 686 | fi |
687 | 687 | |
688 | 688 | # Create stats directory if it doesn't already exist. |
… |
… |
|
747 | 747 | # get lines with frame= , and print last field with kbit/s removed |
748 | 748 | bitrates=$(awk -F= '/^frame=/ {gsub("kbits/s", ""); print $NF}' "$LOG_FILE") |
749 | 749 | # get highest value, and remove spaces with sed |
750 | | bitrates=$(sort -un <<< "$bitrates" | sed 's/^[ \t]*//;s/[ \t]*$//') |
| 750 | bitrates=$(sort -un <<< "$bitrates" | gsed 's/^[ \t]*//;s/[ \t]*$//') |
751 | 751 | # average the values. Add 000, so it is in bits. |
752 | 752 | AVG_BITRATE=$(awk '{t+=$0} END{printf "%d\n", t/NR}' <<< "$bitrates") |
753 | 753 | AVG_BITRATE=${AVG_BITRATE}000 |
… |
… |
|
903 | 903 | IN_FILE_TYPE="uri" |
904 | 904 | else |
905 | 905 | IN_FILE_TYPE="file" |
906 | | IN_FILE=$(readlink -f "$IN_FILE") |
| 906 | IN_FILE=$(greadlink -f "$IN_FILE") |
907 | 907 | fi |
908 | 908 | |
909 | 909 | |
… |
… |
|
928 | 928 | OUT_PREFIX="$OUTPUT_DIR/$OUT_PREFIX" |
929 | 929 | # Otherwise, use the full qualified pathname |
930 | 930 | else |
931 | | OUT_PREFIX=$(readlink -f "$OUT_PREFIX") |
| 931 | OUT_PREFIX=$(greadlink -f "$OUT_PREFIX") |
932 | 932 | mkdir -p "$(dirname "$OUT_PREFIX")" |
933 | 933 | fi |
934 | 934 | |
… |
… |
|
1109 | 1109 | yecho "Probing video for information. This may take several minutes..." |
1110 | 1110 | |
1111 | 1111 | # Get an MD5sum of the input file for statistics |
1112 | | IN_FILE_MD5=$(md5sum "$IN_FILE" | awk '{print $1}') |
| 1112 | IN_FILE_MD5=$(gmd5sum "$IN_FILE" | awk '{print $1}') |
1113 | 1113 | |
1114 | 1114 | # Assume nothing is compliant unless idvid says so |
1115 | 1115 | # (these will be overridden by idvid for compliant A/V) |
… |
… |
|
1737 | 1737 | |
1738 | 1738 | # Remove extraneous commas from filter command |
1739 | 1739 | if test -n "$VID_FILTER"; then |
1740 | | VID_FILTER="-vf $(echo "$VID_FILTER" | sed -e 's/,,/,/g' -e 's/^,//')" |
| 1740 | VID_FILTER="-vf $(echo "$VID_FILTER" | gsed -e 's/,,/,/g' -e 's/^,//')" |
1741 | 1741 | fi |
1742 | 1742 | # ****************************************************************************** |
1743 | 1743 | # |
… |
… |
|
2113 | 2113 | # ****************************************************************************** |
2114 | 2114 | |
2115 | 2115 | if ! $FAKE; then |
2116 | | AUDIO_SIZE=$(du -c -b "$AUDIO_STREAM" | awk 'END{print $1}') |
2117 | | VIDEO_SIZE=$(du -c -b "$VIDEO_STREAM" | awk 'END{print $1}') |
| 2116 | AUDIO_SIZE=$(gdu -c -b "$AUDIO_STREAM" | awk 'END{print $1}') |
| 2117 | VIDEO_SIZE=$(gdu -c -b "$VIDEO_STREAM" | awk 'END{print $1}') |
2118 | 2118 | # Total size of streams so far (in MBytes) |
2119 | 2119 | STREAM_SIZE=$(expr \( $AUDIO_SIZE \+ $VIDEO_SIZE \) \/ 1000000) |
2120 | 2120 | # If it exceeds disc size, add '%d' field to allow mplex to split output |
2121 | 2121 | if test $STREAM_SIZE -gt $DISC_SIZE; then |
2122 | | OUT_FILENAME=$(echo "$OUT_FILENAME" | sed -e 's/\.mpg$/.%d.mpg/') |
| 2122 | OUT_FILENAME=$(echo "$OUT_FILENAME" | gsed -e 's/\.mpg$/.%d.mpg/') |
2123 | 2123 | fi |
2124 | 2124 | fi |
2125 | 2125 | |
diff -ur src.orig/makexml src/makexml
old
|
new
|
|
128 | 128 | # Backslash-escape the given special character (and any EOLs) |
129 | 129 | # Usage: |
130 | 130 | # sedprep "$TEXT" / |
131 | | # echo $TEXT | sed "s/PATTERN/$(sedprep "$REPLACEMENT" /)/" |
| 131 | # echo $TEXT | gsed "s/PATTERN/$(sedprep "$REPLACEMENT" /)/" |
132 | 132 | function sedprep () |
133 | 133 | { |
134 | 134 | delim=${2:-/} |
135 | | echo "$1" |sed -e 's/[\&'"$delim"']/\\&/g' -e '$!s,$,\\,'; |
| 135 | echo "$1" |gsed -e 's/[\&'"$delim"']/\\&/g' -e '$!s,$,\\,'; |
136 | 136 | } |
137 | 137 | |
138 | 138 | # ========================================================== |
… |
… |
|
401 | 401 | |
402 | 402 | # Fill in the NEXT command for the previous slide, if there was one |
403 | 403 | NEXT_TITLE="<next ref=\"play-title-$CUR_TITLE\"\/>" |
404 | | SELECTION_XML=$( echo "$SELECTION_XML" | sed -e "s/__NEXT_TITLE__/$NEXT_TITLE/g" ) |
405 | | PLAYLIST_XML=$( echo "$PLAYLIST_XML" | sed -e "s/__NEXT_TITLE__/$NEXT_TITLE/g" ) |
| 404 | SELECTION_XML=$( echo "$SELECTION_XML" | gsed -e "s/__NEXT_TITLE__/$NEXT_TITLE/g" ) |
| 405 | PLAYLIST_XML=$( echo "$PLAYLIST_XML" | gsed -e "s/__NEXT_TITLE__/$NEXT_TITLE/g" ) |
406 | 406 | |
407 | 407 | # -------------------------- |
408 | 408 | # If doing a still-image slideshow, use segment/selection |
… |
… |
|
501 | 501 | |
502 | 502 | # Fill in titleset menu buttons |
503 | 503 | MENU_XML=$(echo "$MENU_XML" | \ |
504 | | sed -e "s/__MENU_BUTTONS__/$(sedprep "$MENU_BUTTONS" /)/g") |
| 504 | gsed -e "s/__MENU_BUTTONS__/$(sedprep "$MENU_BUTTONS" /)/g") |
505 | 505 | |
506 | 506 | # Fill in the POST command. If there is a menu to jump back to, use that; |
507 | 507 | # otherwise, do not insert a POST command. |
… |
… |
|
512 | 512 | else |
513 | 513 | POST_CMD="" |
514 | 514 | fi |
515 | | TS_TITLES=$( echo "$TS_TITLES" | sed -e "s/__POST_CMD__/$POST_CMD/g" ) |
| 515 | TS_TITLES=$( echo "$TS_TITLES" | gsed -e "s/__POST_CMD__/$POST_CMD/g" ) |
516 | 516 | |
517 | 517 | # Append titleset info to ALL_MENU_XML |
518 | 518 | if ! $FORCE_TITLESETS || ! $HAVE_TOP_MENU; then |
… |
… |
|
558 | 558 | # Fill in menu title selections ("buttons") |
559 | 559 | # and remove any remaining __NEXT_TITLE__s |
560 | 560 | SELECTION_XML=$(echo "$SELECTION_XML" | \ |
561 | | sed -e "s/__MENU_BUTTONS__/$(sedprep "$MENU_BUTTONS" /)/g" -e "s/__NEXT_TITLE__//g") |
562 | | PLAYLIST_XML=$(echo "$PLAYLIST_XML" | sed -e "s/__NEXT_TITLE__//g") |
| 561 | gsed -e "s/__MENU_BUTTONS__/$(sedprep "$MENU_BUTTONS" /)/g" -e "s/__NEXT_TITLE__//g") |
| 562 | PLAYLIST_XML=$(echo "$PLAYLIST_XML" | gsed -e "s/__NEXT_TITLE__//g") |
563 | 563 | |
564 | 564 | # Append new PBC menus/playlists to PBC_XML |
565 | 565 | PBC_XML=`cat << EOF |
… |
… |
|
716 | 716 | |
717 | 717 | # Fill in top menu buttons |
718 | 718 | TOP_MENU_XML=$(echo "$TOP_MENU_XML" | \ |
719 | | sed -e "s/__TOP_MENU_BUTTONS__/$(sedprep "$TOP_MENU_BUTTONS" /)/g") |
| 719 | gsed -e "s/__TOP_MENU_BUTTONS__/$(sedprep "$TOP_MENU_BUTTONS" /)/g") |
720 | 720 | |
721 | 721 | # If there is a top menu with no other menus, print an error and |
722 | 722 | # a suggestion that user specify -menu instead of -topmenu |
… |
… |
|
801 | 801 | fi |
802 | 802 | |
803 | 803 | # Remove blank lines and write final result to output file |
804 | | echo "$FINAL_DISC_XML" | sed -e '/^ *$/d' > "$OUT_PREFIX.xml" |
| 804 | echo "$FINAL_DISC_XML" | gsed -e '/^ *$/d' > "$OUT_PREFIX.xml" |
805 | 805 | |
806 | 806 | echo "Done. The resulting XML was written to $OUT_PREFIX.xml." |
807 | 807 | |
diff -ur src.orig/todisc src/todisc
old
|
new
|
|
66 | 66 | # check if symlink in /tmp exists and use time stamped link if so |
67 | 67 | WORK_DIR="/tmp/todisc-work" |
68 | 68 | |
69 | | LOG_FILE=$(readlink -f todisc.log) |
| 69 | LOG_FILE=$(greadlink -f todisc.log) |
70 | 70 | OUT_PREFIX="" |
71 | 71 | TV_STANDARD=ntsc |
72 | 72 | MENU_LEN=( 20 ) |
… |
… |
|
264 | 264 | test -e "$LOG_FILE" && \ |
265 | 265 | printf "%s\n%s %s\n%s\n" "$ME" "$ME" "$SEPARATOR" "$ME" >> "$LOG_FILE" |
266 | 266 | else |
267 | | sed "s/ */ /g;s/^ *//" <<< "$@" | fold -bs |
| 267 | gsed "s/ */ /g;s/^ *//" <<< "$@" | fold -bs |
268 | 268 | test -e "$LOG_FILE" && \ |
269 | | printf "%s %s\n" "$ME" "$@" | sed "s/ */ /g;s/^ *//" | |
| 269 | printf "%s %s\n" "$ME" "$@" | gsed "s/ */ /g;s/^ *//" | |
270 | 270 | fold -bs >> "$LOG_FILE" |
271 | 271 | fi |
272 | 272 | } |
… |
… |
|
276 | 276 | # Returns: Exit status of the subprocess |
277 | 277 | # To filter/prettify the subprocess output before writing it to the log file, |
278 | 278 | # set the LOG_FILTER variable before calling this function, to e.g. |
279 | | # LOG_FILTER="sed 's/\r/\r\n/g'" # Replace LF with CR/LF |
| 279 | # LOG_FILTER="gsed 's/\r/\r\n/g'" # Replace LF with CR/LF |
280 | 280 | # ****************************************************************************** |
281 | 281 | |
282 | 282 | # Print script name, usage notes, and optional error message, then exit. |
… |
… |
|
318 | 318 | |
319 | 319 | format_output() |
320 | 320 | { |
321 | | sed "s/ */ /g;s/^ *//"|fold -bs |
| 321 | gsed "s/ */ /g;s/^ *//"|fold -bs |
322 | 322 | } |
323 | 323 | |
324 | 324 | get_font() |
325 | 325 | { |
326 | 326 | # If there is a filename extension, find the absolute path |
327 | 327 | if grep -q '\...*$' <<< "$1"; then |
328 | | readlink -f "$1" |
| 328 | greadlink -f "$1" |
329 | 329 | # Otherwise, use the literal name |
330 | 330 | else |
331 | 331 | echo "$1" |
… |
… |
|
345 | 345 | audio_length() |
346 | 346 | { |
347 | 347 | mplayer -noconsolecontrols -vo null -ao pcm:fast:file=/dev/null "$1" \ |
348 | | 2>&1 | tr '\r' '\n' | grep ^A: | tail -1 | sed s/^.*A:// | awk '{print $1}' |
| 348 | 2>&1 | tr '\r' '\n' | grep ^A: | tail -1 | gsed s/^.*A:// | awk '{print $1}' |
349 | 349 | } |
350 | 350 | cleanup() |
351 | 351 | { |
… |
… |
|
542 | 542 | |
543 | 543 | stat_logfile() |
544 | 544 | { |
545 | | stat -L -c "%Y" "$LOG_FILE" |
| 545 | gstat -L -c "%Y" "$LOG_FILE" |
546 | 546 | } |
547 | 547 | |
548 | 548 | get_line_count() |
… |
… |
|
624 | 624 | yecho |
625 | 625 | fi |
626 | 626 | [[ $this_set = "group" ]] && echo -e "Stats for" \ |
627 | | $(readlink -f "${FILES_IN[i]}") "\n" || \ |
| 627 | $(greadlink -f "${FILES_IN[i]}") "\n" || \ |
628 | 628 | echo -e "Stats for" "${FILES_IN[i]}" "\n" |
629 | 629 | echo -e \ |
630 | 630 | " video codec: " \ |
… |
… |
|
713 | 713 | fi |
714 | 714 | if test ${#FILES_TO_ENCODE[@]} -lt 12 && ! $SINGLE_SLIDESHOW; then |
715 | 715 | for i in "${FILES_TO_ENCODE[@]}"; do |
716 | | this_file=$(readlink -f "$i") |
| 716 | this_file=$(greadlink -f "$i") |
717 | 717 | test -n "$this_file" && yecho " $this_file" |
718 | 718 | done |
719 | 719 | fi |
… |
… |
|
742 | 742 | yecho |
743 | 743 | fi |
744 | 744 | for i in "${!FILES_TO_ENCODE[@]}"; do |
745 | | IN=$(readlink -f "${FILES_TO_ENCODE[i]}") |
| 745 | IN=$(greadlink -f "${FILES_TO_ENCODE[i]}") |
746 | 746 | if $group_set; then |
747 | 747 | is_image=${grp_file_is_image[i]} |
748 | 748 | # we will replace the symlink with actual mpeg |
… |
… |
|
770 | 770 | fi |
771 | 771 | # AUDIO_FADE=false # do not fade silence FIXME ??? |
772 | 772 | else # not an image file - outfile goes beside infile |
773 | | THIS_FILE=$(readlink -f "${FILES_TO_ENCODE[i]}") |
| 773 | THIS_FILE=$(greadlink -f "${FILES_TO_ENCODE[i]}") |
774 | 774 | yecho "Converting $THIS_FILE" |
775 | 775 | echo |
776 | 776 | countdown 3 |
… |
… |
|
896 | 896 | unset chapt_len_array[${#chapt_len_array[@]}-1] |
897 | 897 | chapter_points=$( running_total <<< ${chapt_len_array[@]} ) |
898 | 898 | # remove trailing space |
899 | | chapter_points=$(sed 's/[ \t]*$//' <<< $chapter_points) |
| 899 | chapter_points=$(gsed 's/[ \t]*$//' <<< $chapter_points) |
900 | 900 | remainder=$( bc <<< "$adjusted_length % $chapter_length" \ |
901 | 901 | 2>/dev/null) |
902 | 902 | (( ${nochapt[index]} )) && local group_chapters[x++]=0 || |
… |
… |
|
926 | 926 | for number in ${group_chapters[d]}; do |
927 | 927 | new_element="$new_element $(format_seconds $number)," |
928 | 928 | grp_chapters[d]="${grp_chapters[d]} $number" |
929 | | grp_chapters[d]=$(sed 's/[ \t]*$//' <<< ${grp_chapters[d]}) |
| 929 | grp_chapters[d]=$(gsed 's/[ \t]*$//' <<< ${grp_chapters[d]}) |
930 | 930 | done |
931 | 931 | local array[d]=$new_element |
932 | 932 | unset new_element |
… |
… |
|
1275 | 1275 | </menus> |
1276 | 1276 | </vmgm> |
1277 | 1277 | EOF |
1278 | | ) |sed '/^ *$/d' >> "$DVDAUTHOR_XML" |
| 1278 | ) |gsed '/^ *$/d' >> "$DVDAUTHOR_XML" |
1279 | 1279 | get_genopts "${args[@]}" |
1280 | 1280 | |
1281 | 1281 | #################### test for incompatible options ####################### |
… |
… |
|
1577 | 1577 | fi |
1578 | 1578 | # find out where vhook lives for ffmpeg |
1579 | 1579 | ffmpeg_prefix=$(which ffmpeg) |
1580 | | ffmpeg_prefix=$(sed 's/\/bin\/ffmpeg//g' <<< "$ffmpeg_prefix") |
| 1580 | ffmpeg_prefix=$(gsed 's/\/bin\/ffmpeg//g' <<< "$ffmpeg_prefix") |
1581 | 1581 | imlib2_vhook="$ffmpeg_prefix/lib/vhook/imlib2.so" |
1582 | 1582 | |
1583 | 1583 | # check for badly compiled or otherwise unusable vhook |
… |
… |
|
1650 | 1650 | "$outdir"/%06d.png) |
1651 | 1651 | yecho "${FFMPEG_CMD[@]}" | strings |
1652 | 1652 | "${FFMPEG_CMD[@]}" 2>&1 | strings >> "$LOG_FILE" |
1653 | | largest_png=$(du -s "$outdir"/*.png|sort -r | |
| 1653 | largest_png=$(gdu -s "$outdir"/*.png|sort -r | |
1654 | 1654 | awk 'NR>1{exit};1 {print $2}') |
1655 | 1655 | mv "$largest_png" "$PREVIEW_IMG" |
1656 | 1656 | yecho "Removing temporary preview files" |
… |
… |
|
1744 | 1744 | in_files=( "${IN_FILES[@]}" ) |
1745 | 1745 | else |
1746 | 1746 | for f in ${!grouping[@]}; do |
1747 | | in_files[f]=$(readlink -f "${grouping[f]}") |
| 1747 | in_files[f]=$(greadlink -f "${grouping[f]}") |
1748 | 1748 | done |
1749 | 1749 | fi |
1750 | 1750 | for ((i=0; i<${#in_files[@]}; i++)); do |
… |
… |
|
1928 | 1928 | done) |
1929 | 1929 | fadeout:1 |
1930 | 1930 | EOF |
1931 | | ) | sed '/^$/d;s/^[ \t]*//' > "$WORK_DIR/dvd-slideshow.conf" |
| 1931 | ) | gsed '/^$/d;s/^[ \t]*//' > "$WORK_DIR/dvd-slideshow.conf" |
1932 | 1932 | } |
1933 | 1933 | |
1934 | 1934 | transition_slide() |
… |
… |
|
2237 | 2237 | if $incoming_vids || [[ $sshows -eq 1 && $inc_files -lt 1 ]]; then |
2238 | 2238 | for f in ${!ARGS_ARRAY[@]}; do |
2239 | 2239 | FILENAMES[f]=${ARGS_ARRAY[f]} |
2240 | | filenames[f]=$(readlink -f "${ARGS_ARRAY[f]}") |
| 2240 | filenames[f]=$(greadlink -f "${ARGS_ARRAY[f]}") |
2241 | 2241 | done |
2242 | 2242 | if $incoming_slides; then |
2243 | 2243 | SLIDESHOW=( ${SLIDESHOW[@]} : ) # is this a slideshow ? |
… |
… |
|
2252 | 2252 | ! $GROUPING && mk_workdir |
2253 | 2253 | unset group groupkey grp x |
2254 | 2254 | for ((i=0; i<${#ARGS_ARRAY[@]}; i++)); do |
2255 | | grp[x++]=$(readlink -f "${ARGS_ARRAY[i]}") |
| 2255 | grp[x++]=$(greadlink -f "${ARGS_ARRAY[i]}") |
2256 | 2256 | done |
2257 | 2257 | unset x |
2258 | 2258 | [[ -z ${FILES[@]} ]] && ss_index=0 || ss_index=${#FILES[@]} |
2259 | 2259 | SLIDESHOW[ss_index]=: # is this a slideshow ? |
2260 | | FILES[ss_index]=$(readlink -f "${ARGS_ARRAY[0]}") |
| 2260 | FILES[ss_index]=$(greadlink -f "${ARGS_ARRAY[0]}") |
2261 | 2261 | GROUP_IN_FILES=( "${GROUP_IN_FILES[@]}" "${grp[@]}" ) |
2262 | 2262 | groupkey=${#FILES[@]} |
2263 | 2263 | GROUP[groupkey-1]=${#grp[@]} |
… |
… |
|
2301 | 2301 | get_listargs "$@" |
2302 | 2302 | unset group groupkey grp x |
2303 | 2303 | for ((i=1; i<${#ARGS_ARRAY[@]}; i++)); do |
2304 | | grp[x++]=$(readlink -f "${ARGS_ARRAY[i]}") |
| 2304 | grp[x++]=$(greadlink -f "${ARGS_ARRAY[i]}") |
2305 | 2305 | done |
2306 | 2306 | GROUP_IN_FILES=( "${GROUP_IN_FILES[@]}" "${grp[@]}" ) |
2307 | 2307 | ((${ARGS_ARRAY[0]})) 2>/dev/null || usage_error "Arguments to \ |
… |
… |
|
2339 | 2339 | shift |
2340 | 2340 | get_listargs "$@" |
2341 | 2341 | for f in ${!ARGS_ARRAY[@]}; do |
2342 | | SLIDESHOW_MENU_THUMBS[f]=$(readlink -f "${ARGS_ARRAY[f]}") |
| 2342 | SLIDESHOW_MENU_THUMBS[f]=$(greadlink -f "${ARGS_ARRAY[f]}") |
2343 | 2343 | done |
2344 | 2344 | ;; |
2345 | 2345 | "-submenu-titles" ) |
… |
… |
|
2569 | 2569 | shift |
2570 | 2570 | get_listargs "$@" |
2571 | 2571 | if [[ -n ${ARGS_ARRAY[@]} ]]; then |
2572 | | SLIDESHOW_CONF=$(readlink -f "${ARGS_ARRAY[0]}") |
| 2572 | SLIDESHOW_CONF=$(greadlink -f "${ARGS_ARRAY[0]}") |
2573 | 2573 | fi |
2574 | 2574 | USE_DVD_SLIDESHOW=: |
2575 | 2575 | ;; |
… |
… |
|
2666 | 2666 | ;; |
2667 | 2667 | "-background" ) |
2668 | 2668 | shift |
2669 | | BACKGROUND=$(readlink -f "$1") |
| 2669 | BACKGROUND=$(greadlink -f "$1") |
2670 | 2670 | USERS_BACKGROUND=: |
2671 | 2671 | ! [[ -e "$BACKGROUND" ]] && \ |
2672 | 2672 | usage_error "background \"$BACKGROUND\" does not exist" |
… |
… |
|
2675 | 2675 | shift |
2676 | 2676 | get_listargs "$@" |
2677 | 2677 | for f in ${!ARGS_ARRAY[@]}; do |
2678 | | SM_BACKGROUND[f]=$(readlink -f "${ARGS_ARRAY[f]}") |
| 2678 | SM_BACKGROUND[f]=$(greadlink -f "${ARGS_ARRAY[f]}") |
2679 | 2679 | ! [[ -e ${SM_BACKGROUND[f]} ]] && usage_error \ |
2680 | 2680 | "submenu background \"$SM_BACKGROUND\" does not exist" |
2681 | 2681 | done |
… |
… |
|
2683 | 2683 | "-intro" ) |
2684 | 2684 | shift |
2685 | 2685 | DO_INTRO=: |
2686 | | INTRO_CLIP=$(readlink -f "$1") |
| 2686 | INTRO_CLIP=$(greadlink -f "$1") |
2687 | 2687 | ! [[ -e "$INTRO_CLIP" ]] && \ |
2688 | 2688 | usage_error "intro clip \"$INTRO_CLIP\" does not exist" |
2689 | 2689 | ;; |
… |
… |
|
2692 | 2692 | get_listargs "$@" |
2693 | 2693 | unset f |
2694 | 2694 | for f in ${!ARGS_ARRAY[@]}; do |
2695 | | SHOWCASE_FILE[f]=$(readlink -f "${ARGS_ARRAY[f]}") |
| 2695 | SHOWCASE_FILE[f]=$(greadlink -f "${ARGS_ARRAY[f]}") |
2696 | 2696 | done |
2697 | 2697 | SHOWCASE=: |
2698 | 2698 | IMG_FMT="png" |
… |
… |
|
2965 | 2965 | if [[ $1 = "none" ]]; then |
2966 | 2966 | BG_AUDIO="none" # for switched menus |
2967 | 2967 | else |
2968 | | BG_AUDIO=$(readlink -f "$1") |
| 2968 | BG_AUDIO=$(greadlink -f "$1") |
2969 | 2969 | if [[ ! -e "$BG_AUDIO" ]]; then |
2970 | 2970 | usage_error "background audio \"$BG_AUDIO\" does not exist" |
2971 | 2971 | fi |
… |
… |
|
2987 | 2987 | usage_error "audio file \"${ARGS_ARRAY[i]}\" not found" |
2988 | 2988 | else |
2989 | 2989 | SM_AUDIO=( "${SM_AUDIO[@]}" \ |
2990 | | "$(readlink -f "${ARGS_ARRAY[i]}")" ) |
| 2990 | "$(greadlink -f "${ARGS_ARRAY[i]}")" ) |
2991 | 2991 | fi |
2992 | 2992 | fi |
2993 | 2993 | done |
… |
… |
|
3217 | 3217 | elif [[ ! -e $2 ]]; then |
3218 | 3218 | usage_error " subtitle file $2 does not exist" |
3219 | 3219 | else |
3220 | | TOVID_OPTS+=( "$1" "$(readlink -f "$2")" ) |
| 3220 | TOVID_OPTS+=( "$1" "$(greadlink -f "$2")" ) |
3221 | 3221 | fi |
3222 | 3222 | elif [[ $1 == "-config" ]]; then |
3223 | 3223 | if [[ ! -e $2 ]]; then |
3224 | 3224 | usage_error "config file $2 does not exist" |
3225 | 3225 | else |
3226 | | TOVID_OPTS+=( "$1" "$(readlink -f "$2")" ) |
| 3226 | TOVID_OPTS+=( "$1" "$(greadlink -f "$2")" ) |
3227 | 3227 | fi |
3228 | 3228 | else |
3229 | 3229 | TOVID_OPTS+=( "$1" ) |
… |
… |
|
3275 | 3275 | fi |
3276 | 3276 | |
3277 | 3277 | if $BURN; then |
3278 | | if [[ ! -b $(readlink -f $BURN_DEVICE) ]]; then |
| 3278 | if [[ ! -b $(greadlink -f $BURN_DEVICE) ]]; then |
3279 | 3279 | usage_error \ |
3280 | 3280 | "$BURN_DEVICE is not a valid block device file or link to a block device. |
3281 | 3281 | Are you sure your burner is \"${BURN_DEVICE}\"? Specify your burner with |
… |
… |
|
3387 | 3387 | |
3388 | 3388 | # Make sure -out was provided and it is valid |
3389 | 3389 | if test -n "$OUT_PREFIX"; then |
3390 | | OUT_DIR=$(readlink -f "$OUT_PREFIX") |
| 3390 | OUT_DIR=$(greadlink -f "$OUT_PREFIX") |
3391 | 3391 | if [[ ! -d ${OUT_DIR%/*} ]]; then |
3392 | | OUT_PATH=$(readlink -m "$OUT_PREFIX") |
| 3392 | OUT_PATH=$(greadlink -m "$OUT_PREFIX") |
3393 | 3393 | usage_error "The -out path ${OUT_PATH%/*}/ does not exist" |
3394 | 3394 | fi |
3395 | 3395 | if egrep -q '<|>|&' <<< "$OUT_DIR"; then |
… |
… |
|
3530 | 3530 | # disallow spaces in thumb titles for text button style |
3531 | 3531 | if [ "$BUTTON_STYLE" = "text" ]; then |
3532 | 3532 | for ((i=0; i<${#TITLES[@]}; i++)); do |
3533 | | T=$(sed 's/^[ \t]*//;s/[ \t]*$//' <<< "${TITLES[i]}") |
| 3533 | T=$(gsed 's/^[ \t]*//;s/[ \t]*$//' <<< "${TITLES[i]}") |
3534 | 3534 | if grep " " <<< "$T" >/dev/null; then |
3535 | 3535 | echo "Sorry, a maximum of one consecutive space is allowed |
3536 | 3536 | in titles for text buttons. \"${TITLES[i]}\" has more than |
… |
… |
|
3682 | 3682 | "todisc from the tovid suite ($TOVID_VERSION) - log for `date`" \ |
3683 | 3683 | "$PATTERN" >> "$LOG_FILE" |
3684 | 3684 | # put the command line into the log file to aid debugging |
3685 | | printf "%s\n%s\n" todisc "${args[@]}" | sed "s/ */ /g;s/^ *//" | fold -bs >> "$LOG_FILE" |
| 3685 | printf "%s\n%s\n" todisc "${args[@]}" | gsed "s/ */ /g;s/^ *//" | fold -bs >> "$LOG_FILE" |
3686 | 3686 | # do some locale debugging |
3687 | 3687 | echo -e "\nYou are using the following locale settings:" >> "$LOG_FILE" |
3688 | 3688 | locale >> "$LOG_FILE" 2>&1 |
… |
… |
|
3977 | 3977 | # Get absolute pathnames of all files |
3978 | 3978 | if ! $VMGM_ONLY; then |
3979 | 3979 | for i in "${FILES[@]}"; do |
3980 | | IN_FILES=("${IN_FILES[@]}" "$(readlink -f "$i")") |
| 3980 | IN_FILES=("${IN_FILES[@]}" "$(greadlink -f "$i")") |
3981 | 3981 | (( ${#FILES[@]} < 12 )) && echo "Adding: $i" || spin "Adding: ${i##*/}" |
3982 | 3982 | done |
3983 | 3983 | fi |
… |
… |
|
4125 | 4125 | used ${CHAPT_ARRAY[i]}" |
4126 | 4126 | fi |
4127 | 4127 | # remove + sign and commas, count the number of chapters left |
4128 | | str=$(sed 's/+/ /g;s/,/ /g' <<< ${CHAPTERS[i]}) |
| 4128 | str=$(gsed 's/+/ /g;s/,/ /g' <<< ${CHAPTERS[i]}) |
4129 | 4129 | for substr in $str; do [[ $substr != 0 ]] && newchapts+=($substr); done |
4130 | 4130 | CHAPTERS[i]=${#newchapts[@]} |
4131 | 4131 | done |
… |
… |
|
4362 | 4362 | #*slide_grp*.mpg are symlinks to the original images we have kept intact |
4363 | 4363 | mixgroup=( "$WORK_DIR"/${TSET_NUM}-slide_grp-*.mpg ) |
4364 | 4364 | for g in ${!mixgroup[@]}; do |
4365 | | MIXFILES[g]=$(readlink -f "${mixgroup[g]}") |
| 4365 | MIXFILES[g]=$(greadlink -f "${mixgroup[g]}") |
4366 | 4366 | MIXLINKS[g]=${mixgroup[g]} |
4367 | 4367 | # remove original link we can keep track of what is already encoded |
4368 | 4368 | rm -f "${MIXLINKS[g]}" |
… |
… |
|
4522 | 4522 | for ((i=0; i<${#TITLES[@]}; i++)); do |
4523 | 4523 | if [[ ${#TITLES[i]} -gt 35 || \ |
4524 | 4524 | $(echo -e "${TITLES[i]}" |wc -l) -gt 1 ]]; then |
4525 | | TITLE[i]=$(sed 's/^ *//'<<<${TITLES[i]//\\n/ }) # no spaces or \n |
| 4525 | TITLE[i]=$(gsed 's/^ *//'<<<${TITLES[i]//\\n/ }) # no spaces or \n |
4526 | 4526 | TITLE[i]=${TITLE[i]:0:35} # cut down to 35 characters maximum |
4527 | 4527 | if [ ${#TITLES[i]} -gt 35 ]; then |
4528 | 4528 | echo " \"${TITLE[i]}...\" (${IN_FILES[i]})" # "..." |
… |
… |
|
5495 | 5495 | $SWITCHED && MPLAYER_SEEK_VAL=${SEEK_VAL[MENU_NUM-1]} |
5496 | 5496 | echo "Using mplayer to get framed images from the showcase video" |
5497 | 5497 | get_framed_pics "$SHOWCASE_VIDEO" >> "$LOG_FILE" 2>&1 |
5498 | | largest_png=$(du -s "$WORK_DIR"/000000*.png|sort -r | |
| 5498 | largest_png=$(gdu -s "$WORK_DIR"/000000*.png|sort -r | |
5499 | 5499 | awk 'NR>1{exit};1 {print $2}') |
5500 | 5500 | mv -v "$largest_png" "$OUT" |
5501 | 5501 | rm -f "$WORK_DIR"/00000*.png |
… |
… |
|
5579 | 5579 | if [ "$SC_FRAMESTYLE" = "glass" ]; then |
5580 | 5580 | MPLAYER_SEEK_VAL=${SEEK_VAL[i]} |
5581 | 5581 | get_framed_pics "${IN_FILES[i]}" >> "$LOG_FILE" 2>&1 |
5582 | | largest_png=$(du -s $WORK_DIR/000*[0-9].png | sort -r | |
| 5582 | largest_png=$(gdu -s $WORK_DIR/000*[0-9].png | sort -r | |
5583 | 5583 | awk 'NR>1{exit};1 {print $2}') |
5584 | 5584 | mv -f $largest_png $WORK_DIR/pics/$i/$(printf "%06d%s" 0 .$IMG_FMT) |
5585 | 5585 | rm -f "$WORK_DIR"/000*[0-9].png |
… |
… |
|
6698 | 6698 | echo ". . . Getting stats on grouped files now . . ." |
6699 | 6699 | echo |
6700 | 6700 | for u in ${!grouping[@]}; do |
6701 | | CUR_VID=$(readlink -f "${grouping[u]}") |
| 6701 | CUR_VID=$(greadlink -f "${grouping[u]}") |
6702 | 6702 | spin "Getting stats on "${CUR_VID##*/}"" |
6703 | 6703 | group_idvid_stats[u]=$(idvid -terse -accurate "$CUR_VID" 2>/dev/null) |
6704 | 6704 | if [ -s "$CUR_VID.nav_log" ]; then |
… |
… |
|
7356 | 7356 | </stream> |
7357 | 7357 | </subpictures> |
7358 | 7358 | EOF |
7359 | | ) |sed '/^ *$/d' > "$SPUMUX_XML" |
| 7359 | ) |gsed '/^ *$/d' > "$SPUMUX_XML" |
7360 | 7360 | |
7361 | 7361 | if $SUB_MENU; then |
7362 | 7362 | JUMP=menu |
… |
… |
|
7526 | 7526 | echo "$POST" |
7527 | 7527 | echo " </pgc>" |
7528 | 7528 | echo " <pgc>" |
7529 | | done | sed '$d' |
| 7529 | done | gsed '$d' |
7530 | 7530 | fi) |
7531 | 7531 | </menus> |
7532 | 7532 | <titles> |
… |
… |
|
7674 | 7674 | echo -e "</dvdauthor>" |
7675 | 7675 | fi) |
7676 | 7676 | EOF |
7677 | | ) |sed '/^ *$/d' >> "$DVDAUTHOR_XML" |
| 7677 | ) |gsed '/^ *$/d' >> "$DVDAUTHOR_XML" |
7678 | 7678 | ############################################################################## |
7679 | 7679 | # Animenu stuff # |
7680 | 7680 | ############################################################################## |
… |
… |
|
7859 | 7859 | else |
7860 | 7860 | CUR_FILE="${IN_FILES[i]}" |
7861 | 7861 | fi |
7862 | | navlog=$(readlink -f "${CUR_FILE}").nav_log |
| 7862 | navlog=$(greadlink -f "${CUR_FILE}").nav_log |
7863 | 7863 | if [[ -s $navlog ]]; then |
7864 | 7864 | NAVSEEK="--nav_seek" && NAVLOG="$navlog" |
7865 | 7865 | else |
… |
… |
|
7871 | 7871 | $NAVSEEK "$NAVLOG" -o "${PICS_OUT[@]}" -f \ |
7872 | 7872 | $FRAME_RATE -Z ${GEO_ARRAY[C]},fast -c $t -y $SM_IMG_FMT,null) |
7873 | 7873 | echo "Running ${TCODE_CMD[@]}" | |
7874 | | sed 's/ */ /g'|sed -e "s/^ *//"|tee -a >> "$LOG_FILE" |
7875 | | #sed 's/ */ /g'|sed -e "s/^ *//"|fold -bs >> "$LOG_FILE" |
| 7874 | gsed 's/ */ /g'|gsed -e "s/^ *//"|tee -a >> "$LOG_FILE" |
| 7875 | #gsed 's/ */ /g'|gsed -e "s/^ *//"|fold -bs >> "$LOG_FILE" |
7876 | 7876 | echo >> "$LOG_FILE" |
7877 | 7877 | run_transcode() |
7878 | 7878 | { |
… |
… |
|
8015 | 8015 | for ((b=0; b<${CHAPTERS[i]}; b++)); do |
8016 | 8016 | IMGS=( "${IMGS[@]}" $(find $WORK_DIR/animenu/$b \ |
8017 | 8017 | -name \*.$SM_IMG_FMT| sort 2>/dev/null | head -n $a | |
8018 | | sed -n -e "$a p") ) |
| 8018 | gsed -n -e "$a p") ) |
8019 | 8019 | done |
8020 | 8020 | IM_CMD=(convert "${IMGS[@]}" -bordercolor '#6E6E6E' \ |
8021 | 8021 | -border $THUMB_FRAME_SIZE miff:-) |
… |
… |
|
8197 | 8197 | echo -e "Running: |
8198 | 8198 | sox $WORK_DIR/menu$s.wav $WORK_DIR/menu$s-processed.wav fade t |
8199 | 8199 | $SM_FADE ${SUBMENU_AUDIOLEN[s]} $SM_FADE" | |
8200 | | sed 's/ */ /g' | format_output |
| 8200 | gsed 's/ */ /g' | format_output |
8201 | 8201 | sox -q $WORK_DIR/menu$s.wav $WORK_DIR/menu$s-processed.wav \ |
8202 | 8202 | fade t $SM_FADE ${SUBMENU_AUDIOLEN[s]} $SM_FADE |
8203 | 8203 | rm $WORK_DIR/menu$s.wav |
… |
… |
|
8329 | 8329 | num_procs=0 |
8330 | 8330 | for p in ${!SC_PICS[@]}; do |
8331 | 8331 | ((num_procs++)) # how many processes are running |
8332 | | this_pic=$(sed 's,.*/,,;s/^0*//;s/.png//' <<< "${SC_PICS[p]}") |
| 8332 | this_pic=$(gsed 's,.*/,,;s/^0*//;s/.png//' <<< "${SC_PICS[p]}") |
8333 | 8333 | pic="${SC_PICS[p]}" |
8334 | 8334 | # if glass and either wave or rotate |
8335 | 8335 | if [ "$SC_FRAMESTYLE" = "glass" ] && \ |
… |
… |
|
9189 | 9189 | for ((x=1; x<=V_TOTAL; x++)); do |
9190 | 9190 | yecho "Running spumux "$WORK_DIR/submenu${x}_spumux.xml" < \ |
9191 | 9191 | $WORK_DIR/menu${x}.mpg > \ |
9192 | | $(sed 's/\(.*\)menu/\1Menu/' <<< $WORK_DIR/menu${x}.mpg)"|fold -bs |
| 9192 | $(gsed 's/\(.*\)menu/\1Menu/' <<< $WORK_DIR/menu${x}.mpg)"|fold -bs |
9193 | 9193 | spumux "$WORK_DIR/submenu${x}_spumux.xml" < \ |
9194 | 9194 | $WORK_DIR/menu${x}.mpg > \ |
9195 | | $(sed 's/\(.*\)menu/\1Menu/' <<< $BASEDIR/${TSET_NUM}-menu${x}.mpg) \ |
| 9195 | $(gsed 's/\(.*\)menu/\1Menu/' <<< $BASEDIR/${TSET_NUM}-menu${x}.mpg) \ |
9196 | 9196 | 2>> "$LOG_FILE" |
9197 | 9197 | done |
9198 | 9198 | fi |
diff -ur src.orig/tovid-init src/tovid-init
old
|
new
|
|
299 | 299 | |
300 | 300 | # File size in bytes |
301 | 301 | FOP_LAST_SIZE=0 |
302 | | FOP_CUR_SIZE=$(du -b "$FOP_OUTFILE" | awk '{print $1}') |
| 302 | FOP_CUR_SIZE=$(gdu -b "$FOP_OUTFILE" | awk '{print $1}') |
303 | 303 | |
304 | 304 | # Keep looping until outfile stops getting bigger |
305 | 305 | while test "$FOP_CUR_SIZE" -gt "$FOP_LAST_SIZE"; do |
… |
… |
|
322 | 322 | sleep ${SLEEP_TIME-"1s"} |
323 | 323 | |
324 | 324 | FOP_LAST_SIZE=$FOP_CUR_SIZE |
325 | | FOP_CUR_SIZE=$(du -b "$FOP_OUTFILE" | awk '{print $1}') |
| 325 | FOP_CUR_SIZE=$(gdu -b "$FOP_OUTFILE" | awk '{print $1}') |
326 | 326 | done |
327 | 327 | printf "\n\n" |
328 | 328 | } |
… |
… |
|
374 | 374 | function get_filesystem() |
375 | 375 | { |
376 | 376 | DIRECTORY="$1" |
377 | | PARTITION=$(df . | tail -n 1 | awk '{print $1}') |
| 377 | PARTITION=$(gdf . | tail -n 1 | awk '{print $1}') |
378 | 378 | FILESYSTEM=$(mount | grep "$PARTITION" | awk '{print $5}') |
379 | 379 | echo "$FILESYSTEM" |
380 | 380 | } |
… |
… |
|
560 | 560 | # ************************************************************************* |
561 | 561 | # Required Dependencies |
562 | 562 | # ************************************************************************* |
563 | | core="grep sed md5sum mplayer mencoder mplex mpeg2enc yuvfps yuvdenoise ppmtoy4m mp2enc jpeg2yuv ffmpeg" |
| 563 | core="grep gsed gmd5sum mplayer mencoder mplex mpeg2enc yuvfps yuvdenoise ppmtoy4m mp2enc jpeg2yuv ffmpeg" |
564 | 564 | |
565 | 565 | # ************************************************************************* |
566 | 566 | # Optional Dependencies |
diff -ur src.orig/tovid-init.in src/tovid-init.in
old
|
new
|
|
299 | 299 | |
300 | 300 | # File size in bytes |
301 | 301 | FOP_LAST_SIZE=0 |
302 | | FOP_CUR_SIZE=$(du -b "$FOP_OUTFILE" | awk '{print $1}') |
| 302 | FOP_CUR_SIZE=$(gdu -b "$FOP_OUTFILE" | awk '{print $1}') |
303 | 303 | |
304 | 304 | # Keep looping until outfile stops getting bigger |
305 | 305 | while test "$FOP_CUR_SIZE" -gt "$FOP_LAST_SIZE"; do |
… |
… |
|
322 | 322 | sleep ${SLEEP_TIME-"1s"} |
323 | 323 | |
324 | 324 | FOP_LAST_SIZE=$FOP_CUR_SIZE |
325 | | FOP_CUR_SIZE=$(du -b "$FOP_OUTFILE" | awk '{print $1}') |
| 325 | FOP_CUR_SIZE=$(gdu -b "$FOP_OUTFILE" | awk '{print $1}') |
326 | 326 | done |
327 | 327 | printf "\n\n" |
328 | 328 | } |
… |
… |
|
374 | 374 | function get_filesystem() |
375 | 375 | { |
376 | 376 | DIRECTORY="$1" |
377 | | PARTITION=$(df . | tail -n 1 | awk '{print $1}') |
| 377 | PARTITION=$(gdf . | tail -n 1 | awk '{print $1}') |
378 | 378 | FILESYSTEM=$(mount | grep "$PARTITION" | awk '{print $5}') |
379 | 379 | echo "$FILESYSTEM" |
380 | 380 | } |
… |
… |
|
560 | 560 | # ************************************************************************* |
561 | 561 | # Required Dependencies |
562 | 562 | # ************************************************************************* |
563 | | core="grep sed md5sum mplayer mencoder mplex mpeg2enc yuvfps yuvdenoise ppmtoy4m mp2enc jpeg2yuv ffmpeg" |
| 563 | core="grep gsed gmd5sum mplayer mencoder mplex mpeg2enc yuvfps yuvdenoise ppmtoy4m mp2enc jpeg2yuv ffmpeg" |
564 | 564 | |
565 | 565 | # ************************************************************************* |
566 | 566 | # Optional Dependencies |