Forums » Tutorial and setups »
stream from one raspberry pi to another
Added by Matt W over 9 years ago
I have openelec/kodi installed in a pair of raspberry pi's. I have a RaspPi 2 running TVheadend backend and I would like to stream this to raspberry pi B running openelec/kodi tvheadend front end.
The TV frontend is connected via wifi. When it is upstairs the stream has no audio. When it is downstairs (closer to the router) it seems to work fine so I think it is a bandwidth issue. I have a hdhomerun dual and this needs to be connected by ethernet to the Pi (no wifi). I thought the stream to the second frontend would need less bandwidth.
Does the tvheadend backend transcode the video? Can I change the bandwidth? I can't find any settings for this.
I choose the rapsberry pi 2 for the backend because I thought it had the juice to transcode the stream.
Can someone clarify the deal with transcoding? I see some posts saying it is built in to new versions of TVheadend but don't see anything about how to configure this?
I am using tvheadend 3.9.2765~g0294882, kodi 14, openelec 5.08
Replies (3)
RE: stream from one raspberry pi to another - Added by Mark Clarkstone over 9 years ago
The RPI (+ the RPI2) hasn't got the power (at least not CPU wise) to transcode. It apparently (I haven't tried it myself) can transcode using the gpu.
Tvheadend cannot make use of the gpu on the Pi at this time, would be a nice feature though..
RE: stream from one raspberry pi to another - Added by Manuel 3 over 9 years ago
I'm trying to set up a Raspberry 2 as a TvH transcoder right now.
With the help of gkreidl I got it to transcode DVB-S and DVB-T MPEG-2TS streams to H264 entirely on the gpu
This is possible with a command like this:
http-launch 3335 /video.mkv video/mkv verbose souphttpsrc location="http://10.0.55.8/stream/channelid/882609712?profile=MPEG2" ! tsdemux name=demux demux. ! queue ! mpegvideoparse ! omxmpeg2videodec ! videoconvert ! omxh264enc target-bitrate=2097152 control-rate=variable ! video/x-h264,stream-format=byte-stream,profile=high,width=720,height=576,framerate=25/1 ! h264parse ! matroskamux name=stream streamable=true demux.audio_0101 ! queue ! mpegaudioparse ! mpg123audiodec ! audioconvert dithering=0 ! audio/x-raw,channels=2 ! voaacenc bitrate=65536 ! stream.
Important parts:
-use gkreidl's http-launch: https://www.raspberrypi.org/forums/viewtopic.php?f=75&t=108700
-you have to get the audio stream pid and insert it in HEX as e.g demux.audio_200 etc..
This transcodes live MPEG2 with 720x575 to h264 in realtime, the pi stays idle at 90%!
I tried this as a input in TVH:
pipe://gst-launch-1.0 souphttpsrc location="http://10.0.55.10:9981/stream/channelid/882609712?profile=MPEG2" ! tsdemux name=demux demux. ! queue ! mpegvideoparse ! omxmpeg2videodec ! videoconvert ! omxh264enc target-bitrate=2097152 control-rate=variable ! video/x-h264,stream-format=byte-stream,profile=high,width=720,height=576,framerate=25/1 ! h264parse ! matroskamux name=stream streamable=true demux.audio_0101 ! queue ! mpegaudioparse ! mpg123audiodec ! audioconvert dithering=0 ! audio/x-raw,channels=2 ! voaacenc bitrate=65536 ! filesink location=/dev/stdout stream.
But unfortunately, it fails. I'm still figuring out where....
EDIT: I've read pipe:// only accepts MPEG TS as source, so I changed to:
pipe://gst-launch-1.0 souphttpsrc location="http://10.0.55.10:9981/stream/channelid/882609712?profile=MPEG2" ! tsdemux name=demux demux. ! queue ! mpegvideoparse ! omxmpeg2videodec ! videoconvert ! omxh264enc target-bitrate=2097152 control-rate=variable ! video/x-h264,stream-format=byte-stream,profile=high,width=720,height=576,framerate=25/1 ! h264parse ! mpegtsmux name=stream streamable=true demux.audio_0101 ! queue ! mpegaudioparse ! mpg123audiodec ! audioconvert dithering=0 ! audio/x-raw,channels=2 ! voaacenc bitrate=65536 ! filesink location=/dev/stdout stream.
But still doesn't work :/
EDIT 2:
This finally works like a charm :)
Outputs h264 AVC with AAC
I use this line:
pipe://gst-launch-1.0 souphttpsrc location="http://tvh:9981/stream/channelid/882609712?profile=MPEG2" \
! tsdemux name=demux demux. ! queue \
! mpegvideoparse ! omxmpeg2videodec ! videoconvert \
! omxh264enc target-bitrate=2097152 control-rate=variable \
! video/x-h264,stream-format=byte-stream,profile=high,width=720,height=576,framerate=25/1 \
! h264parse ! mpegtsmux name=stream demux.audio_0101 ! queue \
! mpegaudioparse ! mpg123audiodec ! audioconvert dithering=0 ! audio/x-raw,channels=2 ! voaacenc bitrate=65536 ! stream.
You need to create a MPEG2 profile on your source TVH to reduce the stream to 1 audio channel, otherwise gst fails (it needs the pid of the stream in HEX - audio_0101).
Transcoding works fine with multiple SD channels, HD transcoding works too!
The reason I use this is because my TVH server is a Synology NAS without transcoding video support,
I had a PC set up with WOL to act as a transcoder for now, but I love to use the PI now simply because it's on 24/7
(it's even driven from the NAS's usb port!)
The quality of the transcoded stream is quite acceptable for SD streams, but you notice some artifacts when watching HD.
(Software encoder may be better, but won't work with the pi
RE: stream from one raspberry pi to another - Added by spyer spyer over 8 years ago
Hello Manuel,
have I correctly understood that transcoding is possible on rp2 with the SAT-TV Server from gkreidl?
Summary:
source: [[https://www.raspberrypi.org/forums/viewtopic.php?f=75&t=108700]]
wget http://steinerdatenbank.de/software/satserver-1.0.tar.gz tar -xzf satserver-1.0.tar.gz cd satserver ./install after than, run and edit satserverdoc.html
The SAT-TV server is still running on the same RP2 with TVH and the power is enough. right?
This HowTo need the MPEG-license only for SD streams?
How many channels can I transcode?
My issue is, that I need transcoding because my bandwidth is not enough for streaming content over the Internet.
Forgive me that I ask so unsuspecting.
If transcoding on RP2 is possible, that sounds be great.
Thank you for you assistance.