This is how I ended up doing it in python (I like to describe the process in my code), so I just cut and pasted that portion. My use case is simple, I hardly ever watch live TV, mostly just items that recorded earlier are watched via a large data store on my plex server. I posted the python script on https://sites.google.com/a/moboard.com/tablo/home if you want to review…
# Usage: ./tablo2go.py “search regex”
# Options: -tablo:IP_ADDR tablo ip address (multiple tablos seperated by a colon)
# -ffmpeg:PATH path to ffmpeg (ex /bin/ffmpeg)
# -db:file Tablo Extractor Database File
# -output:dir Save final files here
# -a Reprocess ever 30 minutes, do not exit
# -list List videos on Tablo(s)
# -handbrake Post process with handbrake (and delete .mp4 file)
# Note: Search Terms are optional and should be in a quote if more than one word.
# Example usage:
# ./tablo2go.py -db:/tmp/tablo2go.db -tablo:192.168.2.168 -ffmpeg:/src/ffmpeg/bin/ffmpeg -output:/share/Tablo -handbrake
# This will process all videos on the tablo at 192.168.2.168, further compress them, and store the in /share/Tablo/Series
# ./tablo2go.py -db:/tmp/tablo2go.db
# This will perform the same as the previous example as it will remember settings within the database
# ./tablo2go.py -db:/tmp/tablo2go.db -tablo:192.168.2.168:192.168.2.169 -ffmpeg:/src/ffmpeg/bin/ffmpeg -output:/share/Tablo Whose
# This will process the two tablos on 168, and 169 and only process those which match the search term “Whose”
# Process overview:
# return a dictionary with {‘ids’: {‘VIDEOID1’:IPADDR, ‘VIDEOID2’:IPADDR, etc…}}
# associated metadata, returned in a dictionary {}
# 3. via proc_meta(IPADDR, VIDEOID, DATABASE), review metadata retrieved via step 2, searching
# for series, season, episode, title, airdate, originalairdate, description, and recording
# status and update database with this information.
# These are all called in turn via db_update(TABLOS, DB), which looks for new shows, aquires
# the metadata for only those shows that it has not processed before, processes the metadata,
# deletes shows that are no longer available from the database, revisists those that were
# recording previously.
# 4. if a search string is entered only process items that match, and that have finished recording,
# and that have not been processed in the past.
# 5. via get_video(IPADDR, VIDEOID, DIRECTORY, FFMPEG, FILENAME), each .ts file at
# completion, it is rebuild using the ffmpeg command noted on the discussion board
# FFMPEG -i “concat:file1.ts|file2.ts|…” -bsf:a aac_adtstoasc -c copy “DIRECTORY/FILENAME.mp4”’
# For TV shows this ends up as /DIRECTORY/Series_Name/Series_Name - S01E01 - Episode.mp4",
# for Movies this would be /DIRECTORY/Movie_Name (Year).mp4".
# 6. if postprocessing is desired, HandBrakeCLI is called with (my traditional kmttg settings)
# HandBrakeCLI -i “DIRECTORY/FILENAME.mp4” -f -a 1 -E copy -f mkv -O -e x264 -q 22.0
# --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 4.1
# --decomb --denoise=weak -v -o “’+DIRECTORY/FILENAME.mkv”
# and the original mp4 is deleted.
# 7. Mark within the database as processed, move onto the next file, loop as necessary if
# ran as a service.