Hello Everyone :)
New user here, just built a TVHE server, and love the way its designed and works. Was using NextPVR, and tried MythTV. But found i like TVHE the most.
Hoping someone can help me with the problem with post processing output files.
Not sure if this will be important to my problem, so ill just point out, I am in Australia, so I'm not using a paid service for the EPG as i can get it free over the air. Although that may change later.
I have TVHE setup to output - pass, so straight to the .ts container.
What i want to do, is use a post processing script that will Trans-code the TVHE output file .ts to Handbrake output .mp4.
Have managed to get this to work, of a sort, by adding this line below into TVHE - post processing field.
/usr/bin/HandBrakeCLI -Z "Android 1080p30" --no-dvdnav -O -s 1 -i "%f" -o /home/capture/MP4/"%b".mp4
It gives me a converted file, although it has the file name, and .ts on the end of the file name, then the file extension. EG news.ts.mp4.
Not exactly what i was wanting, but its the closest Ive managed to get working.
This means i end up with two files, one is the original .ts captured video, and then the Trans-coded .mp4 that i want. I would like to be able to call a script, that will perform the trans-code, and then remove the original file, once the trans-code is comlete. But this is where the problem lays. I cant get a script working.
Ive setup the script to be executable, and allowed all users to have rights. But when ever i try to use the script, I can never get an trans-coded output .mp4 file.
Here below is a copy of my test.sh script file, hoping someone can see what I'm doing wrong, and point me in the right direction.
In the Script, ive tried to keep notes, to help me work this out, and tried to output variable values to an log file, but that does not output anything at all.
Please help,have spend days trying to work this out, and i am failing miserably.
#!/bin/bash
###################################################
# Command Pass variables
# %f Full path to recording /home/user/Videos/News.ts
# %b Basename of recording News.ts
# %c Channel name BBC world
# %O Owner of this recording user
# %C Who created this recording user
# %t Program title News
# %s Program subtitle Afternoon
# %p Program episode S02.E07
# %d Program description News and stories…
# %e Error message Aborted by user
###################################################
# This script's name and location
# /home/capture/MP4/test.sh
###################################################
# Mark script executable
# sudo chmod +x /home/capture/MP4/test.sh
###################################################
# Allow all to execute
# sudo chmod +777 /home/capture/MP4/test.sh
###################################################
# TVHE command string
# /home/hts/01-scripts/ts-mp4.sh %f %t
###################################################
# Works in TVHE on command line only
# /usr/bin/HandBrakeCLI -Z "Android 1080p30" --no-dvdnav -O -s 1 -i "%f" -o /home/capture/MP4/"%b".mp4
# Pass variable values to output log file for testing
Log=/home/capture/MP4/output.log
echo >> $Log
echo Full path to recording: %f >> $Log
echo Basename of recording: %b >> $Log
echo Channel name: %c >> $Log
echo Owner of this recording: %O >> $Log
echo Who created this recording: %C >> $Log
echo Program title: %t >> $Log
echo Program subtitle: %s >> $Log
echo Program Episode: %p >> $Log
echo Program description: %d >> $Log
echo Error Message: %e >> $Log
# Transcode TVHE output file .ts to Handbrake output .mp4
/usr/bin/HandBrakeCLI -Z "Android 1080p30" --no-dvdnav -O -s 1 -i "%f" -o /home/capture/MP4/"%b".mp4
#Delete original file after transcoding. - Apply this code once the .ts to mp4 is working from script
#rm -f $1
Copy of script attached.