You may remember I capture OTA TV signals with a MythTV install on Raspberry Pi ( Raspian).
Traditionally if one wants to stream MythTV files across the network one sets up MythWeb. The Pi is quite limited and the MythTV setup there is finicky, so I wanted to do it with a lighter service.
I installed minidlna, edited the /etc/minidlna.conf to point to /video (external drive).
I crank up VLC, the all-singing, all-dancing linux+android video. The DLNA server shows up on the network:
That worked (and the files play), but shows the raw filenames which are used by Myth’s database: 1052_202006102330.ts, for example. 1052 is the internal channel ID, and the rest is the timestamp when the recording started. Awesome for Myth, not awesome for humans. Note: TS means transport stream, the raw digital data from the antenna. AFAIK they are MPEG-2 compressed streams in the US.
Luckily, Myth includes mythlink.pl, a perl script to make symlinks of the .ts files, by default in a subdir called show_names, so /video/show_names in my case.
Now I can access 1052_202006102330.ts as Peter Gunn - 2020-06-10 - 11:30pm
Much more informative, but I get a playback failure. Can’t be the file since it plays back with the original name. Must be something about the new name or the fact it’s a link. Hmmm.
I read the minidlna.conf man page and see a wide_links=yes option, which allows you to follow symlinks outside the specfied media directory. Sounds promising.
I read the output of mythlink.pl –help and see an –underscores option which replaces filename spaces with underscores. Now the file is a little less elegant, but also less likely to dork up a handoff between programs/scripts: Peter_Gunn-2020-06-10-11:30pm
That works. I suspect it was the wide_links setting that did it, though I didn’t test them separately to check.
To automate the linking, I set up a cron job to link the files (with underscores!) hourly.