xses
Posts: 5
Joined: Thu Jan 26, 2017 8:20 am

Re: Real Time Transcoding of DVB TV Streams

Thu Jan 26, 2017 5:02 pm

Okay thats nice. Do I have to start and select the stream via ssh everytime?

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

Re: Real Time Transcoding of DVB TV Streams

Thu Jan 26, 2017 5:07 pm

xses wrote:Okay thats nice. Do I have to start and select the stream via ssh everytime?
Yes.
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

xses
Posts: 5
Joined: Thu Jan 26, 2017 8:20 am

Re: Real Time Transcoding of DVB TV Streams

Sat Jan 28, 2017 4:26 pm

I think I messed up something?

Code: Select all

Starting to transcode
Traceback (most recent call last):
  File "transcode.py", line 470, in <module>
    read_dat()
  File "transcode.py", line 426, in read_dat
    menu(configs)
  File "transcode.py", line 392, in menu
    start_transcoder(config[sel][1])
  File "transcode.py", line 158, in start_transcoder
    os.execvp('/usr/local/bin/http-launch',scargs)
  File "/usr/lib/python2.7/os.py", line 346, in execvp
    _execvpe(file, args)
  File "/usr/lib/python2.7/os.py", line 370, in _execvpe
    func(file, *argrest)
OSError: [Errno 13] Permission denied

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

Re: Real Time Transcoding of DVB TV Streams

Sat Jan 28, 2017 4:36 pm

xses wrote:I think I messed up something?

Code: Select all

Starting to transcode
Traceback (most recent call last):
  File "transcode.py", line 470, in <module>
    read_dat()
  File "transcode.py", line 426, in read_dat
    menu(configs)
  File "transcode.py", line 392, in menu
    start_transcoder(config[sel][1])
  File "transcode.py", line 158, in start_transcoder
    os.execvp('/usr/local/bin/http-launch',scargs)
  File "/usr/lib/python2.7/os.py", line 346, in execvp
    _execvpe(file, args)
  File "/usr/lib/python2.7/os.py", line 370, in _execvpe
    func(file, *argrest)
OSError: [Errno 13] Permission denied
Check the permissions of http-launch (in /usr/local/bin).
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

Menion
Posts: 17
Joined: Mon Feb 22, 2016 6:52 pm

Re: Real Time Transcoding of DVB TV Streams

Thu Feb 02, 2017 3:50 pm

Hi all
I'm trying to run the transcoding
When I connect a client, in this case VLC to the running session, I get this error:

Code: Select all

transcode.py http://menion:[email protected]:9981/stream/channelnumber/7?profile=pass sd1 mpeg 971

Starting to transcode
Listening on http://127.0.0.1:9080/xyz.mkv
New connection 10.8.0.6:36988
Starting to stream to 10.8.0.6:36988
Starting pipeline
Warning Delayed linking failed.
Error Internal data stream error.
Removing connection 10.8.0.6:36988
The DVB-T server is TVHeadend, I stream the pass profile which outputs MPEG-TS. The audio PID is the correct one, according to the channel info. I think the problem is with the audio pickup, because if I try to run gst-launch-1.0 session for a similar task I get this error:

Code: Select all

New clock: GstSystemClock
WARNING: from element /GstPipeline:pipeline0/GstTSDemux:demux: Delayed linking failed.
Additional debug info:
./grammar.y(506): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstTSDemux:demux:
failed delayed linking pad  audio_0655 of GstTSDemux named demux to some pad of GstQueue named queue1
**
Still the audio pid is the correct one (this is another channel, I have tried both hex and dec value).
What can be the problem here?
Bye

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

Re: Real Time Transcoding of DVB TV Streams

Thu Feb 02, 2017 6:21 pm

Menion wrote:Hi all
I'm trying to run the transcoding
When I connect a client, in this case VLC to the running session, I get this error:

Code: Select all

transcode.py http://menion:[email protected]:9981/stream/channelnumber/7?profile=pass sd1 mpeg 971

Starting to transcode
Listening on http://127.0.0.1:9080/xyz.mkv
New connection 10.8.0.6:36988
Starting to stream to 10.8.0.6:36988
Starting pipeline
Warning Delayed linking failed.
Error Internal data stream error.
Removing connection 10.8.0.6:36988
The DVB-T server is TVHeadend, I stream the pass profile which outputs MPEG-TS. The audio PID is the correct one, according to the channel info. I think the problem is with the audio pickup, because if I try to run gst-launch-1.0 session for a similar task I get this error:

Code: Select all

New clock: GstSystemClock
WARNING: from element /GstPipeline:pipeline0/GstTSDemux:demux: Delayed linking failed.
Additional debug info:
./grammar.y(506): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstTSDemux:demux:
failed delayed linking pad  audio_0655 of GstTSDemux named demux to some pad of GstQueue named queue1
**
Still the audio pid is the correct one (this is another channel, I have tried both hex and dec value).
What can be the problem here?
Bye
Can you run:

Code: Select all

omxplayer -i http://menion:[email protected]:9981/stream/channelnumber/7?profile=pass
and post the output here? (not the error messages at the start, just all the stream info at the end)
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

Menion
Posts: 17
Joined: Mon Feb 22, 2016 6:52 pm

Re: Real Time Transcoding of DVB TV Streams

Thu Feb 02, 2017 8:27 pm

Code: Select all

[email protected]:~ $ omxplayer -i http://menion:[email protected]:9981/stream/channelnumber/7?profile=pass
[mpeg2video @ 0x419680] Invalid frame dimensions 0x0.
[mpeg2video @ 0x419680] Invalid frame dimensions 0x0.
[mpeg2video @ 0x419680] Invalid frame dimensions 0x0.
[mpeg2video @ 0x419680] Invalid frame dimensions 0x0.
[mpeg2video @ 0x419680] Invalid frame dimensions 0x0.
Input #0, mpegts, from 'http://menion:[email protected]:9981/stream/channelnumber/7?profile=pass':
  Duration: N/A, start: 44726.150189, bitrate: N/A
  Program 711
    Metadata:
      service_name    : LA7
      service_provider:
    Stream #0:0[0x3ca]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x3cb](ita): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s
have a nice day ;)

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

Re: Real Time Transcoding of DVB TV Streams

Thu Feb 02, 2017 8:31 pm

Hi,

First question Do you have a MPEG 2 License?

Second, Do you know that dvb-t in Germany will be close in the next time. İ think few months.

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

Re: Real Time Transcoding of DVB TV Streams

Thu Feb 02, 2017 10:37 pm

Menion wrote:

Code: Select all

[email protected]:~ $ omxplayer -i http://menion:[email protected]:9981/stream/channelnumber/7?profile=pass
[mpeg2video @ 0x419680] Invalid frame dimensions 0x0.
[mpeg2video @ 0x419680] Invalid frame dimensions 0x0.
[mpeg2video @ 0x419680] Invalid frame dimensions 0x0.
[mpeg2video @ 0x419680] Invalid frame dimensions 0x0.
[mpeg2video @ 0x419680] Invalid frame dimensions 0x0.
Input #0, mpegts, from 'http://menion:[email protected]:9981/stream/channelnumber/7?profile=pass':
  Duration: N/A, start: 44726.150189, bitrate: N/A
  Program 711
    Metadata:
      service_name    : LA7
      service_provider:
    Stream #0:0[0x3ca]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x3cb](ita): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s
have a nice day ;)
Looks OK. Maybe there was a problem with linking to the stream (see the error message above), which may mean that tuning tool too long.
Try the following: Connect to the stream directly with a player and if it is running start the transcoder again.
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: 5732
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Real Time Transcoding of DVB TV Streams

Thu Feb 02, 2017 10:39 pm

gigo1988 wrote:Hi,

First question Do you have a MPEG 2 License?

Second, Do you know that dvb-t in Germany will be close in the next time. İ think few months.
This may very well be a SD satellite stream.

DVB-T in Germay will not be closed, but will switch to DVB-T2 and will send in full HD using H265 encoding which cannot used on the RPi.
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: 5732
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Real Time Transcoding of DVB TV Streams

Thu Feb 02, 2017 11:26 pm

I'm preparing version 3 of the transcoder package. Most important changes are:

In menu mode (started without an argument, using a database of channels), http-launch is started in the background and a new menu page is shown while streaming with some details and you can stop or restart the stream. Restarting is important if it doesn't run first time, which sometimes happens with 1080i streams or if the server's response is too late. If you stop the stream you return to the main menu.

New bitrate options have been added, including three auto-modes (low, medium, high) which calculate the bitrate from the image size and frame rate.

There are also more audio bitrate settings, including an "original" mode (no audio transcoding) without using the 'vo' option in the database.

I could fix the memory leak when transcoding AC3 streams by using another AC3 decoder.

Transcoded audio output is now either AAC or AC3, depending on the input format. A special setting allows to transcode MP2 to AC3 instead of AAC. 6 channel output of transcoded AC3 streams is now also possible. And for the smallest audio bitrate, 32K, the output is automatically set to mono.

And last but not least I'm preparing a web interface to control the transcoder, which will be available as an additional package.

I'm looking for a few beta testers (up to 4), who can test the new version, especially with other servers like tvheadend or DVR (I'm using mumudvb myself). Send me a PM if you are interested.
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

doroftei
Posts: 1
Joined: Mon Feb 06, 2017 9:17 am

Re: Real Time Transcoding of DVB TV Streams

Mon Feb 06, 2017 9:36 am

Hi gkreidl,

I tried sending you a PM but I cannot find the option. I would like to be a tester and also i can provide a Tvheadend server for your tests if you want to.

Dorin

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

Re: Real Time Transcoding of DVB TV Streams

Mon Feb 06, 2017 10:46 am

doroftei wrote:Hi gkreidl,

I tried sending you a PM but I cannot find the option. I would like to be a tester and also i can provide a Tvheadend server for your tests if you want to.

Dorin
I've sent you a PM.
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

Mon Feb 06, 2017 12:01 pm

Hi gkreidl.

Could you send it to me too?

Menion
Posts: 17
Joined: Mon Feb 22, 2016 6:52 pm

Re: Real Time Transcoding of DVB TV Streams

Sun Feb 26, 2017 9:42 am

Hi
I'm still trying to setup a working gst-launch script that can be used by http-launch or software that can open a pipeline (like TVHeadend)
I have managed to setup a script that can transcode perfectly into a file:
gst-launch-1.0 souphttpsrc location="http://xxxx:[email protected]:9981/stream ... ofile=pass" num-buffers=-1 ! tsdemux name=demux demux. ! queue ! mpegvideoparse ! omxmpeg2videodec ! video/x-raw,format=I420 ! 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 ! mux. mpegtsmux name=mux ! filesink location=robert.mp4 demux. ! queue ! mpegaudioparse ! mpg123audiodec ! audioconvert dithering=0 ! audio/x-raw,channels=2 ! fdkaacenc bitrate=65536 ! mux.
But the most loginc equivalent for stream muxer is not working:
http-launch 9080 /xyz.ts gst-launch-1.0 souphttpsrc location="http://xxxx:[email protected]:9981/stream/ ... ofile=pass" num-buffers=-1 ! tsdemux name=demux demux. ! queue ! mpegvideoparse ! omxmpeg2videodec ! video/x-raw,format=I420 ! 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. ! queue ! mpegaudioparse ! mpg123audiodec ! audioconvert dithering=0 ! audio/x-raw,channels=2 ! fdkaacenc bitrate=65536 ! stream.
With http-launch I just see that, when starting a playback, the connection is made, but no video is played (I'm using VLC), and after few seconds the connection is closed. Any hint?

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

Re: Real Time Transcoding of DVB TV Streams

Sun Feb 26, 2017 12:36 pm

I have been trying to get the new transcoder version 3 working with tvheadend for about 4 days without success. I've tried different tvheadend versions, but using it is such a pain, documentation is bad and completely outdated and it was always interfering with my own DVB software and so I finally gave up and removed the whole crap from my system.

I think the problem is the way tvheadend registers connecting clients (but I'm really astonished that you got it to work with gst-launch-1.0), I've seen a lots of cookie synflood warnings in the messages log.

I've just finished the manual for transcoder 3 and it clearly states: it doesn't work with tvheadend.

Perhaps someone with more experience in using tvheadend will get it to work some day. It's possible to modify a lot using the config.py file, but I gave up for now.
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

Menion
Posts: 17
Joined: Mon Feb 22, 2016 6:52 pm

Re: Real Time Transcoding of DVB TV Streams

Sun Feb 26, 2017 12:41 pm

Hi
I was about to reply then I got your post. Actually I made it.
The funny thing is that I had to add the streamable=true option in mpegtsmux, but gstreamer says that it's an unsupported property....

http-launch 9080 /xyz.ts verbose gst-launch-1.0 souphttpsrc location="http://xxxx:[email protected]:9981/stream/ ... file=mpeg2" num-buffers=-1 ! tsdemux name=demux demux. ! queue ! mpegvideoparse ! omxmpeg2videodec ! video/x-raw,format=I420 ! 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. ! queue ! mpegaudioparse ! mpg123audiodec ! audioconvert dithering=0 ! audio/x-raw,channels=2 ! fdkaacenc bitrate=65536 ! stream.

mpeg2 is a tvheadend profile that just rewrite the ts with the "side effect" to remote all the extra audio track and rewrite pids in a standard numbering. I have to check if it works also with pass(through) profile

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

Re: Real Time Transcoding of DVB TV Streams

Sun Feb 26, 2017 1:05 pm

Menion wrote:Hi
I was about to reply then I got your post. Actually I made it.
The funny thing is that I had to add the streamable=true option in mpegtsmux, but gstreamer says that it's an unsupported property....

http-launch 9080 /xyz.ts verbose gst-launch-1.0 souphttpsrc location="http://xxxx:[email protected]:9981/stream/ ... file=mpeg2" num-buffers=-1 ! tsdemux name=demux demux. ! queue ! mpegvideoparse ! omxmpeg2videodec ! video/x-raw,format=I420 ! 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. ! queue ! mpegaudioparse ! mpg123audiodec ! audioconvert dithering=0 ! audio/x-raw,channels=2 ! fdkaacenc bitrate=65536 ! stream.

mpeg2 is a tvheadend profile that just rewrite the ts with the "side effect" to remote all the extra audio track and rewrite pids in a standard numbering. I have to check if it works also with pass(through) profile
gst-launch-1.0 inside a http-launch pipeline?
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

Menion
Posts: 17
Joined: Mon Feb 22, 2016 6:52 pm

Re: Real Time Transcoding of DVB TV Streams

Sun Feb 26, 2017 1:07 pm

I didn't get the question, sorry

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

Re: Real Time Transcoding of DVB TV Streams

Sun Feb 26, 2017 1:16 pm

Menion wrote:I didn't get the question, sorry
http-launch 9080 /xyz.ts verbose gst-launch-1.0 souphttpsrc ....
and where is the mime type?
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

Menion
Posts: 17
Joined: Mon Feb 22, 2016 6:52 pm

Re: Real Time Transcoding of DVB TV Streams

Sun Feb 26, 2017 1:19 pm

Well, but what do you want to do with http-launch and tvheadend if not this? :)
The goal here is to use gst-launch to transcode in H264 an http stream from tvheadend, into a pipeline that http-launch stream into another http stream, containing the transcoded ts file

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

Re: Real Time Transcoding of DVB TV Streams

Sun Feb 26, 2017 6:50 pm

Menion wrote:Well, but what do you want to do with http-launch and tvheadend if not this? :)
The goal here is to use gst-launch to transcode in H264 an http stream from tvheadend, into a pipeline that http-launch stream into another http stream, containing the transcoded ts file
There are other DVB programs. I use it with mumudvb and know from other users that it also works with VDR. It should also work with VLC (if you use it for reception and streaming to http). The new version contains (experimental) udp support and might work with streaming boxes like HDHOMERUN.

If somebody gets it to work with tvheadend, fine. But I won't spend any more time trying it.
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: 5732
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Version 3.0 is now avilable

Thu Mar 02, 2017 10:29 am

New in version 3.0

Improved gstreamer pipelines
Support for dynamic video bit rate (low, medium, high quality)
Support for udp streams
Analyse function for streams to find arguments
Analyse and transcode from URI
Create channel database from text file (e. g. m3u playlist)
Supports grouping in large channel database files
Recording of transcoded streams
More command line options
Tool to create a local web interface (requires kweb)
Extensive manual in PDF format

Download and installation: viewtopic.php?f=38&t=123876&p=835947#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

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

Re: Real Time Transcoding of DVB TV Streams

Thu Mar 16, 2017 2:30 am

Hi gkreidl.
What about The deinterlace? Is it now possible? It ll be great.

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

Re: Real Time Transcoding of DVB TV Streams

Thu Mar 16, 2017 8:55 am

gigo1988 wrote:Hi gkreidl.
What about The deinterlace? Is it now possible? It ll be great.
No change. I think it should be done on the GPU but this is not supported by the gstreamer-omx plugin.
The only interlace artifacts I have seen so far were on some sport channels.
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

Return to “Graphics, sound and multimedia”