MT, DVB-T, transcoding, fun

pekkis
2008-01-23
2013-05-30
  • pekkis
    pekkis
    2008-01-23

    Just to share some fun with other MediaTomb users... not maybe really usable but anyway ;)

    Lately I got a DVB-T card to my PC and soon it was hooked up with MediaTomb to play TV-Channels on my mediarenderer.

    Here is what I did:

    1) On filesystem, created files to be listed on mediarenderer:

    # touch tv1.avi
    # touch tv2.avi

    2) Added files to MT db and edited mimetypes corresponding to file names:

    tv1.avi mimetype video/x-tv1
    tv2.avi mimetype video/x-tv2

    3) edited MT config.xml:

      <transcoding enabled="yes">
        <mappings>
          <mimetype-profile>
            <transcode mimetype="video/x-tv1" using="tv1-sh"/>
            <transcode mimetype="video/x-tv2" using="tv2-sh"/>
          </mimetype-profile>
        </mappings>
        <profiles>
          <profile name="tv1-sh" enabled="yes" type="external">
            <mimetype>video/mpeg</mimetype>
            <accept-url>yes</accept-url>
            <first-resource>yes</first-resource>
            <agent command="tv1-tr.sh" arguments="%in %out"/>
            <buffer size="10240" chunk-size="2560" fill-size="5120"/>
          </profile>
          <profile name="tv2-sh" enabled="yes" type="external">
            <mimetype>video/mpeg</mimetype>
            <accept-url>yes</accept-url>
            <first-resource>yes</first-resource>
            <agent command="tv2-tr.sh" arguments="%in %out"/>
            <buffer size="10240" chunk-size="2560" fill-size="5120"/>
          </profile>
        </profiles>
      </transcoding>

    4) created helper scripts for TV-channels:

    # cat tv1-tr.sh
    #!/bin/bash

    INPUT="dvb:"
    OUTPUT="$2"
    PROGRAM="17"
    ADAPTER="0"
    FREQUENCY="562000000"
    SRATE="8000000"
    MODULATION="64"
    MUXER="ts"

    exec /usr/bin/vlc \ -I dummy \ --ts-es-id-pid \ --program ${PROGRAM} \ ${INPUT} \ vcl:quit \ --dvb-adapter ${ADAPTER} \ --dvb-frequency ${FREQUENCY} \ --dvb-srate ${SRATE} \ --dvb-modulation ${MODULATION} \ --sout "#duplicate{dst=std{access=file,mux=${MUXER},dst=${OUTPUT}}"

    # cat tv2-tr.sh
    #!/bin/bash

    INPUT="dvb:"
    OUTPUT="$2"
    PROGRAM="33"
    ADAPTER="0"
    FREQUENCY="562000000"
    SRATE="8000000"
    MODULATION="64"
    MUXER="ts"

    exec /usr/bin/vlc \ -I dummy \ --ts-es-id-pid \ --program ${PROGRAM} \ ${INPUT} \ vcl:quit \ --dvb-adapter ${ADAPTER} \ --dvb-frequency ${FREQUENCY} \ --dvb-srate ${SRATE} \ --dvb-modulation ${MODULATION} \ --sout "#duplicate{dst=std{access=file,mux=${MUXER},dst=${OUTPUT}}"

    5) restarted MT and voi'la, I was able to watch tv-channels 1 & 2 via my mediarenderer by selecting tv1.avi or tv2.avi from filelist on my rendedrer.

    Every TV-channel added needs own file on the db, own mimetype and own helper script for transcoding/duplicating the DVB-stream to FIFO.

    Have fun :)

    /pekkis

     
    • Jin
      Jin
      2008-01-23

      Hi,

      I wonder if you could use the active items functionality to modify the script before starting it, this way you could create a couple of items on the server, where each item would put the correct channel into the script. Would probably be a little more difficult to set up though...

      Another idea is: you could use the playlist functionality to automatically populate your channels.

      You could come up with a playlist format and extend the playlist.js script in the way that your custom playlist format would
      get parsed. This way you could easily add more channels and not fear about clearing the database.

      Thanks for the info, btw!

      Kind regards,
      Jin