News:

Latest versions:
Server plugin: 0.5.1
MVP dongle: 0.5.2
Raspberry Pi client: 0.5.2
Windows client: 0.5.2-1

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - rdoac

#16
VOMP General / MVP / Re: Bug while compiling dongle
February 22, 2010, 16:40:53
I get this with makedev-5


Install glibc headers needed to build bootstrap compiler -- but only if gcc-3.x
+ grep -q 'gcc-[34]' /usr/src/vomp/crosstool/crosstool-0.43/build/powerpc-405-linux-gnu/gcc-3.4.5-glibc-2.2.5/gcc-3.4.5/ChangeLog
+ test '!' -f /usr/src/vomp/crosstool/gcc-3.4.5-glibc-2.2.5/powerpc-405-linux-gnu/powerpc-405-linux-gnu/include/features.h
+ mkdir -p build-glibc-headers
+ cd build-glibc-headers
+ test '!' -f Makefile
+ libc_cv_ppc_machine=yes
+ CC=gcc
+ /usr/src/vomp/crosstool/crosstool-0.43/build/powerpc-405-linux-gnu/gcc-3.4.5-glibc-2.2.5/glibc-2.2.5/configure --prefix=/usr --build=i686-pc-linux-gnu --host=powerpc-405-linux-gnu --without-cvs --disable-sanity-checks --with-headers=/usr/src/vomp/crosstool/gcc-3.4.5-glibc-2.2.5/powerpc-405-linux-gnu/powerpc-405-linux-gnu/include --enable-hacker-mode
creating cache ./config.cache
checking host system type... powerpc-405-linux-gnu
checking sysdep dirs... sysdeps/powerpc/elf sysdeps/unix/sysv/linux/powerpc sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/powerpc sysdeps/unix sysdeps/posix sysdeps/powerpc/fpu sysdeps/powerpc sysdeps/wordsize-32 sysdeps/ieee754/flt-32 sysdeps/ieee754/dbl-64 sysdeps/powerpc/soft-fp sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic
checking for a BSD compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for pwd... /bin/pwd
checking build system type... i686-pc-linux-gnu
checking for powerpc-405-linux-gnu-gcc... gcc
checking version of gcc... 4.3.3, bad
checking for gnumake... no
checking for gmake... gmake
checking version of gmake... 3.81, ok
configure: error:
*** These critical programs are missing or too old:gcc
*** Check the INSTALL file for required versions.

#17
VOMP General / MVP / Bug while compiling dongle
February 22, 2010, 16:16:07
In gentoo:

Using makedev-6, makedev-5 just refuses..


-DTARGET_MACHINE=\"powerpc-405-linux-gnu\" \
-c /usr/src/vomp/crosstool/crosstool-0.43/build/powerpc-405-linux-gnu/gcc-3.4.5-glibc-2.2.5/gcc-3.4.5/gcc/collect2.c -o collect2.o
In function 'open',
    inlined from 'collect_execute' at /usr/src/vomp/crosstool/crosstool-0.43/build/powerpc-405-linux-gnu/gcc-3.4.5-glibc-2.2.5/gcc-3.4.5/gcc/collect2.c:1537:
/usr/include/bits/fcntl2.h:51: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments
make[1]: *** [collect2.o] Error 1
make[1]: Leaving directory `/usr/src/vomp/crosstool/crosstool-0.43/build/powerpc-405-linux-gnu/gcc-3.4.5-glibc-2.2.5/build-gcc-core/gcc'
make: *** [all-gcc] Error 2

#18
Vomp For Windows / Re: Pre-alpha HDTV playback
February 22, 2010, 15:20:32
I tested this last night on three different laptops, with three different reactions..

I have five different types of channel:

ATSC SD with ac3 audio
ATSC SD with mp3 audio (via steamdev / fmpeg and vdr-iptv - a cludge to allow my hardware mvp's to work)
ATSC HD with ac3 audio
a Hauppauge PVR HD, which works via pvrinput, H264, ac3 audio
PVR 500 anlogue MPEG2, mp3 audio

I loaded ac3filter to handle the audio on all PC's. All PC's also have

Laptop 1.  An Asus, with GMA900 graphics chipset, powerdvd 9 codecs..  Vista Ultimate  via WIFI..

Everything worked, but not well, lots of stuttering.  The h264 worked better than the mpeg2 ATSC HD stuff, but I think the bitrate would be lower.

PC Pentium 4 with Intel Graphics, XP..  Wired ethernet

This was the worst of the three. 

Selecting ac3filter crashed vompclient immediately.  I had to go to the server and manually edit the config file..

ATSC with ac3 audio stuttered horribly.
The reencoded stuff was a little better, but only a little..
H264 refused to play completely.
MPEG2 HD updated the picture about once every 10 seconds..

Laptop 3, ACER Aspire 5920G, Dual Core with Nvidia 8600 GFA.. Wifi..

This was nice and fast, and played everything, but the HD content was playing back wrong.. I think it was the vframe issue pointed out elsewhere, it looked like two videoprojectors were pointing at the same screen but one was out of sync slightly...

Recordings played back better than live tv..

Old HD MPEG2 ATSC recordings made under VDR 1.6 didn't play at all, but I think we knew that..

I am in the process of compiling a CVS hardware dongle so I can leave the cvs server code in VDR and the hardware mvp's will work.. Once done I will try testing again..

I noticed the media code was missing in the beta test..  Will that be missing in the latest cvs hardware version too?

#19
VOMP General / MVP / Re: HDTV samples needed
February 17, 2010, 18:28:19
Ooops, sorry, didn't notice some reply's..

Yes, sorry, it's ac3 audio not aac.

I am also using a Hauppauge PVR-HD which captures HD streams from component cables off my HD cable box in an h264 and either aac or ac3 stream..  Working with the pvrinput chaps to get this supported in VDR. We're almost there..

I am now using VDR 1-7-12, so if you want a TS stream I can give it to you..

(Lots of current Lost episodes in HD complete with commercials)..
#20
VOMP General / MVP / Re: Howto simulate a DVB device
February 02, 2010, 04:06:28
IPTV plugin...

The plugin calls a script.  The script uses ffmpeg to pass the file back into vdr using a udp port.

Although I don't know if iptv supports h264..
#21
VOMP General / MVP / PlayOn.com support
December 18, 2009, 18:22:48
Has anyone played with the playon.com windows software?  I am wondering about testing this within my xbmc environment.  After that I wonder how hard it would be to build it into my heavily modified test.sh script?  Anyone interested in working on this with me?

Am also wondering about intergrating get_iplayer into test.sh?  At the moment I have it running as a command line routined to bring up a vpn, download the show I want as an mp4 which media centre in vomp  can play.. and then drops the vpn//   However, it would be good to launch a routine which goes away, gets all the titles, retuens it as a list to vomp and then streams in realtime to vomp what you want to watch..
#22
vdr-iptv is a plugin for vdr which converts an iptv stream into something vdr can handle as any other channel.  It has several modes, the most useful being able to call a script.  The script is responsible for getting the stream back to the vdr server as a udp packet stream. 

I use it to stream shows from bbc iplayer as I now live in the US. 
#23
Hi Marten,

I got it working fairly well. Turned out I had two issues, ATSC uses only AC-3 audio and no regular audio, so them vompserver doesn't send it.  I got around it by using vdr-iptv and feeding the channel from streamdev, through ffmpeg to convert the audio to mp3 and back into vdr as another channel. That vomp can play and record.

The other was an issue with pvrinput for my analogue cable channels.  A patch to that enabled vomp to play them back.

I can send you an HD and SD ATSC stream if you want.  You can probably scp it off my server. 

#24
I use a combination of vdr-iptv, mplayer and ffmpeg..

Install them all and then create a channels.conf for the station of choice:

101QFL-InternetStream;IPTV:190:IPTV|S0P0|EXT|qflradio.sh|8:P:0:0:256:0:0:11:0:0:0
:->UK Radio
:@251
BBCRadio1;IPTV:110:IPTV|S0P0|EXT|bbcradio.sh|1:P:0:0:256:0:0:11:0:0:0
BBCRadio2;IPTV:120:IPTV|S0P0|EXT|bbcradio.sh|2:P:0:0:256:0:0:12:0:0:0
BBCRadio3;IPTV:130:IPTV|S0P0|EXT|bbcradio.sh|3:P:0:0:256:0:0:13:0:0:0
BBCRadio4;IPTV:140:IPTV|S0P0|EXT|bbcradio.sh|4:P:0:0:256:0:0:14:0:0:0
BBCRadio5;IPTV:150:IPTV|S0P0|EXT|bbcradio.sh|5:P:0:0:256:0:0:15:0:0:0
BBCRadio5Live;IPTV:160:IPTV|S0P0|EXT|bbcradio.sh|55:P:0:0:256:0:0:16:0:0:0
BBCRadio6;IPTV:170:IPTV|S0P0|EXT|bbcradio.sh|6:P:0:0:256:0:0:17:0:0:0
BBCRadio7;IPTV:180:IPTV|S0P0|EXT|bbcradio.sh|7:P:0:0:256:0:0:18:0:0:0


That calls a script called bbcradio.sh via iptv, which is:

#!/bin/sh

# internetradio.sh is used by the VDR iptv plugin to transcode an internet
# radio stream.
#
# The script originates from:
# http://www.vdr-wiki.de/wiki/index.php/Iptv-plugin
#
# An example channels.conf entry:
# internetradio;IPTV:2:IPTV|S0P0|EXT|internetradio.sh|0:P:0:0:256:0:0:2:0:0:0
#
# internetradio.sh is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This package is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this package; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
# MA 02110-1301, USA.
#

if [ $# -ne 2 ]; then
    logger "$0: error: Invalid parameter count '$#' $*"
    exit 1
fi
#killall -9 ffmpeg
# Channels.conf parameter
PARAMETER=${1}

# Iptv plugin listens this port
PORT=${2}
mplayeropts="-playlist"
BITRATE=192

# Stream configuration

case ${PARAMETER} in
    1)
         URL="http://www.bbc.co.uk/radio/listen/live/r1.asx"
TITLE="BBC Radio 1"

         # Stream temporary files
         FIFO=/tmp/internetradio${PARAMETER}.fifo
        ;;
    2)
         URL="http://www.bbc.co.uk/radio/listen/live/r2.asx"
         TITLE="BBC Radio 2"

         # Stream temporary files
         FIFO=/tmp/internetradio${PARAMETER}.fifo
        ;;
    3)
         URL="http://www.bbc.co.uk/radio/listen/live/r3.asx"
         TITLE="BBC Radio 3"

         # Stream temporary files
         FIFO=/tmp/internetradio${PARAMETER}.fifo
        ;;

    4)
         URL="http://www.bbc.co.uk/radio/listen/live/r4.asx"
         TITLE="BBC Radio 4"

         # Stream temporary files
         FIFO=/tmp/internetradio${PARAMETER}.fifo
        ;;
    5)
         URL="http://www.bbc.co.uk/radio/listen/live/r5.asx"
         TITLE="BBC Radio 5"

         # Stream temporary files
         FIFO=/tmp/internetradio${PARAMETER}.fifo
        ;;
    55)
         URL="http://www.bbc.co.uk/radio/listen/live/r5l.asx"
         TITLE="BBC Radio 5 Live"

         # Stream temporary files
         FIFO=/tmp/internetradio${PARAMETER}.fifo
        ;;
    6)
         URL="http://www.bbc.co.uk/radio/listen/live/r6.asx"
         TITLE="BBC Radio 6"

         # Stream temporary files
         FIFO=/tmp/internetradio${PARAMETER}.fifo
        ;;
    7)
         URL="http://www.bbc.co.uk/radio/listen/live/r7.asx"
         TITLE="BBC Radio 7"

         # Stream temporary files
         FIFO=/tmp/internetradio${PARAMETER}.fifo
        ;;
    8)
         URL="mms://207.234.146.58/QFLtest"
mplayeropts=
         TITLE="101 QFL"
BITRATE="96"
         # Stream temporary files
         FIFO=/tmp/internetradio${PARAMETER}.fifo
        ;;

    *)
         URL="http://www.bbc.co.uk/radio/listen/live/r4.asx"
         TITLE="BBC Radio 4"

         # Stream temporary files
         FIFO=/tmp/internetradio${PARAMETER}.fifo
        ;;


esac
LOG=/tmp/ipstream

{
rm -f "${FIFO}"
mkfifo "${FIFO}"

if [ ${PARAMETER} = "8" ]; then
rm -f "${FIFO}"
echo Removed Fifo
fi

echo "$1 $2 mplayer $mplayeropts -dumpstream ${URL} \
  -nolirc -noautosub -noconsolecontrols -novideo -nojoystick \
  -dumpfile $FIFO > /tmp/mplayer.out
" >>$LOG
mplayer -dumpstream $mplayeropts "${URL}" \
  -nolirc -noautosub -noconsolecontrols -novideo -nojoystick \
  -dumpfile "$FIFO" &

# Time to connect and fill pipe
sleep 3
MYPID=$$
MPID=`pidof mplayer`

# Build audio only stream
# PID 0x100/256 = Audio

echo "ffmpeg -v -1 \
  -i "${FIFO}" -debug 1\
  -f mpegts -acodec mp2 -ac 2 -ab ${BITRATE}k -ar 44100 \
  udp://127.0.0.1:${PORT}?pkt_size=16356 2> /tmp/lame.out"

ffmpeg -v -1 \
  -i "${FIFO}" -debug 1\
  -f mpegts -acodec mp2 -ac 2 -ab ${BITRATE}k -ar 44100 \
  "udp://127.0.0.1:${PORT}?pkt_size=16356" &

FPID=${!}
echo $FPID >/tmp/iptv-$MYPID
echo $MPID >>/tmp/iptv-$MYPID

trap 'echo Trap activated; kill -9 ${FPID} 2>> $LOG ' INT EXIT QUIT TERM
/etc/vdr/plugins/iptv/procchk ${MYPID} &

# Waiting for the given PID to terminate
wait ${PID}
} >> ${LOG} 2>&1


Horribly messy, but it works, as the mediaplayer times out before the stream comes online..
#25
VOMP General / MVP / Re: HDTV samples needed
December 05, 2009, 20:11:23
I would like to send you some US ATSC HD Streams too, however, I have VDR 1.6,  this the VDR format.  This uses AAC audio, I would like to get this working if possible.
#26
Thanks for the reply.  In the end I gave up and used IPTV to get it working..   However the 5 Second thing I can see would work..
#27
I now have my US ATSC SD channels working.  It's quite convoluted but I will do my best to explain.  This procedure will also allow you to watch Internet Streams..

Theory
---------

ATSC streams only broadcast ac-3 audio.  Vomp cannot handle these streams so will not display the channels.  However, a VDR systems with the IPTV and Streamdev plugins can re-encode the channel using ffmpeg.

Requirements:
-------------------
VDR / Vompserver
iptv plugin (with quick patch if you want more than one "device".)
ATSC patch and plugin.
ATSC source. (and / or some URL's of internet streams).
ffmpeg installed on your system. 
Enough processor to re encode the stream "on the fly".  I have a Quad Core Phenom, so am not sure how much you need.

Problems
------------
Normally, with IPTV and VDR, when you stop watching a channel, SIGTERM is sent to the script which IPTV called.  This can be trapped in the script and ffmpeg can be killed.  However, on my setup, when using with Vompserver, the script ignores SIGTERM, so the IPTV patch sends SIGKILL, which kills the script, but not ffmpeg. If you watch another channel, the first is still being reencoded, so you will get a mash of both streams together which is not pretty.  I have hacked the script I call to run a little process in the background.  Every second it checks to see if the original script is still being run, if not it kills off ffmpeg and mencoder.

Howto
---------
Get ATSC working, and install the IPTV plugin.  Instructions for these can be found elsewhere.  IPTV requires the  pluginparam patch.

To use more than one IPTV device at a time, add  --plugin=iptv --devices=7  to VDR's command line, and the following patch to IPTV's source..  (thanks Rolf Ahrenburg for the tip).


--- a/device.c
+++ b/device.c
@@ -248,7 +248,7 @@ bool cIptvDevice::ProvidesTransponder(const cChannel *Channel) const
bool cIptvDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *NeedsDetachReceivers) const
{
   bool result = false;
-  bool needsDetachReceivers = false;
+  bool needsDetachReceivers = true;

   debug("cIptvDevice::ProvidesChannel(%d)\n", deviceIndex);
   if (ProvidesTransponder(Channel))



My Channels.conf ATSC channels had this type of entry for an ATSC channel.

WREX;(null):525000:M256:T:0:2240:0;2241,2242:0:0:1:0:0:0
WTVO;(null):525000:M256:T:0:2304:0;2305,2306:0:0:4:0:0:0

A reencoded channel has a channels.conf entry of:

WREX-SD-Remux;FFmpeg:290:IPTV|S0P0|EXT|streamdev.sh|109:P:0:256:257:0:0:109:1:1:0
WTVO-SD-Remux;FFmpeg:300:IPTV|S0P0|EXT|streamdev.sh|110:P:0:256:257:0:0:110:1:1:0

Where 109 and 110 are the channel positions of WREX and WTVO in my setup.

In /etc/vdr/plugins/iptv  I have streamdev.sh

/etc/vdr/plugins/iptv/streamdev.sh
#!/bin/sh
#
# iptvstream.sh can be used by the VDR iptv plugin to transcode external
# sources
#
# (C) 2007 Rolf Ahrenberg, Antti Seppälä
#
# iptvstream.sh is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This package is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this package; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
# MA 02110-1301, USA.

if [ $# -ne 2 ]; then
    logger "$0: error: Invalid parameter count '$#' $*"
    exit 1
fi

#killall -9 ffmpeg.streamdev

echo >/tmp/iptvstream

# Channels.conf parameter
PARAMETER=${1}

# Iptv plugin listens this port
PORT=${2}

# Default settings for stream transcoding
LOG=/tmp/iptvstream
VCODEC=mpeg2video
VBITRATE=4000
ACODEC=mp2
ABITRATE=192
fr=29
resx=720
resy=480
fifo=/tmp/streamdev${PARAMETER}.fifo

{
echo Script started $1 $2 >>/tmp/iptvstream
# There is a way to specify multiple URLs in the same script. The selection is
# then controlled by the extra parameter passed by IPTV plugin to the script

echo "Getting new URL">>$LOG
URL="http://oac:3000/TS/${PARAMETER}+1"
echo $PLX $URL >>$LOG

if [ -z "${URL}" ]; then
    logger "$0: error: URL not defined!"
    exit 1
fi

if [ -z "${URL}" ]; then
    logger "$0: error: URL not defined!"
    exit 1
fi
MYPID=$$
echo "Streamdev.sh PID is $MYPID" >>$LOG
# Create transcoding options
echo "Streamdev Plugin $PARAMETER $URL" >>$LOG
# Capture VLC pid for further management in IPTV plugin
mkfifo $fifo
mplayer $mplayeropts -nocache "$URL" -dumpstream -dumpfile $fifo >>${LOG} &
MPID=${!}
     

ffmpeg.streamdev -v 1 \
         -i $fifo -debug 0 \
         -f mpegts -r $fr -vcodec copy -vsync $fr \
          -acodec ${ACODEC} -ac 2 -ab ${ABITRATE}k -ar 48000 \
          "udp://127.0.0.1:${PORT}?pkt_size=16356" &


PID=${!}
echo "pid of ffmpeg.streamdev $PID" >> $LOG
echo $PID >/tmp/iptv-$MYPID
echo $MPID >>/tmp/iptv-$MYPID

/etc/vdr/plugins/iptv/procchk ${MYPID} &

trap 'echo Trap activated; kill -9 ${PID}; kill -9 ${MPID} 2>> $LOG ' KILL INT EXIT QUIT TERM

# Waiting for the given PID to terminate
wait ${PID}
kill -9 $PID
kill -9 ${MPID}
} >> ${LOG} 2>&1

and
/etc/vdr/plugins/iptv/procchk
#!/bin/bash
PIDOFSCRIPT=$1
echo $PIDOFSCRIPT
while ps -p $PIDOFSCRIPT >/dev/null
do
sleep 1
done
echo Killing ffmpeg
cat /tmp/iptv-$PIDOFSCRIPT | xargs kill -9
rm /tmp/iptv-$PIDOFSCRIPT


NB, ffmpeg.streamdev is symlinked to ffmpeg.  I have done this for debugging purposes so I can find out what type of script called ffmpeg.

This will simply reencode the ATSC channel with MP3 audio.

However, some other things you can do are:

RTL 102.5;IPTV:590:IPTV|S0P0|EXT|brit.sh|59:P:0:256:257:0:0:59:0:0:0

/etc/vdr/plugins/iptv/brit.sh
#!/bin/sh
#
# iptvstream.sh can be used by the VDR iptv plugin to transcode external
# sources
#
# (C) 2007 Rolf Ahrenberg, Antti Seppälä
#
# iptvstream.sh is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This package is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this package; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
# MA 02110-1301, USA.

if [ $# -ne 2 ]; then
    logger "$0: error: Invalid parameter count '$#' $*"
    exit 1
fi

#killall -9 ffmpeg.brit

echo >/tmp/iptvstream

# Channels.conf parameter
PARAMETER=${1}

# Iptv plugin listens this port
PORT=${2}

# Default settings for stream transcoding
LOG=/tmp/iptvstream
VCODEC=mpeg2video
VBITRATE=2000
ACODEC=mp2
ABITRATE=320
fr=29
resx=720
resy=480
fifo=/tmp/brit${PARAMETER}.fifo
maps=
mplayeropts=
aspect=16:9
{
echo Script started $1 $2 >>/tmp/iptvstream
# There is a way to specify multiple URLs in the same script. The selection is
# then controlled by the extra parameter passed by IPTV plugin to the script

case ${PARAMETER} in

    64)
#SportItalia
PLX="mms://mms.cdn-tiscali.com/sportitalia"
aspect=4:3
;;
    59)
        PLX="mms://151.1.245.36/rtl102.5vs/"
maps=" -map 0:2 -map 0:1"
        ;;
    *)
        URL=""  # Default URL
        ;;
esac

if [ -z "${PLX}" ]; then
    logger "$0: error: URL not defined!"
    exit 1
fi


echo "Getting new URL">>$LOG

URL=$PLX
echo $URL >>$LOG


if [ -z "${URL}" ]; then
    logger "$0: error: URL not defined!"
    exit 1
fi

# Create transcoding options
echo "Brit Plugin $PARAMETER $URL" >>$LOG
# Capture ffmpeg pid for further management in IPTV plugin

ERR=1
while [ $ERR ]
do
ERR=
mkfifo $fifo
mplayer $mplayeropts "$URL" -dumpstream -dumpfile $fifo >>${LOG} &
MPID=${!}
ffmpeg.brit -v 1 \
         -i $fifo -debug 0\
  -aspect $aspect \
          -f mpegts -r $fr -vcodec ${VCODEC} -b ${VBITRATE}k -er 3 -s ${resx}x${resy} -vsync $fr\
          $maps -acodec ${ACODEC} -ac 2 -ab ${ABITRATE}k -ar 48000 \
          "udp://127.0.0.1:${PORT}?pkt_size=16356" &


PID=${!}
echo "pid of ffmpeg.brit $PID" >>${LOG}
MYPID=$$

echo $PID >/tmp/iptv-$MYPID
echo $MPID >>/tmp/iptv-$MYPID
/etc/vdr/plugins/iptv/procchk ${MYPID} &

trap 'echo Trap activated; kill -9 ${PID}; kill -9 ${MPID} 2>> $LOG ' INT EXIT QUIT TERM

# Waiting for the given PID to terminate
wait ${PID}

ffmpegerr=`tail /tmp/iptvstream | grep "Cannot get resampling context" | awk '{printf $1}'`

if [ $ffmpegerr ];then
ERR=1
echo "$ffmpegerr Restart" >>${LOG}
else
ERR=
echo "$ffmpegerr Stop" >>${LOG}
fi
done
} >> ${LOG} 2>&1
kill -9 $MPID
kill -9 $PID

If you want to watch an asx stream you need to add:

         mplayeropts="-playlist"

Under the PLX line in the Case structure.

These settings are US based (NTSC).  PAL ones would probably change resy to 576 and fr to 25.

Any questions, just ask.

A good source of urls for IPTV is to install XBMV and install the navi-xstreme script.  Then have a look through ~/.xbmc/scripts/Navi-X/cache/

If you're good at scripting you can process some urls before asking mplayer to get them.

Mplayer is better at getting streams than wget or curl.  Hence the dumpstream, fifo's etc..

One problem I had was udp didn't have enough buffer space and I got lots of dropped frames when watch streamdeved channels.

I ended up adding:

/etc/sysctl.conf
#Increase buffersize for udp
net.core.rmem_default=8388608
net.core.rmem_max=33554432


Which solved the problem.

Rob
#28
I'm trying to stream BBC radio to the US.

My playlist is: bbcr4.radio

http://www.bbc.co.uk/radio/listen/live/r4.asx

I have added:

  Command.Name.29=/usr/src/vompserver-devenv/test1.sh
  Command.Extension.29=radio
  Command.Type.29=LIST
  Command.Name.30=/usr/src/vompserver-devenv/test1.sh
  Command.Extension.30=http-radio
  Command.Type.30=LIST

to vomp.conf

and :


    radio)
    convertradioList "$2"
    waitFkt
    ;;
    http-radio)
    fn=`echo "$2" | sed 's/\.[^.]*$//' | sed 's?^ */??'`
    createFifo
    convertradio_playlist "$fn"
    startReader
    waitFkt 1
    ;;

and

#convert a radio playlist
#handle http:// as radio-url
convertradioList() {
  cat "$1" 2>&1 | sed 's?^ *http:\(.*\)?/http:\1.http-radio?'
}

Finally, the stream calls:

convertradio_playlist() {

    url=`wget -q -O - "$1" 2>&1 | grep href -m 1 | awk -F \" '{printf $2}' | xargs echo`
    log url is $url
    log "create radio fifo"
    rm -fr /tmp/radio.wav
    mkfifo /tmp/radio.wav
    log "starting  mplayer -ao pcm:file=/tmp/radio.wav $url " 
    mplayer -ao pcm:file=/tmp/radio.wav $url > /tmp/mplayer.out 2>&1 &
    log "lame -b 192 -v /tmp/radio.wav $FIFO"
    lame -b 192 -v /tmp/radio.wav $FIFO >/tmp/lame.out 2>&1 &
    MPID=$!
}

Which almost works..


16194:Tue Sep  8 15:57:25 CDT 2009:started with param play /mnt/media/music/streams/bbcr4.radio
0 0
16194:Tue Sep  8 15:57:25 CDT 2009:sleepcommand=sleep 1
16194:Tue Sep  8 15:57:25 CDT 2009:start waiting for MPID= and FPID=
16194:Tue Sep  8 15:57:25 CDT 2009:leaving waitFkt
16194:Tue Sep  8 15:57:25 CDT 2009:trap received
16194:Tue Sep  8 15:57:25 CDT 2009:bg: started 16194 /tmp/vdrfifo16194
16194:Tue Sep  8 15:57:26 CDT 2009:bg: remove /tmp/vdrfifo16194
16194:Tue Sep  8 15:57:26 CDT 2009:bg: exiting
16217:Tue Sep  8 15:57:27 CDT 2009:started with param play /http://www.bbc.co.uk/radio/listen/li
ve/r4.asx.http-radio 0 0
16217:Tue Sep  8 15:57:27 CDT 2009:creating tmpfile /tmp/vdrfifo16217
16217:Tue Sep  8 15:57:33 CDT 2009:url is mms://wmlive.bbc.net.uk/wms/bbc_ami/radio4/radio4_bb_l
ive_int_eq1_sl0?BBC-UID=b4aa4a16bcd5a3cec3765eaa71092c2b61b484b19080d164546f2987e4339d05&SSO
2-UID=
16217:Tue Sep  8 15:57:33 CDT 2009:create radio fifo
16217:Tue Sep  8 15:57:33 CDT 2009:starting  mplayer -ao pcm:file=/tmp/radio.wav mms://wmlive.bb
c.net.uk/wms/bbc_ami/radio4/radio4_bb_live_int_eq1_sl0?BBC-UID=b4aa4a16bcd5a3cec3765eaa71092c2b6
1b484b19080d164546f2987e4339d05&SSO2-UID=
16217:Tue Sep  8 15:57:33 CDT 2009:lame -b 192 -v /tmp/radio.wav /tmp/vdrfifo16217
16217:Tue Sep  8 15:57:33 CDT 2009:readerPid=16246
16217:Tue Sep  8 15:57:33 CDT 2009:waiting 20 seconds to prebuffer
16217:Tue Sep  8 15:57:33 CDT 2009:bg: started 16217 /tmp/vdrfifo16217 16245 16246
16217:Tue Sep  8 15:57:36 CDT 2009:bg: remove /tmp/vdrfifo16217
16217:Tue Sep  8 15:57:36 CDT 2009:bg: kill 16245
16217:Tue Sep  8 15:57:36 CDT 2009:bg: kill 16246
16217:Tue Sep  8 15:57:36 CDT 2009:bg: exiting


However, it takes a few seconds before the stream arrives.  I think medialauncher is killing it before it has a chance:


15:57:27.485382 [debug]  MediaLauncher - found command /usr/src/vompserver-devenv/test1.sh to handle name /http://www.bbc.co.uk/radio/listen/live/r4.asx.http-radio
15:57:27.488337 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:27.589236 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:27.589318 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:27.693009 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:27.693085 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:27.796789 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:27.796871 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:27.900558 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:27.900637 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:28.004389 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:28.004471 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:28.108103 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:28.108228 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:28.211885 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:28.211968 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:28.315733 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:28.315840 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:28.419420 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:28.419499 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:28.523203 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:28.523280 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:28.626973 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:28.627052 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:28.730739 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:28.730818 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:28.834538 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:28.834688 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:28.938287 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:28.938367 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:29.042059 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:29.042139 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:29.145836 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:29.145916 [debug]  MediaLauncher - get Block buf (nil), len 2048
etc..
15:57:32.155254 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:32.155334 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:32.259027 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:32.259109 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:32.362801 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:32.362881 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:32.466575 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:32.466655 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:32.570343 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:32.570426 [debug]  MediaLauncher - get Block buf (nil), len 2048
15:57:32.674117 [debug]  MediaLauncher - read 0 bytes (no data within 100ms)
15:57:32.674195 [debug]  MediaLauncher - close stream for child 16217
15:57:32.674214 [debug]  MediaLauncher - trying to kill child 16217
15:57:34.474182 [debug]  MediaLauncher - child 16217 aktive after wait, kill -9


Any hints?  Avvdr?
#29
Been thinking about this a little more.  In the US Teletext doesn't exist.  What about an option to change Teletext to Transcode.  You click the transcode button and the current stream is cat'd through a script like test1.sh?

I suppose this could be an optional button in case euro people want hd tv on their vomp's.
#30
@avvdr

Yup, I already did that.  But it's not elegant and not granny proof (which is my criteria where I'm living at the moments (with the in laws having just relocated). ).

I have both stream and streamdev extension, one just cats the output to vomp, the other through mencoder.

Some mencoder ideas could be good as I don't think I get great quality, but it's good enough.