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

Re: Real Time Transcoding of DVB TV Streams

Mon Oct 30, 2017 9:44 am

kazuko.nakamura wrote:
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.
I've seen this happen a few times, but regularly only on one channel. It may be caused by two things:

1) The encoding settings of the video stream change and the omx-decoder cannot handle it.

2) The channel sends a program change in the ts stream. I've seen this in my mumudvb logs and in some cases this stopped the transcoder.

You could try the following (not tested yet):
in config.py replace

Code: Select all

tsdemux parse-private-sections=false name=demux
by

Code: Select all

tsdemux parse-private-sections=false program-number=-1 name=demux
both in rt_av_template and rt_v_template
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 30, 2017 10:00 pm

Finnaly is working !!! (so far)

This post will be conclusion of my struggle with RPi2 transcoding .ts stream and "how-to"

Equipment I've got:
1. RPi2 with mpeg licenses in config.txt
2. Last Jessie release from: http://downloads.raspberrypi.org/raspbi ... 017-07-05/
3. USB DVB Stick: Geniatech T230c (0572:c689) with CrazyCat drivers compiled. All working on DVB-C.
4. HTS Tvheadend 4.3-556~g9339e92, installed from mpmc repo.
5. Rtranscode with configuration changes.

How to (All making on raspberry):

1. After installing fresh Jessie we need to compile drivers: https://www.linuxtv.org/wiki/index.php/Geniatech_T230C
Not all procedure is necessary from link above if you have last Jessie release. Of course your DVB Stick can have drivers build in Jessie, so this step isn't necessary.

Code: Select all

sudo apt-get install raspberrypi-kernel-headers

git clone https://bitbucket.org/CrazyCat/media_build
cd media_build
./build --main-git

Go to: media_build/v4l/Makefile and comment this lines:
#ifeq ($(makefile-mm),1)
#-include $(obj)/Makefile.mm
#endif

sudo make install

2. Modify config.txt
Add this lines at the end file:

Code: Select all

gpu_mem=128
gpu_freq=500
h264_freq=500

decode_MPG2=.............
decode_WVC1=.............

3. Install TVheadend

Code: Select all

sudo nano /etc/apt/sources.list

add this line:
deb https://dl.bintray.com/mpmc/deb raspbianjessie stable-4.2

sudo apt-get update

sudo apt-get install tvheadend

After installation login to tvheadend via web browser with login and password from installation and create new user in Configuration > Users. New user must have all privilages like admin. After this you can open tvheadend in web browser with no login prompt. This is important step to have correct links to .ts streams from playlist below.

4. Configure yours tvheadend to have working channels (muxes, epg etc.) and save on disk channels "playlist". Change "playlist" file to "playlist.m3u":

Code: Select all

http://RASPBERRY_IP:9981/playlist

5. Install rtranscode:

Code: Select all

sudo apt-get install gstreamer1.0-libav gstreamer1.0-omx gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools

wget http://steinerdatenbank.de/software/transcoder3.tar.gz
tar -xzf transcoder3.tar.gz
cd transcoder3
sudo ./install

6. Make channels.dat from playlist.m3u (saved from tvheadend):

Code: Select all

rtranscode -i=playlist.m3u -o=channels.dat
Rtranscode will make channels.dat from playlist.m3u. Copy channels.dat to: /usr/local/share/rtranscode (overwrite oryginal file in this directory).


7. Modify "channels.dat":
Remove all text from "question mark" to "pass" for every channel:

Before:

Code: Select all

http://RASPBERRY_IP:9981/stream/channelid/784538894?ticket=B3A93347F43F3D6BC0D51F3E4BA3B756846B430A&profile=pass
After:

Code: Select all

CHANNEL_NAME=http://RASPBERRY_IP:9981/stream/channelid/784538894 hd2 mpeg 0x2f8

8. Modify "config.py"
Go to /usr/local/share/rtranscode and edit config.py file.
Change lines rt_av_template and rt_v_template to this lines:

rt_av_template:

Code: Select all

rt_av_template = 'http-launch $port$ $path$ video/x-matroska $runmode$ $source$ ! tsdemux parse-private-sections=false program-number=-1 name=demux demux.audio$apid$ ! queue max-size-buffers=0 max-size-time=0 ! $audioparser$ ! $audiodecoder$ ! audioconvert dithering=0 ! audio/x-raw,channels=$channels$ ! $audioencoder$ bitrate=$abr$ ! matroskamux name=stream streamable=true demux. ! queue max-size-buffers=0 max-size-time=0 ! $videoparser$ ! $videodecoder$ ! omxh264enc target-bitrate=$vbr$ control-rate=variable ! video/x-h264,stream-format=byte-stream,profile=high,width=$width$,height=$height$,framerate=$framerate$/1 ! h264parse ! queue max-size-buffers=0 max-size-time=0 ! stream.'

rt_v_template:

Code: Select all

rt_v_template = 'http-launch $port$ $path$ video/x-matroska $runmode$ $source$ ! tsdemux parse-private-sections=false program-number=-1 name=demux demux.audio$apid$ ! queue max-size-buffers=0 max-size-time=0 ! $audioparser$ ! matroskamux name=stream streamable=true demux. ! queue max-size-buffers=0 max-size-time=0 ! $videoparser$ ! $videodecoder$ ! omxh264enc target-bitrate=$vbr$ control-rate=variable ! video/x-h264,stream-format=byte-stream,profile=high,width=$width$,height=$height$,framerate=$framerate$/1 ! h264parse ! queue max-size-buffers=0 max-size-time=0 ! stream.'

Couple words of explain for above. I'm using Polish DVB muxes and they have some strange issue with rtranscode when commercial appear in stream - rtranscode stop working and transcoded stream stops. Beside adding "program-number=-1" I also add different queue: "queue max-size-buffers=0 max-size-time=0". I don't know nothing about gstreamer and I've got no idea what new queue does, but all is finally working with no stream stops.

Rtranscode is VERY GOOD soft. It offers hardware transcoding with resize with minimal CPU performance. Currently the only such solution on RPi. Of cousre tvheadend also offers hardware transcoding, but is not working on RPi yet and probably it take some time to have this ability in tvheadend (ffmpeg etc.).

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

Re: Real Time Transcoding of DVB TV Streams

Mon Oct 30, 2017 10:24 pm

Thanks for the detailed report and I'm glad that it's now working for you. I'll test the queue settings
max-size-buffers=0 max-size-time=0
in my own pipelines and if it works with all configurations I'll add them in the next release.
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

marco.roman
Posts: 3
Joined: Wed Nov 08, 2017 1:28 am

Re: Real Time Transcoding of DVB TV Streams

Wed Nov 08, 2017 3:16 am

Hello
I recently found your amazing work. I've been trying to set this up so far unsuccessfully. No matter I use mumudvb or tvheadend as backend the issue for me is the same.

Code: Select all

[email protected]:~/transcoder3 $ omxplayer -i http://192.168.1.9:9981/stream/channelid/1229109989
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
Input #0, mpegts, from 'http://192.168.1.9:9981/stream/channelid/1229109989':
  Duration: N/A, start: 88450.096322, bitrate: N/A
  Program 1
  Program 2
    Stream #0:0[0x41]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, smpte170m), 704x480 [SAR 40:33 DAR 16:9], Closed Captions, 29.97 fps, 29  .97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x43](spa): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 128 kb/s
  Program 4
have a nice day ;)
[email protected]:~/transcoder3 $ rtranscode -g=http://192.168.1.9:9981/stream/channelid/1229109989
Unknown=http://192.168.1.9:9981/stream/channelid/1229109989
Could not find a valid MPEG TS stream
[email protected]:~/transcoder3 $
  
Seems like rtranscode cannot find the stream even omx player does. Even adding r=10 does not help.
In tvheadend for example the log show the channel opens and closes the same when using either the omx player or rtranscode.

Code: Select all

2017-11-07 21:05:18.298 mpegts: 569.028MHz in ATSC-T - tuning on Auvitek AU8522 QAM/8VSB Frontend : ATSC-T #0
2017-11-07 21:05:18.299 subscription: 0092: "HTTP" subscribing on channel "Enc SD TVUNAM", weight: 100, adapter: "Auvitek AU8522 QAM/8VSB Frontend : ATSC-T #0", network: "ATSC-T", mux: "569.028MHz", service: "Enc SD TVUNAM", profile="pass", hostname="192.168.1.9", client="Lavf/57.41.100"
2017-11-07 21:05:18.996 subscription: 0093: "HTTP" subscribing on channel "Enc SD TVUNAM", weight: 100, adapter: "Auvitek AU8522 QAM/8VSB Frontend : ATSC-T #0", network: "ATSC-T", mux: "569.028MHz", service: "Enc SD TVUNAM", profile="pass", hostname="192.168.1.9", client="Lavf/57.41.100"
2017-11-07 21:05:19.091 subscription: 0092: "HTTP" unsubscribing from "Enc SD TVUNAM", hostname="192.168.1.9", client="Lavf/57.41.100"
2017-11-07 21:05:26.350 subscription: 0093: "HTTP" unsubscribing from "Enc SD TVUNAM", hostname="192.168.1.9", client="Lavf/57.41.100"
2017-11-07 21:06:37.102 mpegts: 569.028MHz in ATSC-T - tuning on Auvitek AU8522 QAM/8VSB Frontend : ATSC-T #0
2017-11-07 21:06:37.102 subscription: 0094: "HTTP" subscribing on channel "Enc SD TVUNAM", weight: 100, adapter: "Auvitek AU8522 QAM/8VSB Frontend : ATSC-T #0", network: "ATSC-T", mux: "569.028MHz", service: "Enc SD TVUNAM", profile="pass", hostname="192.168.1.9", client="Lavf/57.41.100"
2017-11-07 21:06:37.641 subscription: 0095: "HTTP" subscribing on channel "Enc SD TVUNAM", weight: 100, adapter: "Auvitek AU8522 QAM/8VSB Frontend : ATSC-T #0", network: "ATSC-T", mux: "569.028MHz", service: "Enc SD TVUNAM", profile="pass", hostname="192.168.1.9", client="Lavf/57.41.100"
2017-11-07 21:06:37.760 subscription: 0094: "HTTP" unsubscribing from "Enc SD TVUNAM", hostname="192.168.1.9", client="Lavf/57.41.100"
2017-11-07 21:06:45.067 subscription: 0095: "HTTP" unsubscribing from "Enc SD TVUNAM", hostname="192.168.1.9", client="Lavf/57.41.100"
Anyone can give some suggestion on how I could troubleshoot this?
Thanks

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

Re: Real Time Transcoding of DVB TV Streams

Wed Nov 08, 2017 11:51 am

marco.roman wrote:
Wed Nov 08, 2017 3:16 am
Hello
I recently found your amazing work. I've been trying to set this up so far unsuccessfully. No matter I use mumudvb or tvheadend as backend the issue for me is the same.

Code: Select all

[email protected]:~/transcoder3 $ omxplayer -i http://192.168.1.9:9981/stream/channelid/1229109989
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
[mpeg2video @ 0xc79960] Invalid frame dimensions 0x0.
Input #0, mpegts, from 'http://192.168.1.9:9981/stream/channelid/1229109989':
  Duration: N/A, start: 88450.096322, bitrate: N/A
  Program 1
  Program 2
    Stream #0:0[0x41]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, smpte170m), 704x480 [SAR 40:33 DAR 16:9], Closed Captions, 29.97 fps, 29  .97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x43](spa): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 128 kb/s
  Program 4
have a nice day ;)
[email protected]:~/transcoder3 $ rtranscode -g=http://192.168.1.9:9981/stream/channelid/1229109989
Unknown=http://192.168.1.9:9981/stream/channelid/1229109989
Could not find a valid MPEG TS stream
[email protected]:~/transcoder3 $
  
Seems like rtranscode cannot find the stream even omx player does. Even adding r=10 does not help.
In tvheadend for example the log show the channel opens and closes the same when using either the omx player or rtranscode.

Code: Select all

2017-11-07 21:05:18.298 mpegts: 569.028MHz in ATSC-T - tuning on Auvitek AU8522 QAM/8VSB Frontend : ATSC-T #0
2017-11-07 21:05:18.299 subscription: 0092: "HTTP" subscribing on channel "Enc SD TVUNAM", weight: 100, adapter: "Auvitek AU8522 QAM/8VSB Frontend : ATSC-T #0", network: "ATSC-T", mux: "569.028MHz", service: "Enc SD TVUNAM", profile="pass", hostname="192.168.1.9", client="Lavf/57.41.100"
2017-11-07 21:05:18.996 subscription: 0093: "HTTP" subscribing on channel "Enc SD TVUNAM", weight: 100, adapter: "Auvitek AU8522 QAM/8VSB Frontend : ATSC-T #0", network: "ATSC-T", mux: "569.028MHz", service: "Enc SD TVUNAM", profile="pass", hostname="192.168.1.9", client="Lavf/57.41.100"
2017-11-07 21:05:19.091 subscription: 0092: "HTTP" unsubscribing from "Enc SD TVUNAM", hostname="192.168.1.9", client="Lavf/57.41.100"
2017-11-07 21:05:26.350 subscription: 0093: "HTTP" unsubscribing from "Enc SD TVUNAM", hostname="192.168.1.9", client="Lavf/57.41.100"
2017-11-07 21:06:37.102 mpegts: 569.028MHz in ATSC-T - tuning on Auvitek AU8522 QAM/8VSB Frontend : ATSC-T #0
2017-11-07 21:06:37.102 subscription: 0094: "HTTP" subscribing on channel "Enc SD TVUNAM", weight: 100, adapter: "Auvitek AU8522 QAM/8VSB Frontend : ATSC-T #0", network: "ATSC-T", mux: "569.028MHz", service: "Enc SD TVUNAM", profile="pass", hostname="192.168.1.9", client="Lavf/57.41.100"
2017-11-07 21:06:37.641 subscription: 0095: "HTTP" subscribing on channel "Enc SD TVUNAM", weight: 100, adapter: "Auvitek AU8522 QAM/8VSB Frontend : ATSC-T #0", network: "ATSC-T", mux: "569.028MHz", service: "Enc SD TVUNAM", profile="pass", hostname="192.168.1.9", client="Lavf/57.41.100"
2017-11-07 21:06:37.760 subscription: 0094: "HTTP" unsubscribing from "Enc SD TVUNAM", hostname="192.168.1.9", client="Lavf/57.41.100"
2017-11-07 21:06:45.067 subscription: 0095: "HTTP" unsubscribing from "Enc SD TVUNAM", hostname="192.168.1.9", client="Lavf/57.41.100"
Anyone can give some suggestion on how I could troubleshoot this?
Thanks
By default, rtranscode only supports typical European TV modes: sd1 (720x576i50, MPEG encoding), sd2 (720x576i50, h264 encoding), hd1 (720p50 , h264), hd2 (1080i50, h264).
The manual contains an example how you can add additional modes (in config.py) which in your case are needed.

I never got it to work with tvheadend, but kazuko.nakamura has published a tutorial above.
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

marco.roman
Posts: 3
Joined: Wed Nov 08, 2017 1:28 am

Re: Real Time Transcoding of DVB TV Streams

Thu Nov 09, 2017 11:48 pm

Hello Again! After testing with the updated config.py as suggested I get the stream recognized. However I found new issue:

Code: Select all

[email protected]:~ $ rtranscode -t=http://192.168.1.5:9981/stream/channelid/1527590534
Unknown=http://192.168.1.5:9981/stream/channelid/1527590534 hd3 ac3 0x33
Starting to transcode
Size: 768x432  VBR: 1.05M  ABR: 64K AC3
Listening on http://127.0.0.1:9080/xyz.mkv
Starting pipeline
Error Internal data stream error.
Is there any verbose mode or log I can check to see what is that the error is?

I got some debug from gstreamer:

Code: Select all

   [email protected]:~ $ http-launch --gst-debug-level=3 9080 /xyz.mkv video/x-matroska
efault souphttpsrc location="http://192.168.1.5:9981/stream/channelid/1527590534"
s-live=true keep-alive=true do-timestamp=true retries=1 typefind=true blocksize=16
84 ! tsdemux parse-private-sections=false name=demux demux.audio_0033 ! queue ! mp
gaudioparse ! mpg123audiodec ! audioconvert dithering=0 ! audio/x-raw,channels=2 !
avenc_aac compliance=-2 bitrate=65536 ! matroskamux name=stream streamable=true de
ux. ! queue ! mpegvideoparse ! omxmpeg2videodec ! omxh264enc target-bitrate=288000
control-rate=variable ! video/x-h264,stream-format=byte-stream,profile=high,width=
60,height=288,framerate=29.97/1 ! h264parse ! queue ! stream. 
Listening on http://127.0.0.1:9080/xyz.mkv
Starting pipeline
0:00:02.486526562 13189  0x1ece580 ERROR            omxvideodec gstomxvideodec.c:3
30:gst_omx_video_dec_negotiate:<omxmpeg2videodec-omxmpeg2videodec0> Empty caps
0:00:02.490379621 13189  0x1ece580 WARN                GST_PADS gstpad.c:3742:gst_
ad_peer_query:<omxmpeg2videodec-omxmpeg2videodec0:src> could not send sticky event
0:00:02.499105684 13189  0x1ece580 WARN                GST_PADS gstpad.c:3742:gst_
ad_peer_query:<omxmpeg2videodec-omxmpeg2videodec0:src> could not send sticky event
0:00:02.546861712 13189  0x1ece580 WARN             omxvideodec gstomxvideodec.c:2
86:gst_omx_video_dec_loop:<omxmpeg2videodec-omxmpeg2videodec0> error: Internal dat
 stream error.
0:00:02.547482387 13189  0x1ece580 WARN             omxvideodec gstomxvideodec.c:2
86:gst_omx_video_dec_loop:<omxmpeg2videodec-omxmpeg2videodec0> error: stream stopp
d, reason not-negotiated
Error Internal data stream error.
[email protected]:~ $
   

I added this in my config.py

Code: Select all

rt_sd_video_sizes = {'0':"120x96",'1':"180x144",'2':"240x192",'3':"360x288",'4':"480x384",'5':"600x480",'6':"720x576",'7':"720x480",'8':"704x480"}

rt_hd_video_sizes = {'0':"256x144",'1':"512x288",'2':"768x432",'3':"910x512",'4':"1024x576",'5':"1280x720",'6':"1920x1080"}

rt_audio_bitrates = {'0':("0","original"),'1':("32768","32K"),'2':("65536","64K"),'3':("98304","96K"),'4':("131072","128K"),
                  '5':("163840","160K"),'6':("196608","192K"),'7':("262144","256K"),'8':("327680","320K"),
                  '9':("393216","384K"),'10':("458752","448K"),'11':("524288","512K"),'12':("655360","640K")}

rt_sd_modes = {'sd1':{'videoparser':'mpegvideoparse','videodecoder':'omxmpeg2videodec','framerate':'25','check':['mpeg2video','720x576','25 fps']},
            'sd2':{'videoparser':'h264parse','videodecoder':'omxh264dec','framerate':'25','check':['h264','720x576','25 fps']},
            'sd3':{'videoparser':'mpegvideoparse','videodecoder':'omxmpeg2videodec','framerate':'29.97','check':['mpeg2video','720x480','29.97 fps']},
            'sd4':{'videoparser':'mpegvideoparse','videodecoder':'omxmpeg2videodec','framerate':'29.97','check':['mpeg2video','704x480','29.97 fps']}
            }

rt_hd_modes = {'hd1':{'videoparser':'h264parse','videodecoder':'omxh264dec','framerate':'50','check':['h264','50 fps']},
            'hd2':{'videoparser':'h264parse','videodecoder':'omxh264dec','framerate':'25','check':['h264','25 fps']},
            'hd3':{'videoparser':'mpegvideoparse','videodecoder':'omxmpeg2videodec','framerate':'29.97','check':['mpeg2video','1920x1080','29.97 fps']},
            'hd4':{'videoparser':'h264parse','videodecoder':'omxh264dec','framerate':'29.97','check':['h264','1920x1080','29.97 fps']}
            }



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

Re: Real Time Transcoding of DVB TV Streams

Fri Nov 10, 2017 8:31 am

marco.roman wrote:
Thu Nov 09, 2017 11:48 pm
Hello Again! After testing with the updated config.py as suggested I get the stream recognized. However I found new issue:

Code: Select all

[email protected]:~ $ rtranscode -t=http://192.168.1.5:9981/stream/channelid/1527590534
Unknown=http://192.168.1.5:9981/stream/channelid/1527590534 hd3 ac3 0x33
Starting to transcode
Size: 768x432  VBR: 1.05M  ABR: 64K AC3
Listening on http://127.0.0.1:9080/xyz.mkv
Starting pipeline
Error Internal data stream error.
Is there any verbose mode or log I can check to see what is that the error is?

I got some debug from gstreamer:

Code: Select all

   [email protected]:~ $ http-launch --gst-debug-level=3 9080 /xyz.mkv video/x-matroska
efault souphttpsrc location="http://192.168.1.5:9981/stream/channelid/1527590534"
s-live=true keep-alive=true do-timestamp=true retries=1 typefind=true blocksize=16
84 ! tsdemux parse-private-sections=false name=demux demux.audio_0033 ! queue ! mp
gaudioparse ! mpg123audiodec ! audioconvert dithering=0 ! audio/x-raw,channels=2 !
avenc_aac compliance=-2 bitrate=65536 ! matroskamux name=stream streamable=true de
ux. ! queue ! mpegvideoparse ! omxmpeg2videodec ! omxh264enc target-bitrate=288000
control-rate=variable ! video/x-h264,stream-format=byte-stream,profile=high,width=
60,height=288,framerate=29.97/1 ! h264parse ! queue ! stream. 
Listening on http://127.0.0.1:9080/xyz.mkv
Starting pipeline
0:00:02.486526562 13189  0x1ece580 ERROR            omxvideodec gstomxvideodec.c:3
30:gst_omx_video_dec_negotiate:<omxmpeg2videodec-omxmpeg2videodec0> Empty caps
0:00:02.490379621 13189  0x1ece580 WARN                GST_PADS gstpad.c:3742:gst_
ad_peer_query:<omxmpeg2videodec-omxmpeg2videodec0:src> could not send sticky event
0:00:02.499105684 13189  0x1ece580 WARN                GST_PADS gstpad.c:3742:gst_
ad_peer_query:<omxmpeg2videodec-omxmpeg2videodec0:src> could not send sticky event
0:00:02.546861712 13189  0x1ece580 WARN             omxvideodec gstomxvideodec.c:2
86:gst_omx_video_dec_loop:<omxmpeg2videodec-omxmpeg2videodec0> error: Internal dat
 stream error.
0:00:02.547482387 13189  0x1ece580 WARN             omxvideodec gstomxvideodec.c:2
86:gst_omx_video_dec_loop:<omxmpeg2videodec-omxmpeg2videodec0> error: stream stopp
d, reason not-negotiated
Error Internal data stream error.
[email protected]:~ $
   

I added this in my config.py

Code: Select all

rt_sd_video_sizes = {'0':"120x96",'1':"180x144",'2':"240x192",'3':"360x288",'4':"480x384",'5':"600x480",'6':"720x576",'7':"720x480",'8':"704x480"}

rt_hd_video_sizes = {'0':"256x144",'1':"512x288",'2':"768x432",'3':"910x512",'4':"1024x576",'5':"1280x720",'6':"1920x1080"}

rt_audio_bitrates = {'0':("0","original"),'1':("32768","32K"),'2':("65536","64K"),'3':("98304","96K"),'4':("131072","128K"),
                  '5':("163840","160K"),'6':("196608","192K"),'7':("262144","256K"),'8':("327680","320K"),
                  '9':("393216","384K"),'10':("458752","448K"),'11':("524288","512K"),'12':("655360","640K")}

rt_sd_modes = {'sd1':{'videoparser':'mpegvideoparse','videodecoder':'omxmpeg2videodec','framerate':'25','check':['mpeg2video','720x576','25 fps']},
            'sd2':{'videoparser':'h264parse','videodecoder':'omxh264dec','framerate':'25','check':['h264','720x576','25 fps']},
            'sd3':{'videoparser':'mpegvideoparse','videodecoder':'omxmpeg2videodec','framerate':'29.97','check':['mpeg2video','720x480','29.97 fps']},
            'sd4':{'videoparser':'mpegvideoparse','videodecoder':'omxmpeg2videodec','framerate':'29.97','check':['mpeg2video','704x480','29.97 fps']}
            }

rt_hd_modes = {'hd1':{'videoparser':'h264parse','videodecoder':'omxh264dec','framerate':'50','check':['h264','50 fps']},
            'hd2':{'videoparser':'h264parse','videodecoder':'omxh264dec','framerate':'25','check':['h264','25 fps']},
            'hd3':{'videoparser':'mpegvideoparse','videodecoder':'omxmpeg2videodec','framerate':'29.97','check':['mpeg2video','1920x1080','29.97 fps']},
            'hd4':{'videoparser':'h264parse','videodecoder':'omxh264dec','framerate':'29.97','check':['h264','1920x1080','29.97 fps']}
            }


Are you running Raspbian Stretch?

Edit: To get debug output you can run
export GST_DEBUG="*:1"
from the same terminal before running rtranscode. Higher numbers are also possible.
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

marco.roman
Posts: 3
Joined: Wed Nov 08, 2017 1:28 am

Re: Real Time Transcoding of DVB TV Streams

Fri Nov 10, 2017 10:21 pm

Hello!

Here my system info

Code: Select all

[email protected]:~ $ uname -a
Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux
[email protected]:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

samuralast
Posts: 2
Joined: Wed Sep 06, 2017 7:51 am

Re: Real Time Transcoding of DVB TV Streams

Mon Dec 04, 2017 3:45 pm

Gkreidl,

Can you update us about your WebServer project, so that it rtranscode can be fully integrated into a webpage?

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

Re: Real Time Transcoding of DVB TV Streams

Mon Dec 04, 2017 4:17 pm

samuralast wrote:
Mon Dec 04, 2017 3:45 pm
Gkreidl,

Can you update us about your WebServer project, so that it rtranscode can be fully integrated into a webpage?
Not yet, I was too busy updating things for Stretch.
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

booooob
Posts: 1
Joined: Tue Dec 05, 2017 11:26 am

Re: Real Time Transcoding of DVB TV Streams

Tue Dec 05, 2017 11:37 am

gkreidl wrote:
Mon Dec 04, 2017 4:17 pm
Not yet, I was too busy updating things for Stretch.
Have you been able now building working gstreamer for stretch which works with rtranscode?

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

Re: Real Time Transcoding of DVB TV Streams

Tue Dec 05, 2017 12:24 pm

booooob wrote:
Tue Dec 05, 2017 11:37 am
gkreidl wrote:
Mon Dec 04, 2017 4:17 pm
Not yet, I was too busy updating things for Stretch.
Have you been able now building working gstreamer for stretch which works with rtranscode?
No.
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 Dec 06, 2017 7:52 pm

Where can I find this WebServer project?

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

Re: Real Time Transcoding of DVB TV Streams

Wed Dec 06, 2017 10:06 pm

kazuko.nakamura wrote:
Wed Dec 06, 2017 7:52 pm
Where can I find this WebServer project?
Nowhere. It was planned for a future release of rtranscode.
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

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

Re: Real Time Transcoding of DVB TV Streams

Tue Dec 26, 2017 6:37 pm

Good News: I've just started work on rstranscode 4.0, which will run both on Jessie (Gstreamer 1.4.4 and gstreamer-omx 1.0) and Stretch (gstreamer 1.10.4 and the matching gstreamer-omx module). I have developed gstreamer pipelines which work on both systems, with very small modifications which will be created by the software according to the OS version.

New Stuff:
Optional deinterlacing of interlaced SD streams including doubling the framerate (good for sports channels).
720p50 sources now allow 720p50 output (with reduced bit rate) which wasn't possible before.
Simple repackaging mode without transcoding (useful for converting udp streams to http, e. g. for GNU-TV).

Bad news last: The current version of the omxh264 encoder of gstreamer-omx on Stretch crashes, if you set the target-bitrate (and or control-rate). It only works with the default bit rate which is really bad, especially for higher resolutions. But hopefully some ingenious developer will soon fix the bug.
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

gigo1988
Posts: 39
Joined: Wed Sep 07, 2016 11:38 pm

Re: Real Time Transcoding of DVB TV Streams

Tue Dec 26, 2017 9:24 pm

This news are very good. So is it only possible with interlaced SD or maybe 1080i too?

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

Re: Real Time Transcoding of DVB TV Streams

Tue Dec 26, 2017 10:39 pm

gigo1988 wrote:
Tue Dec 26, 2017 9:24 pm
This news are very good. So is it only possible with interlaced SD or maybe 1080i too?
It should also work with 1080i, but all 1080 streams I receive seem to be progressive, not interlaced.
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

gigo1988
Posts: 39
Joined: Wed Sep 07, 2016 11:38 pm

Re: Real Time Transcoding of DVB TV Streams

Wed Dec 27, 2017 11:12 am

By Transcoding i´ve seen not every content is progressive. For Example there is a Movie with Breaks mostly the Movies are progressive and a part of the Breaks are interlaced.

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

Re: Real Time Transcoding of DVB TV Streams

Thu Dec 28, 2017 12:09 pm

gkreidl wrote:
Tue Dec 26, 2017 6:37 pm
Good News: I've just started work on rstranscode 4.0, which will run both on Jessie (Gstreamer 1.4.4 and gstreamer-omx 1.0) and Stretch (gstreamer 1.10.4 and the matching gstreamer-omx module). I have developed gstreamer pipelines which work on both systems, with very small modifications which will be created by the software according to the OS version.
That's great news! I can't wait to see those new pipelines and try them out. I am especially looking forward to the support for deinterlacing, as I have access to quite a few interlaced sources. I hope it will be ready for release soon. Oh, and I hope you found some time to enjoy the holidays. ;)

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

Re: Real Time Transcoding of DVB TV Streams

Thu Dec 28, 2017 1:36 pm

skweee wrote:
Thu Dec 28, 2017 12:09 pm
gkreidl wrote:
Tue Dec 26, 2017 6:37 pm
Good News: I've just started work on rstranscode 4.0, which will run both on Jessie (Gstreamer 1.4.4 and gstreamer-omx 1.0) and Stretch (gstreamer 1.10.4 and the matching gstreamer-omx module). I have developed gstreamer pipelines which work on both systems, with very small modifications which will be created by the software according to the OS version.
That's great news! I can't wait to see those new pipelines and try them out. I am especially looking forward to the support for deinterlacing, as I have access to quite a few interlaced sources. I hope it will be ready for release soon. Oh, and I hope you found some time to enjoy the holidays. ;)
Thanks! I'm retired and always in holiday mode :-)

I'll start sending out the new version to a few beta testers soon. Watch this thread for my announcement.
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

gigo1988
Posts: 39
Joined: Wed Sep 07, 2016 11:38 pm

Re: Real Time Transcoding of DVB TV Streams

Thu Dec 28, 2017 2:12 pm

It sounds very great :D if it´s possible i want a beta too ;) i cant wait to test it on my 40 Pis :P

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

Re: Real Time Transcoding of DVB TV Streams

Thu Dec 28, 2017 4:18 pm

gigo1988 wrote:
Thu Dec 28, 2017 2:12 pm
It sounds very great :D if it´s possible i want a beta too ;) i cant wait to test it on my 40 Pis :P
Perhaps before the end of the year.
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

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

Re: Real Time Transcoding of DVB TV Streams

Sun Dec 31, 2017 1:18 pm

I'm ready to distribute a Transcoder 4.0 upgrade to a small number (5 - 10) of beta testers.

Condition: you must have been successfully using transcode 3.0 before. The upgrade requires a working version on your Jessie system. To get it working on Stretch you have to install Transcoder 3.0 first. The upgrade will simply replace rtranscode, create_kpages and the config.py file. You can continue to use your channel database(s).

Stretch is not recommended yet for real use, because of a bug in gstreamer-omx 1.10.4, which doesn't allow setting the video bitrate. But test reports on Stretch are welcome.

Send me either a mail or a PM with your email address, if you want to become a beta tester.

Changes in 4.0:

New pipelines that work on both Jessie (gtreamer-1.0 1.4.4 and gstreamer-omx 1.0) and Stretch (gstreamer-1.0 1.10.4 and gstreamer-omx 1.10.4). A third pipeline has been added, that does not transcode at all, but simply repackages the video and one selected audio stream without any change to an mkv streaming format. This can be used to convert udp streams to http streams, e. g. with GnuTV.

Support for deinterlacing, both single and double ( = doubling the frame rate) and using 3 different methods. On Jessie it can only be used for SD channels, on Stretch the deinterlacer has become much faster and the single methods can also be used for 1808i HD streams.

Optional high quality video scaler method. On Stretch the HQ method runs much slower and can only be used for SD and 720p50 HD streams, not for 1080i streams. On Jessie it also works with 1080i.

Deinterlacing and video scaler methods can be set with new command line options and with new sub-menus in menu mode. The kweb interface also has new option menus to set deinterlacing and scaling method.

NTSC support (both SD 480i streams and HD streams) and support for MPEG encoded HD streams. The different frame rate (25/50 or 30/60 Hz) doesn't matter any more.

A number of small details and a few bug fixes.
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

gigo1988
Posts: 39
Joined: Wed Sep 07, 2016 11:38 pm

Re: Real Time Transcoding of DVB TV Streams

Tue Jan 02, 2018 8:48 am

Everybody happy new year

The Beta looks very good. It starts to transcode very fast. The fixed bitrate by deinterlacing for stretch with 1080i content is not so good but ok. I hope that the bug will fixed in near future with omx.module for changeable bitrate.

gigo1988
Posts: 39
Joined: Wed Sep 07, 2016 11:38 pm

Re: Real Time Transcoding of DVB TV Streams

Thu Jan 04, 2018 1:54 am

Hi Gkreild,

i´ve 2 questions. First do you know how long does the modifikation take from OMX Modul Bug? Second is it possible to put something like a logo to the transcoded stream? Or a feature to do that in the future. I think it must be easy because it will already transcoded but it isnt a must habe feature but nice to have :D

Return to “Graphics, sound and multimedia”

Who is online

Users browsing this forum: No registered users and 14 guests