gkreidl
Posts: 5713
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Real Time Transcoding of DVB TV Streams

Mon Oct 02, 2017 1:05 pm

fcasaletti wrote:
Mon Oct 02, 2017 12:02 pm
Hi guys, so as for my understanding, the rtransconding is not working on Raspbian Stretch?
Unfortunately i was facing a SD card issue, so i rebuild everything from beginning, using Raspbian Stretch, and rtranscoding doesn't want work, the error is related to delay. I'm very, sad this project is amazing, hopefully that the Owner can solve the issue, unfortunately i don't have a right competence to try solve issue for myself.
thanks and in case sorry for my not perfect English. :)
Currently you need Jessie for transcoding. Unfortunately the current gstreamer-omx version cannot be used for transcoding ( viewtopic.php?f=66&t=193152 ).

As I'm using transcoding almost daily (and I'm often running more than one transcoder) all my RPis are still running Jessie, except for a Stretch development system.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

kazuko.nakamura
Posts: 55
Joined: Sun May 29, 2016 7:14 am

Re: Real Time Transcoding of DVB TV Streams

Tue Oct 03, 2017 8:48 am

Hi,

I would like to ask about using realtime transcoding for RPi2.

At the moment I'm using RPi2 with OpenELEC. I receive tv signal (DVB-C) from USB stick and all working fine. Problem is because when I want to stream video from my RPi to internet, stream is hudge (upload) and video isn't smooth, many cracks etc.

The best solution for me would be stay with LibreELEC with Tvheadend and transcoding direct from Tvheadend, but probably at the moment is not possible:
https://forum.libreelec.tv/thread/10091 ... #post64858

I thought about other solution - install raspbian, then compile ffmpeg or gstreamer, then install tvheadend and KODI. Is this would be working?

gkreidl
Posts: 5713
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Real Time Transcoding of DVB TV Streams

Tue Oct 03, 2017 9:44 am

kazuko.nakamura wrote:
Tue Oct 03, 2017 8:48 am
Hi,

I would like to ask about using realtime transcoding for RPi2.

At the moment I'm using RPi2 with OpenELEC. I receive tv signal (DVB-C) from USB stick and all working fine. Problem is because when I want to stream video from my RPi to internet, stream is hudge (upload) and video isn't smooth, many cracks etc.

The best solution for me would be stay with LibreELEC with Tvheadend and transcoding direct from Tvheadend, but probably at the moment is not possible:
https://forum.libreelec.tv/thread/10091 ... #post64858

I thought about other solution - install raspbian, then compile ffmpeg or gstreamer, then install tvheadend and KODI. Is this would be working?
My transcoding solution works (on Jessie only, not yet on Stretch) with HTTP and UDP MPEG TS streams. You don't have to compile anything, it uses standard gstreamer tools from the repository. It works with mumudvb, VDR, GNUTV etc.

For some unknown reason it doesn't connect to Tvheadend streams, but I'm not an expert in Tvheadend use and uninstalled it after three days of pure frustration. But perhaps someone with more experience with Tvheadend might get it to work. The problem is the first element of the gstreamer pipeline "souphttpsrc", which doesn't connect to the TVheadend stream.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

kazuko.nakamura
Posts: 55
Joined: Sun May 29, 2016 7:14 am

Re: Real Time Transcoding of DVB TV Streams

Tue Oct 03, 2017 11:12 am

gkreidl wrote:
Tue Oct 03, 2017 9:44 am
My transcoding solution works (on Jessie only, not yet on Stretch) with HTTP and UDP MPEG TS streams. You don't have to compile anything, it uses standard gstreamer tools from the repository. It works with mumudvb, VDR, GNUTV etc.
Is this working with GPU (omx,mmal) ???

gkreidl
Posts: 5713
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Real Time Transcoding of DVB TV Streams

Tue Oct 03, 2017 11:36 am

kazuko.nakamura wrote:
Tue Oct 03, 2017 11:12 am
gkreidl wrote:
Tue Oct 03, 2017 9:44 am
My transcoding solution works (on Jessie only, not yet on Stretch) with HTTP and UDP MPEG TS streams. You don't have to compile anything, it uses standard gstreamer tools from the repository. It works with mumudvb, VDR, GNUTV etc.
Is this working with GPU (omx,mmal) ???
Yes (omx), it uses the GPU both for decoding (MPEG2, H264) and encoding (H264). Audio streams can be original or also transcoded (by software). The manual is available online. For more information, go to: viewtopic.php?f=38&t=123876#p835946
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

kazuko.nakamura
Posts: 55
Joined: Sun May 29, 2016 7:14 am

Re: Real Time Transcoding of DVB TV Streams

Tue Oct 03, 2017 12:53 pm

Great Job with rtranscode!

Maybe I'm wrong but I thought that just very expensive professional hardware encoders like from studio TV stations can do transcoding "on the fly". Funny, but $20 small computer with 2A power can do the same :)

I'm waiting for full working tvheadend mod. Implementation on GPU transcoding is started:
http://build.mycvh.de/Tvh-LE8.2/4.3-exp ... 4.09.2017/

But at the moment there is some bug in tvheadend which prevents this to normal working. I hope will be solved because tvheadend is very handy - when i put http://XXX.XXX.XXX.XXX:9981/tv.html I can watch TV straight from tvheadend.

kazuko.nakamura
Posts: 55
Joined: Sun May 29, 2016 7:14 am

Re: Real Time Transcoding of DVB TV Streams

Thu Oct 05, 2017 1:30 pm

Hi,

I decided to install clear raspbian with tvheadend and rtrancode. tvheadend receiving signal from USB stick (DVB-C). All working fine, I'm able to play raw .ts stream.

Problem begins when I want to use rtranscode. After taking URL stream from tvheadend and put to command line with rtranscode, I see that rtranscode server starts with no errors:

Code: Select all

rtranscode http://192.168.0.111:9981/stream/channel/59d4292ca045a511f6dafde84028bcdc?ticket=033EA8F106E4E8BBEF5BF5E440F28B8C65CBBA60 hd2 aac 0x17e8
Starting to transcode
Size: 768x432  VBR: 900K  ABR: 64K AAC
Listening on http://127.0.0.1:9080/xyz.mkv
Starting pipeline
On second computer in LAN home network when I try to play transcoded stream:

Code: Select all

mpv 'http://192.168.0.111:9080/xyz.mkv'
Playing: http://192.168.0.111:9080/xyz.mkv
[cache] Cache is not responding - slow/stuck network connection?
[ffmpeg] http: Stream ends prematurely at 0, should be 18446744073709551615
Failed to recognize file format.
How to fix this problem?

gkreidl
Posts: 5713
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Real Time Transcoding of DVB TV Streams

Thu Oct 05, 2017 4:16 pm

kazuko.nakamura wrote:
Thu Oct 05, 2017 1:30 pm
Hi,

I decided to install clear raspbian with tvheadend and rtrancode. tvheadend receiving signal from USB stick (DVB-C). All working fine, I'm able to play raw .ts stream.

Problem begins when I want to use rtranscode. After taking URL stream from tvheadend and put to command line with rtranscode, I see that rtranscode server starts with no errors:

Code: Select all

rtranscode http://192.168.0.111:9981/stream/channel/59d4292ca045a511f6dafde84028bcdc?ticket=033EA8F106E4E8BBEF5BF5E440F28B8C65CBBA60 hd2 aac 0x17e8
Starting to transcode
Size: 768x432  VBR: 900K  ABR: 64K AAC
Listening on http://127.0.0.1:9080/xyz.mkv
Starting pipeline
On second computer in LAN home network when I try to play transcoded stream:

Code: Select all

mpv 'http://192.168.0.111:9080/xyz.mkv'
Playing: http://192.168.0.111:9080/xyz.mkv
[cache] Cache is not responding - slow/stuck network connection?
[ffmpeg] http: Stream ends prematurely at 0, should be 18446744073709551615
Failed to recognize file format.
How to fix this problem?
As I have stated here: viewtopic.php?f=38&t=123876&p=835946#p835946 rtranscode doesn't work with tvheadend. I suppose it's a redirection problem between tvheadend and souphttp; souphttpsrc (the first element in the gstreamer pipeline) never gets into contact with the real tvheadend stream.
Unfortunately the tvheadend documentation is outdated and incomplete and I couldn't find any information about the way it works.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

kazuko.nakamura
Posts: 55
Joined: Sun May 29, 2016 7:14 am

Re: Real Time Transcoding of DVB TV Streams

Thu Oct 05, 2017 4:40 pm

Thanks for info.

Is possible to take stream links from USB stick that skipping tvheadend?

[EDIT]

So far I'm trying with w_scan but can't find any DVB-C channels:

Code: Select all

w_scan -X -f c >> channels.txt

[EDIT 2]

Ok, w_scan found channels - was necessary to change suitable country.
But... is possible to generate stream links somehow or that rtanscode can import channels.conf?

gkreidl
Posts: 5713
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Real Time Transcoding of DVB TV Streams

Fri Oct 06, 2017 9:03 am

kazuko.nakamura wrote:
Thu Oct 05, 2017 4:40 pm
Thanks for info.

Is possible to take stream links from USB stick that skipping tvheadend?

[EDIT]

So far I'm trying with w_scan but can't find any DVB-C channels:

Code: Select all

w_scan -X -f c >> channels.txt

[EDIT 2]

Ok, w_scan found channels - was necessary to change suitable country.
But... is possible to generate stream links somehow or that rtanscode can import channels.conf?
You need some kind of backend. I use mumudvb, but this requires a config file for each channel (or transponder). The easiest way is to use gnutv in udp mode. To get it you have to install "dvb-apps". Your channels file should work with it, because you have created it with the -X option.

Open the channels.txt and look for the name of a channel you want to stream. I assume it's in the /home/pi folder (otherwise you have to change the path below). In a Terminal run

Code: Select all

gnutv -out udp localhost 5001 -channels /home/pi/channels.txt 'channel name'
(Replace 'channel name' with the name of the channel).

Test the stream with omxplayer:
omxplayer udp://localhost:5001

If that works, you can test it with rtranscode using the autoconfiguration mode:

Code: Select all

rtranscode -t=udp://localhost:5001
This will take a few seconds to start, because it uses omxplayer to analyze the stream. (you can also add more options to set the bit rates, video size etc.).

Note: You can also use multicast to serve the original stream to your network. Simply replace "localhost" with a multicast address, e. g. "239.100.0.0". But that doesn't seem to work with all routers and it may clutter your network.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

kazuko.nakamura
Posts: 55
Joined: Sun May 29, 2016 7:14 am

Re: Real Time Transcoding of DVB TV Streams

Fri Oct 06, 2017 9:12 am

Thanks! I will try mumutv and gnutv.

Multicast doesn't work for me. I was try with dvblast and couldn't take any stream working - probably my router don't carry multicast.

gkreidl
Posts: 5713
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Real Time Transcoding of DVB TV Streams

Fri Oct 06, 2017 9:38 am

kazuko.nakamura wrote:
Fri Oct 06, 2017 9:12 am
Thanks! I will try mumutv and gnutv.

Multicast doesn't work for me. I was try with dvblast and couldn't take any stream working - probably my router don't carry multicast.
GNUTV is good for testing. mumudvb is much better but requires more work. Do not use the repository version, it's very old. Get the latest RPi version from the mumudvb website: http://mumudvb.net/download/
Install it with gdebi (to get the dependencies).
If you contact me via PM I can send you configuration example files - only DVB-S, but the differences are very small).
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

skweee
Posts: 2
Joined: Sun Oct 15, 2017 9:24 am

Re: Real Time Transcoding of DVB TV Streams

Sun Oct 15, 2017 9:56 am

Hi gkreidl,

thanks for the great work on rtranscode. I was looking for an efficient transcoding toolchain for the Raspberry Pi and this was just what I was looking for.

My goal was to create a simple transcoding HTTP proxy (e.g. for Enigma2 set top boxes). This is what it should do:
[*] Take a client request (e.g. 'http://raspi:8001/test.ts')
[*] Relay the request to an upstream source using the original request path (e.g. 'http://enigma2:8001/test.ts')
[*] Return a transcoded video stream to the client

Of course this means that there is no channel list and all requests have to be analyzed using omxplayer. I also had to take care of cleaning up after omxplayer, because after starting omxplayer once from a python process, it would not reliably work any more and leave running dbus-daemon processes.

I also added some logic which allows a priority setting for audio languages (first language in the list has the highest priority). Without it, I would often get the wrong audio track (e.g. with audio description for the blind).

Another change was to not use http-launch, but instead use a simple python-based HTTP server, so it could handle more than one (sequential) request. This means I am also running gstreamer directly from python using the gstreamer python binding.

The end result still heavily relies on your code. I hope you are fine with me releasing it, of course giving credit to your great work and respecting the GPL.

You can find the source code for this 'rtranscodeproxy' right here:
https://github.com/skweee/rtranscodeproxy

Warning: This is experimental software. I only tested it using enigma2 http streams and the DreamDroid Android app as well as VLC player. The current version supports everything I need right now, so if you have any requests, feel free to submit a pull request or fork the repository.

gkreidl
Posts: 5713
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Real Time Transcoding of DVB TV Streams

Sun Oct 15, 2017 12:15 pm

skweee wrote:
Sun Oct 15, 2017 9:56 am
Hi gkreidl,

thanks for the great work on rtranscode. I was looking for an efficient transcoding toolchain for the Raspberry Pi and this was just what I was looking for.

My goal was to create a simple transcoding HTTP proxy (e.g. for Enigma2 set top boxes). This is what it should do:
[*] Take a client request (e.g. 'http://raspi:8001/test.ts')
[*] Relay the request to an upstream source using the original request path (e.g. 'http://enigma2:8001/test.ts')
[*] Return a transcoded video stream to the client

Of course this means that there is no channel list and all requests have to be analyzed using omxplayer. I also had to take care of cleaning up after omxplayer, because after starting omxplayer once from a python process, it would not reliably work any more and leave running dbus-daemon processes.

I also added some logic which allows a priority setting for audio languages (first language in the list has the highest priority). Without it, I would often get the wrong audio track (e.g. with audio description for the blind).

Another change was to not use http-launch, but instead use a simple python-based HTTP server, so it could handle more than one (sequential) request. This means I am also running gstreamer directly from python using the gstreamer python binding.

The end result still heavily relies on your code. I hope you are fine with me releasing it, of course giving credit to your great work and respecting the GPL.

You can find the source code for this 'rtranscodeproxy' right here:
https://github.com/skweee/rtranscodeproxy

Warning: This is experimental software. I only tested it using enigma2 http streams and the DreamDroid Android app as well as VLC player. The current version supports everything I need right now, so if you have any requests, feel free to submit a pull request or fork the repository.
Great. I just downloaded the source and will study it tomorrow. I'll contact you via PM afterwards.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

kazuko.nakamura
Posts: 55
Joined: Sun May 29, 2016 7:14 am

Re: Real Time Transcoding of DVB TV Streams

Sun Oct 22, 2017 7:58 pm

Well, I'm still experimenting with tvheadend to rtranscode and nearly is working good :)

This is better soulution for me because mumudvb require new tv tuner for each frequency. I have couple frequencies with channels.

So, what I did?
1. I took playlist file from tvheadend: http://tvh.ip:9981/playlist (maybe links from playlist contain RAW .ts, I don't know)
2. I was import playlist.m3u from tvheadend to rtranscode:

Code: Select all

rtranscode -i=playlist.m3u -o=mychannels.dat
3. After this I removed each line text from question mark to word "pass" (word pass also removed)

And actually is working good. Only problem is that very often HD channels just stops playing and I need to restrat transcoding by "x" option. I don't know why is that but the same issue was with mumudvb.

gkreidl
Posts: 5713
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Real Time Transcoding of DVB TV Streams

Mon Oct 23, 2017 6:51 am

kazuko.nakamura wrote:
Sun Oct 22, 2017 7:58 pm
Well, I'm still experimenting with tvheadend to rtranscode and nearly is working good :)

This is better soulution for me because mumudvb require new tv tuner for each frequency. I have couple frequencies with channels.

So, what I did?
1. I took playlist file from tvheadend: http://tvh.ip:9981/playlist (maybe links from playlist contain RAW .ts, I don't know)
2. I was import playlist.m3u from tvheadend to rtranscode:

Code: Select all

rtranscode -i=playlist.m3u -o=mychannels.dat
3. After this I removed each line text from question mark to word "pass" (word pass also removed)

And actually is working good. Only problem is that very often HD channels just stops playing and I need to restrat transcoding by "x" option. I don't know why is that but the same issue was with mumudvb.
Sounds interesting (I never got it to work with tvheadend). Can you give us an example line from the original playlist and how you edited it?

The transcoder may stop working, if:

1) the original stream gets corrupted
2) there's a program change in the original stream (even using the same program number)
3) there's a break/timeout in the communication between the the original stream and the transcoder

I use the following settings in /boot/config.txt:
gpu_freq=500
force_turbo=1
gpu_mem=192

To reduce swapping I have added
sysctl vm.swappiness=1
to /etc/rc.local

You might also increase buffer sizes in your tv engine (I've done that in my mumudvb config) or in the transcoder.
For the last, edit /usr/local/share/rtranscode/config.py (as root):
go to the line starting with
rt_sources =
and modify
blocksize=16384
(using a higher value).
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

kazuko.nakamura
Posts: 55
Joined: Sun May 29, 2016 7:14 am

Re: Real Time Transcoding of DVB TV Streams

Mon Oct 23, 2017 7:23 am

Thanks gkreidl, I will try yours settings later.

Here is example of oryginal playlist form tvheadend: (http://tvh.ip:9981/playlist)

Code: Select all

#EXTINF:-1 tvg-id="0e1dc32eeee13a0c431be5472e06a1af",TVP 1
http://192.168.0.111:9981/stream/channelid/784538894?ticket=F748AF63728529BDFA009D9BCAD0641F7C775C91&profile=pass
#EXTINF:-1 tvg-id="66c777b313b6bf8ad4fd8fb2a0d66ec6",TVP 2
http://192.168.0.111:9981/stream/channelid/863487846?ticket=AC5D21112CB5A25C8E6355958CC4AD20E5291418&profile=pass
#EXTINF:-1 tvg-id="535794281a18e11233e58d1db3ca4f81",TVP Info
http://192.168.0.111:9981/stream/channelid/680810323?ticket=6B83CC867DECDD7D26D027B73070996BE85FD413&profile=pass
...
To working with transcode I've removed all from "ticket" to "pass" (after importing playlist by command rtranscode -i=playlist.m3u -o=mychannels.dat)

Code: Select all

# channel list for transcode.py
# Enter one line for each channel like this:
# channel_name=uri videomode audiomode audiopid [vo]
# check the README for details 
TVP1 HD=http://192.168.0.111:9981/stream/channelid/784538894 hd2 mpeg 0x2dd
TVP2 HD=http://192.168.0.111:9981/stream/channelid/863487846 hd2 mpeg 0x2e5
TVP Info=http://192.168.0.111:9981/stream/channelid/680810323 hd2 mpeg 0x2c6
...
as mentioned here: https://tvheadend.org/boards/5/topics/28957 they are raw .ts streams.

gkreidl
Posts: 5713
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Real Time Transcoding of DVB TV Streams

Mon Oct 23, 2017 8:17 am

kazuko.nakamura wrote:
Mon Oct 23, 2017 7:23 am
Thanks gkreidl, I will try yours settings later.

Here is example of oryginal playlist form tvheadend: (http://tvh.ip:9981/playlist)

Code: Select all

#EXTINF:-1 tvg-id="0e1dc32eeee13a0c431be5472e06a1af",TVP 1
http://192.168.0.111:9981/stream/channelid/784538894?ticket=F748AF63728529BDFA009D9BCAD0641F7C775C91&profile=pass
#EXTINF:-1 tvg-id="66c777b313b6bf8ad4fd8fb2a0d66ec6",TVP 2
http://192.168.0.111:9981/stream/channelid/863487846?ticket=AC5D21112CB5A25C8E6355958CC4AD20E5291418&profile=pass
#EXTINF:-1 tvg-id="535794281a18e11233e58d1db3ca4f81",TVP Info
http://192.168.0.111:9981/stream/channelid/680810323?ticket=6B83CC867DECDD7D26D027B73070996BE85FD413&profile=pass
...
To working with transcode I've removed all from "ticket" to "pass" (after importing playlist by command rtranscode -i=playlist.m3u -o=mychannels.dat)

Code: Select all

# channel list for transcode.py
# Enter one line for each channel like this:
# channel_name=uri videomode audiomode audiopid [vo]
# check the README for details 
TVP1 HD=http://192.168.0.111:9981/stream/channelid/784538894 hd2 mpeg 0x2dd
TVP2 HD=http://192.168.0.111:9981/stream/channelid/863487846 hd2 mpeg 0x2e5
TVP Info=http://192.168.0.111:9981/stream/channelid/680810323 hd2 mpeg 0x2c6
...
as mentioned here: https://tvheadend.org/boards/5/topics/28957 they are raw .ts streams.
Have you set up tvheadend to work with mumudvb (as mentioned in the link) or do you use it standalone?
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

kazuko.nakamura
Posts: 55
Joined: Sun May 29, 2016 7:14 am

Re: Real Time Transcoding of DVB TV Streams

Mon Oct 23, 2017 8:29 am

I was experiment with mumudvb to tvheadend and is working - tvheadend reseives playlist from mumudvb but only from one frequency (couple channels).

Now I'm using tvheadend standalone - I mean TV USB Stick is configured straight in tvheadend.

gkreidl
Posts: 5713
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Real Time Transcoding of DVB TV Streams

Mon Oct 23, 2017 9:03 am

kazuko.nakamura wrote:
Mon Oct 23, 2017 8:29 am
I was experiment with mumudvb to tvheadend and is working - tvheadend reseives playlist from mumudvb but only from one frequency (couple channels).

Now I'm using tvheadend standalone - I mean TV USB Stick is configured straight in tvheadend.
Thanks! I've added a note to the second OP pointing to your solution.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

kazuko.nakamura
Posts: 55
Joined: Sun May 29, 2016 7:14 am

Re: Real Time Transcoding of DVB TV Streams

Mon Oct 23, 2017 7:18 pm

After apply above changes in rc.local or in config.txt, problem still remain - stream stops playing.

I must precise - rtranscode still working on RPi2 but on other computer streams stops.

VLC reports:

Code: Select all

cannot pre fill buffer
mpv reports:

Code: Select all

Stream ends prematurely at [some numbers here], should be [some numbers here]
This is probably network problem, but I don't know. Is possible to fix this?

gkreidl
Posts: 5713
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Real Time Transcoding of DVB TV Streams

Wed Oct 25, 2017 2:23 pm

kazuko.nakamura wrote:
Mon Oct 23, 2017 7:18 pm
After apply above changes in rc.local or in config.txt, problem still remain - stream stops playing.

I must precise - rtranscode still working on RPi2 but on other computer streams stops.

VLC reports:

Code: Select all

cannot pre fill buffer
mpv reports:

Code: Select all

Stream ends prematurely at [some numbers here], should be [some numbers here]
This is probably network problem, but I don't know. Is possible to fix this?
It's hard to say without knowing any details.
Is tvheadend running on the same RPi as the transcoder? Can you access the original stream using localhost instead of the IP? Is your network connected via ethernet?

Try checking the system load with "top".

rtranscode in menu mode will not tell you if the stream has stopped. You have to check if http-launch is still running using
ps -A
or run rtranscode using
rtranscode -n="channel name"
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

kazuko.nakamura
Posts: 55
Joined: Sun May 29, 2016 7:14 am

Re: Real Time Transcoding of DVB TV Streams

Wed Oct 25, 2017 3:01 pm

1. Stream is received from raspberry (with tvheadend and rtranscode) which is connected via LAN (cable)
2. I was testing stream directly on raspberry but is the same situation - stream stops after 1-2 minutes.
3. When I run "top", http-launch disappeares from first position when stream stops.
4. Also when I just record stream with this example command:

Code: Select all

gst-launch-1.0 souphttpsrc location="HERE .TS STREAM FROM TVHEADEND" is-live=true keep-alive=true retries=10 typefind=true blocksize=16384 \
! tsdemux parse-private-sections=false name=demux \
! queue max-size-buffers=0 max-size-time=0 \
! ac3parse \
! matroskamux streamable=true name=stream \
! queue max-size-buffers=0 max-size-time=0 \
! filesink location=1.mkv demux. \
! queue max-size-buffers=0 max-size-time=0 \
! h264parse \
! omxh264dec \
! omxh264enc target-bitrate=900000 control-rate=variable \
! video/x-h264,stream-format=byte-stream,profile=high,width=576,height=324,framerate=25/1 \
! h264parse \
! stream.
All is fine. No stops, hangs etc. Can be recorded even hours. Above command don't have http-launch. So maybe is something with http-launch? You wrote in manual that is extended version of Sebastian Droege's http-launch.

gkreidl
Posts: 5713
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Real Time Transcoding of DVB TV Streams

Thu Oct 26, 2017 9:01 am

kazuko.nakamura wrote:
Wed Oct 25, 2017 3:01 pm
1. Stream is received from raspberry (with tvheadend and rtranscode) which is connected via LAN (cable)
2. I was testing stream directly on raspberry but is the same situation - stream stops after 1-2 minutes.
3. When I run "top", http-launch disappeares from first position when stream stops.
4. Also when I just record stream with this example command:

Code: Select all

gst-launch-1.0 souphttpsrc location="HERE .TS STREAM FROM TVHEADEND" is-live=true keep-alive=true retries=10 typefind=true blocksize=16384 \
! tsdemux parse-private-sections=false name=demux \
! queue max-size-buffers=0 max-size-time=0 \
! ac3parse \
! matroskamux streamable=true name=stream \
! queue max-size-buffers=0 max-size-time=0 \
! filesink location=1.mkv demux. \
! queue max-size-buffers=0 max-size-time=0 \
! h264parse \
! omxh264dec \
! omxh264enc target-bitrate=900000 control-rate=variable \
! video/x-h264,stream-format=byte-stream,profile=high,width=576,height=324,framerate=25/1 \
! h264parse \
! stream.
All is fine. No stops, hangs etc. Can be recorded even hours. Above command don't have http-launch. So maybe is something with http-launch? You wrote in manual that is extended version of Sebastian Droege's http-launch.
I tried your tool chain and it didn't save anything to the file. BTW, the height value must be dividable by 16.

http-launch seems to be very stable to me. It runs for about 20-30 hours per week on my system and often I have two streams running, one on my RPi 3, which also runs my Sat_TV-Server (based on mumudvb) and one on a RPi 2, managed by rtranscode, to run a second channel or to run the main channel with other options.

The changes to the original code are small. I've just added a path, the mimetype and silent mode. And by default the stream will start to serve immediately and not after the first client connects, which makes it easier to debug pipelines.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

kazuko.nakamura
Posts: 55
Joined: Sun May 29, 2016 7:14 am

Re: Real Time Transcoding of DVB TV Streams

Sun Oct 29, 2017 3:11 pm

I've seen strange thing - when commercial appears, stream always stops.
Also stream stops when commercial changing from one to another.

Return to “Graphics, sound and multimedia”

Who is online

Users browsing this forum: No registered users and 10 guests