Skip to content

Useful Development Hints

fetzerch edited this page Jun 9, 2013 · 3 revisions

Useful Development Hints

MythBackend

Logging

Since 0.26, MythBackend's log level and verbosity can be changed without restarting the backend

mythbackend -v help
mythbackend --setverbose general,network,socket
mythbackend --setverbose none

MySQL Commands

Some helpful commands to query the MythTV database.

mysql -u mythtv -p mythconverg

Recordings

Export single recording

mysqldump -u root -p -t --where="chanid=123 AND starttime='20131201153000'" \
    mythconverg recorded recordedseek recordedmarkup > backup.sql

Bookmarks

Retrieve a list of all bookmarks. MythTV stores them as frame offsets, the frame rate allows a conversion to a time offset.

SELECT r.chanid, r.starttime, r.title, r.subtitle, m1.mark, m2.data as framerate,
    SEC_TO_TIME(m1.mark / (m2.data / 1000)) as bookmark
FROM recorded as r 
JOIN recordedmarkup as m1 ON r.chanid=m1.chanid AND r.starttime=m1.starttime
JOIN recordedmarkup as m2 ON r.chanid=m2.chanid AND r.starttime=m2.starttime
WHERE m1.type = 2 AND m2.type = 32