1
|
#!/bin/bash
|
2
|
###################################################
|
3
|
# Command Pass variables
|
4
|
# %f Full path to recording /home/user/Videos/News.ts
|
5
|
# %b Basename of recording News.ts
|
6
|
# %c Channel name BBC world
|
7
|
# %O Owner of this recording user
|
8
|
# %C Who created this recording user
|
9
|
# %t Program title News
|
10
|
# %s Program subtitle Afternoon
|
11
|
# %p Program episode S02.E07
|
12
|
# %d Program description News and stories…
|
13
|
# %e Error message Aborted by user
|
14
|
###################################################
|
15
|
# This script's name and location
|
16
|
# /home/capture/MP4/test.sh
|
17
|
###################################################
|
18
|
# Mark script executable
|
19
|
# sudo chmod +x /home/capture/MP4/test.sh
|
20
|
###################################################
|
21
|
# Allow all to execute
|
22
|
# sudo chmod +777 /home/capture/MP4/test.sh
|
23
|
###################################################
|
24
|
# TVHE command string
|
25
|
# /home/hts/01-scripts/ts-mp4.sh %f %t
|
26
|
###################################################
|
27
|
|
28
|
# Works in TVHE on command line only
|
29
|
# /usr/bin/HandBrakeCLI -Z "Android 1080p30" --no-dvdnav -O -s 1 -i "%f" -o /home/capture/MP4/"%b".mp4
|
30
|
|
31
|
# Pass variable values to output log file for testing
|
32
|
Log=/home/capture/MP4/output.log
|
33
|
echo >> $Log
|
34
|
echo Full path to recording: %f >> $Log
|
35
|
echo Basename of recording: %b >> $Log
|
36
|
echo Channel name: %c >> $Log
|
37
|
echo Owner of this recording: %O >> $Log
|
38
|
echo Who created this recording: %C >> $Log
|
39
|
echo Program title: %t >> $Log
|
40
|
echo Program subtitle: %s >> $Log
|
41
|
echo Program Episode: %p >> $Log
|
42
|
echo Program description: %d >> $Log
|
43
|
echo Error Message: %e >> $Log
|
44
|
|
45
|
# Transcode TVHE output file .ts to Handbrake output .mp4
|
46
|
/usr/bin/HandBrakeCLI -Z "Android 1080p30" --no-dvdnav -O -s 1 -i "%f" -o /home/capture/MP4/"%b".mp4
|
47
|
|
48
|
#Delete original file after transcoding. - Apply this code once the .ts to mp4 is working from script
|
49
|
#rm -f $1
|