I'm wondering if anyone
has created a plugin to automatically transcode SD recordings to H264 ?
I'm now using Kodi on the
Raspberry pi as frontend to vdr + VNSI plugin, it's pretty good
aside from live HDTV which can still stutter (but version
dependent, so I expect will be fixed soon).
I have about 3TB of SD recordings and could probably save
at least 1.5TB if converted to H264, rather than buy & power
more hard disks.
I did a couple of "manual" test conversions using ffmpeg, and they
play OK, vdr reindexes automatically when it finds the index
missing.
ffmpeg -i 001.vdr -vcodec h264 -threads 2 -acodec mp3 -f
mpegts 00001.ts
The plugin should:
a) Do a conversion automatically after recording, nice'd
b) check it was error free (ie success code from ffmpeg or whatever)
c) delete mpeg2 file if OK, cleanup if not, log.
d) ideally force a reindex
e) Option to iterate through old recordings, testing for mpeg2 and
converting as required in the background. Handle .ts and old .vdr
files.
f) Join old 2GB max sized files before creating smaller H264
version .ts.
g) Nice to have - option to
enable function or not
Need to handle various flavours of stream too, subtitles etc.
I've seen scripts like the one below, but the
author reports some issues and obviously not a complete solution.
Maybe vdrrip and/or a noad type approach could be used as the basis?
#!/bin/bash
profile="-vpre hq"
quality="-crf 26" # constant quality
prefix="nice" # "nice ionice -c3"
for i in "$@"; do
[ -r "$i" ] || continue
output="$(basename "$i" | cut -f 1 -d .).$profile.mp4"
[ -e "$output" ] && continue
$nice ffmpeg -i "$i" -acodec copy -scodec copy -threads 0 \
-vcodec libx264 $profile $quality "$output"
done