SageTV Community  

Go Back   SageTV Community > Hardware Support > Hardware Support

Notices

Hardware Support Discussions related to using various hardware setups with SageTV products. Anything relating to capture cards, remotes, infrared receivers/transmitters, system compatibility or other hardware related problems or suggestions should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-30-2016, 03:29 PM
EnterNoEscape's Avatar
EnterNoEscape EnterNoEscape is offline
SageTVaholic
 
Join Date: Jun 2010
Location: Harrisburg, PA
Posts: 2,657
Using the OpenDCT Generic HTTP Capture Device

You must have OpenDCT 0.5.3 or greater installed for this feature to be available.
You must have OpenDCT 0.5.17 or greater installed for %c% to be allowed in the URL and the ability to provide a username and password.
You must have OpenDCT 0.5.20 or greater installed for URL's to be allowed in place of an executable for tuning.

Configuration:
  1. Stop OpenDCT service.
  2. Open opendct.properties. (Windows: C:\ProgramData\OpenDCT\config\opendct.properties, Linux: /etc/opendct/conf/opendct.properties)
  3. Create names for each encoder under the property generic.http.device_names_csv in opendct.properties separated by commas.
    The names can really be anything, just don't use commas in the names for what should be obvious reasons or use names of other existing capture devices.
    e.g. generic.http.device_names_csv=Encoder 1,Encoder 2
  4. Save.
  5. Start the OpenDCT service.
  6. Wait about 30 seconds, then stop the OpenDCT service.
  7. Open opendct.properties. (Windows: C:\ProgramData\OpenDCT\config\opendct.properties, Linux: /etc/opendct/conf/opendct.properties)
  8. There should be new entries with the value of sagetv.device.<unique_id>.device_name matching the name(s) you created earlier.
  9. Set the URL to stream from:
    Code:
    sagetv.device.<unique_id>.streaming_url=http://<encoder_ip_address>/hdmi
    or
    Code:
    sagetv.device.<unique_id>.streaming_url=http://<encoder_ip_address>/0.ts
    or
    Code:
    sagetv.device.<unique_id>.streaming_url=http://<ip_address>/channels/%c%.ts
  10. Set the executable to be used to tune in the channel (this is optional, you can also tune using any of the available tuning plugins in SageTV v9):
    Code:
    sagetv.device.<unique_id>.tuning_executable=http://<wmc_ip_address>:40510/tune%20%c%
    or
    Code:
    sagetv.device.<unique_id>.tuning_executable=/path/to/tuning/script --device=0 --tune=%c%
  11. Set the executable to be used to stop playback (this is optional):
    Code:
    sagetv.device.<unique_id>.stopping_executable=http://<wmc_ip_address>:40510/stop
    or
    Code:
    sagetv.device.<unique_id>.tuning_executable=/path/to/tuning/script --device=0 --stop
  12. Repeat the last three steps for each device.
  13. Save.
  14. Start OpenDCT service.

HDMI Encoders (BM1000, BM3000, etc.):
You can find the URL needed for streaming on the web interface of the device. These devices are typically assigned the IP address 192.168.1.168 by default. I recommend changing the IP address. It is also possible to configure a substream (or secondary stream) on these devices which can be configured with a different resolution and frame rate if desired.

It is recommend to also use the raw consumer with these devices since they already produce a very clean stream and generally do not benefit from being cleaned up by FFmpeg. To do this, you will need to change sagetv.device.<unique_id>.consumer=<default_consumer> to sagetv.device.<unique_id>.consumer=opendct.consumer.RawSageTVConsumerImpl.

Streaming Issues:
If the streaming URL provided is not an MPEG-TS container, you will need to change sagetv.device.<unique_id>.consumer=<default_consumer> to sagetv.device.<unique_id>.consumer=opendct.consumer.RawSageTVConsumerImpl. Without making this change it is very likely that best case nothing is streamed and worst case OpenDCT crashes. You may also need to change sagetv.device.<unique_id>.fast_network_encoder_switch=true to false and the corresponding value in Sage.properties, mmc/encoders/<unique_id>/fast_network_encoder_switch=true to false because seamless switching might not be reliable with unknown formats.

Tuning Executables:
Setting tuning a executable is optional. In SageTV v9 you can also configure tuning using any tuning plugins that are available to SageTV.

There are two different opportunities to tune in the channel if you are providing an executable for tuning. You can tune in the channel before OpenDCT connects to the URL or you can tune in the channel while OpenDCT connects to the URL. The former is done by setting the property sagetv.device.<unique_id>.pretuning_executable and the latter is done by setting the property sagetv.device.<unique_id>.tuning_executable. Both properties will replace any occurrence of %c% with the desired channel number as provided by SageTV.

If the executable set for tuning_executable returns the exit code 12000, OpenDCT will drop any data it has buffered from connecting to the URL. This can be useful for example if your executable is able to detect resolution changes so that you can drop the data at the beginning that would otherwise be a different resolution from the rest of the recording. Note that OpenDCT will not start streaming to SageTV until this executable returns. You can also define both if desired. e.g.
Code:
sagetv.device.<unique_id>.pretuning_executable=/path/to/tuning/script --device=0 --pretune=%c%
sagetv.device.<unique_id>.tuning_executable=/path/to/tuning/script --device=0 --tune=%c%
Stopping Executable:
Setting a stopping executable is optional. The property is sagetv.device.<unique_id>.stopping_executable. This executable will run when SageTV sends the command to stop streaming. As of 0.5.6, this also has a configurable delay that defaults to 15000 milliseconds. The delay is defined by the property sagetv.device.<unique_id>.stopping_executable_delay_ms. If another channel tuning starts before this delay is reached, the stop command is never executed. This delay can be helpful since sometimes there's a measurable amount of time involved in starting things back up from whatever state the stop executable might put the device into. Note that streaming stops immediately regardless of this value, this only affects the timing of the executable. e.g.
Code:
sagetv.device.<unique_id>.stopping_executable=/path/to/tuning/script --device=0 --stop
sagetv.device.<unique_id>.stopping_executable_delay_ms=15000
Delay After Tuning:
If you set the property sagetv.device.<unique_id>.tuning_delay_ms=0 to a value greater than 0, it will wait the specified number of milliseconds before returning to SageTV after running tuning_executable and clearing the buffer if exit code 12000 was returned. If tuning_executable was not set, this delay will still happen.

Channel Padding:
If you would like to ensure that a minimum number of digits are always passed to your tuning script through the %c% variable, you need to change the property sagetv.device.<unique_id>.channel_padding=0 to a value greater than 0. Values shorter than this length will have zeros (0) appended to the left of the channel to make up the difference. (e.g. 8 becomes 008 and 503 remains 503 if this is set to 3.)

Substream Support:
If you would like to be able to select a different stream based on the channel being using tuned, you can do this using the sagetv.device.<unique_id>.streaming_url2 property in conjunction with sagetv.device.<unique_id>.streaming_url2_channels. You just need to set streaming_url2 to an alternate valid URL and then provide a comma separated list of channels that are to always use this alternative URL for the streaming_url2_channels property. e.g.
Code:
sagetv.device.<unique_id>.streaming_url2=http://<encoder_ip_address>/1.ts
sagetv.device.<unique_id>.streaming_url2_channels=20,22,23
One reason you might want to do this is so that you can have different resolutions and frame rates for different channels. e.g. 1080i30 encoded as 1080p60, 720p60 and below encoded as 720p60.

Channel Detection:
If you already have some specific channels in mind that you would like this capture device to return to SageTV as tunable, you can populate them in the sagetv.device.<unique_id>.custom_channels= property. The list is semicolon delimited. This can also be useful to create custom channels within SageTV. e.g. To return the channels 2000, 2002 and 2003 when doing a channel scan within SageTV, set the property as follows:
Code:
sagetv.device.<unique_id>.custom_channels=2000;2002;2003
Username and Password:
You can have OpenDCT perform basic HTTP authentication by providing a username and password. The associated properties are sagetv.device.<unique_id>.http_username and sagetv.device.<unique_id>.http_password. If both of these properties are set, the provided username and password will be encoded and sent to the provided URL for authentication. e.g.
Code:
sagetv.device.<unique_id>.http_username=User
sagetv.device.<unique_id>.http_password=MyPassword0
__________________
SageTV v9 Server: ASRock Z97 Extreme4, Intel i7-4790K @ 4.4Ghz, 32GB RAM, 6x 3TB 7200rpm HD, 2x 5TB 7200rpm HD, 2x 6TB 7200rpm HD, 4x 256GB SSD, 4x 500GB SSD, unRAID Pro 6.7.2 (Dual Parity + SSD Cache).
Capture: 1x Ceton InfiniTV 4 (ClearQAM), 2x Ceton InfiniTV 6, 1x BM1000-HDMI, 1x BM3500-HDMI.

Clients: 1x HD300 (Living Room), 1x HD200 (Master Bedroom).
Software: OpenDCT :: WMC Live TV Tuner :: Schedules Direct EPG

Last edited by EnterNoEscape; 01-04-2017 at 03:14 PM.
Reply With Quote
  #2  
Old 09-01-2017, 09:35 AM
hvymetal hvymetal is offline
Sage Advanced User
 
Join Date: Nov 2007
Posts: 157
I'm using stuckless-sagetv-server-java8 and crazifuzzy-opendct docker from UNRAID. I'm trying to get an HTTP stream from OctoPrint working. OctoPrint uses M-JPEG streamer.

For some reason the stream will never start. I am able to get HDHR stream working so I know crazifuzzy-opendct docker is working.

The Stream address as follows:
http://192.168.10.105/webcam/?action=stream
Below is what I have in my opendct.properties file:
sagetv.device.1076630941.channel_padding=0
sagetv.device.1076630941.consumer=opendct.consumer.DynamicConsumerImpl
sagetv.device.1076630941.custom_channels=
sagetv.device.1076630941.delay_to_wait_after_tuning=0
sagetv.device.1076630941.device_name=OCTO_PRINT
sagetv.device.1076630941.encoder_listen_port=9000
sagetv.device.1076630941.encoder_merit=0
sagetv.device.1076630941.encoder_pool=generic_http
sagetv.device.1076630941.exclusive_server_address=
sagetv.device.1076630941.fast_network_encoder_switch=true
sagetv.device.1076630941.http_password=
sagetv.device.1076630941.http_username=
sagetv.device.1076630941.last_channel=-1
sagetv.device.1076630941.pretuning_executable=
sagetv.device.1076630941.stopping_executable=
sagetv.device.1076630941.stopping_executable_delay_ms=15000
sagetv.device.1076630941.streaming_url=http\://192.168.10.105/webcam/?action\=stream
sagetv.device.1076630941.streaming_url2=
sagetv.device.1076630941.streaming_url2_channels=
sagetv.device.1076630941.transcode_profile=
sagetv.device.1076630941.tuning_delay_ms=0
sagetv.device.1076630941.tuning_executable=
Here is the result from the log when trying to tune:
10:20:58.760 [SageTVRequestHandler-107:Unknown] DEBUG SageTVManager - The requested capture device ' OCTO_PRINT HDMI' did not exist. Triggering re-discovery.
10:20:58.760 [SageTVRequestHandler-59:OCTO_PRINT HDMI] DEBUG SageTVManager - The requested capture device ' OCTO_PRINT HDMI' did not exist. Triggering re-discovery.
10:20:58.760 [SageTVRequestHandler-107:Unknown] ERROR SageTVRequestHandler - SageTV sent: 'BUFFER OCTO_PRINT HDMI|1035039015|1|16777216|/var/media/tv/OCTOPRINTon192168101759000HDMI-0.mpgbuf|Great-H.264', Replied: 'ERROR Invalid Input'
10:20:58.760 [SageTVRequestHandler-59:OCTO_PRINT HDMI] ERROR SageTVRequestHandler - SageTV sent: 'BUFFER OCTO_PRINT HDMI|1035039015|1|16777216|/var/media/tv/OCTOPRINTon192168101759000HDMI-0.mpgbuf|Great-H.264', Replied: 'ERROR Invalid Input'
10:20:58.761 [SageTVRequestHandler-107:Unknown] ERROR SageTVRequestHandler - Encoder device does not exist.
10:20:58.761 [SageTVRequestHandler-59:OCTO_PRINT HDMI] ERROR SageTVRequestHandler - Encoder device does not exist.

Any ideas what I'm doing wrong? Also I noticed that crazifuzzy-opendct docker does not map any default ports. I mapped 9000 are there any other port mappings required?

Last edited by hvymetal; 09-01-2017 at 09:46 AM.
Reply With Quote
  #3  
Old 09-01-2017, 04:57 PM
EnterNoEscape's Avatar
EnterNoEscape EnterNoEscape is offline
SageTVaholic
 
Join Date: Jun 2010
Location: Harrisburg, PA
Posts: 2,657
Quote:
Originally Posted by hvymetal View Post
I'm using stuckless-sagetv-server-java8 and crazifuzzy-opendct docker from UNRAID. I'm trying to get an HTTP stream from OctoPrint working. OctoPrint uses M-JPEG streamer.

For some reason the stream will never start. I am able to get HDHR stream working so I know crazifuzzy-opendct docker is working.

The Stream address as follows:
http://192.168.10.105/webcam/?action=stream
Below is what I have in my opendct.properties file:
sagetv.device.1076630941.channel_padding=0
sagetv.device.1076630941.consumer=opendct.consumer.DynamicConsumerImpl
sagetv.device.1076630941.custom_channels=
sagetv.device.1076630941.delay_to_wait_after_tuning=0
sagetv.device.1076630941.device_name=OCTO_PRINT
sagetv.device.1076630941.encoder_listen_port=9000
sagetv.device.1076630941.encoder_merit=0
sagetv.device.1076630941.encoder_pool=generic_http
sagetv.device.1076630941.exclusive_server_address=
sagetv.device.1076630941.fast_network_encoder_switch=true
sagetv.device.1076630941.http_password=
sagetv.device.1076630941.http_username=
sagetv.device.1076630941.last_channel=-1
sagetv.device.1076630941.pretuning_executable=
sagetv.device.1076630941.stopping_executable=
sagetv.device.1076630941.stopping_executable_delay_ms=15000
sagetv.device.1076630941.streaming_url=http\://192.168.10.105/webcam/?action\=stream
sagetv.device.1076630941.streaming_url2=
sagetv.device.1076630941.streaming_url2_channels=
sagetv.device.1076630941.transcode_profile=
sagetv.device.1076630941.tuning_delay_ms=0
sagetv.device.1076630941.tuning_executable=
Here is the result from the log when trying to tune:
10:20:58.760 [SageTVRequestHandler-107:Unknown] DEBUG SageTVManager - The requested capture device ' OCTO_PRINT HDMI' did not exist. Triggering re-discovery.
10:20:58.760 [SageTVRequestHandler-59:OCTO_PRINT HDMI] DEBUG SageTVManager - The requested capture device ' OCTO_PRINT HDMI' did not exist. Triggering re-discovery.
10:20:58.760 [SageTVRequestHandler-107:Unknown] ERROR SageTVRequestHandler - SageTV sent: 'BUFFER OCTO_PRINT HDMI|1035039015|1|16777216|/var/media/tv/OCTOPRINTon192168101759000HDMI-0.mpgbuf|Great-H.264', Replied: 'ERROR Invalid Input'
10:20:58.760 [SageTVRequestHandler-59:OCTO_PRINT HDMI] ERROR SageTVRequestHandler - SageTV sent: 'BUFFER OCTO_PRINT HDMI|1035039015|1|16777216|/var/media/tv/OCTOPRINTon192168101759000HDMI-0.mpgbuf|Great-H.264', Replied: 'ERROR Invalid Input'
10:20:58.761 [SageTVRequestHandler-107:Unknown] ERROR SageTVRequestHandler - Encoder device does not exist.
10:20:58.761 [SageTVRequestHandler-59:OCTO_PRINT HDMI] ERROR SageTVRequestHandler - Encoder device does not exist.

Any ideas what I'm doing wrong? Also I noticed that crazifuzzy-opendct docker does not map any default ports. I mapped 9000 are there any other port mappings required?
I don't know if this will actually work, but it's unlikely because OpenDCT doesn't work with MJPEG. You should take a look at the Generic Pipe.

Anyway, based on what I'm seeing, it looks like generic.http.device_names_csv= isn't set. You just need to provide a device name (e.g. generic.http.device_names_csv=OCTO_PRINT).

Posting the full OpenDCT log would be the most helpful however since it would tell me more precisely what happened or didn't happen. What you posted looks like it didn't create the capture device on the OpenDCT side of things but the why would be in the full log.
__________________
SageTV v9 Server: ASRock Z97 Extreme4, Intel i7-4790K @ 4.4Ghz, 32GB RAM, 6x 3TB 7200rpm HD, 2x 5TB 7200rpm HD, 2x 6TB 7200rpm HD, 4x 256GB SSD, 4x 500GB SSD, unRAID Pro 6.7.2 (Dual Parity + SSD Cache).
Capture: 1x Ceton InfiniTV 4 (ClearQAM), 2x Ceton InfiniTV 6, 1x BM1000-HDMI, 1x BM3500-HDMI.

Clients: 1x HD300 (Living Room), 1x HD200 (Master Bedroom).
Software: OpenDCT :: WMC Live TV Tuner :: Schedules Direct EPG
Reply With Quote
  #4  
Old 09-01-2017, 05:30 PM
hvymetal hvymetal is offline
Sage Advanced User
 
Join Date: Nov 2007
Posts: 157
Quote:
Anyway, based on what I'm seeing, it looks like generic.http.device_names_csv= isn't set. You just need to provide a device name (e.g. generic.http.device_names_csv=OCTO_PRINT).
I did have it set. Attached is the full log file and config file for the http stream.
Attached Files
File Type: txt opendct.log.txt (38.7 KB, 311 views)
File Type: txt wrapper - .txt (676.0 KB, 307 views)
File Type: txt opendct .properties.txt (8.1 KB, 307 views)

Last edited by hvymetal; 09-01-2017 at 09:23 PM.
Reply With Quote
  #5  
Old 09-01-2017, 09:12 PM
hvymetal hvymetal is offline
Sage Advanced User
 
Join Date: Nov 2007
Posts: 157
Ok I also tried Generic Pipe again but still unable to get the stream to play in SageTV.

Here are the steps I followed:
1.Installed and verified FFMPEG
A. Download static FFMPEG and copied to docker directory /opendct/opt/ffmpeg (https://johnvansickle.com/ffmpeg/)
B. Connected to docker using docker exec -it crazifuzzy-opendct /bin/bash -c "export TERM=xterm; exec bash"
C. executed the streaming_executable listed in step 6. This caused the stream to display scrolling and random characters in the terminal.
D. killed t FFMPEG process with another instance of a terminal (If this was not done the Docker would hang when stopping the container and would require a reboot)
2. Stopped OpenDCT docker
3. Add generic.pipe.device_names_csv=OCTO_PRINTER2 to config
4. Start OpenDCT docker
5. Stop OpenDCT docker
6. Add sagetv.device.-444781814.streaming_executable=/opt/opendct/ffmpeg/ffmpeg -f lavfi -i anullsrc -i http\://192.168.10.105/webcam/?action\=stream -shortest -c\:a mp3 -c\:v copy -f mpegts pipe\:1 to config
7. Start OpenDCT docker
The stream will not start in SageTV. I attached my logs and config file. What ports are required for OpenDCT? The docker does not have any mapped.
Attached Files
File Type: txt opendct -PIPE.log.txt (38.2 KB, 305 views)
File Type: txt opendct -PIPE.properties.txt (8.0 KB, 298 views)
File Type: txt wrapper - PIPE.log.txt (165.2 KB, 309 views)

Last edited by hvymetal; 09-01-2017 at 09:27 PM.
Reply With Quote
  #6  
Old 09-02-2017, 08:21 PM
EnterNoEscape's Avatar
EnterNoEscape EnterNoEscape is offline
SageTVaholic
 
Join Date: Jun 2010
Location: Harrisburg, PA
Posts: 2,657
I'm confused about why the hash seems to change for a device that doesn't change names. I know Java doesn't guarantee that the hashes between one OS will be same on another OS, but I got -903334296 on both Windows and Linux and in your properties I'm seeing -444781814 and -903334296. Remove all of the entries for -444781814 as I see you have the exact same device name there and set up -903334296 instead.
__________________
SageTV v9 Server: ASRock Z97 Extreme4, Intel i7-4790K @ 4.4Ghz, 32GB RAM, 6x 3TB 7200rpm HD, 2x 5TB 7200rpm HD, 2x 6TB 7200rpm HD, 4x 256GB SSD, 4x 500GB SSD, unRAID Pro 6.7.2 (Dual Parity + SSD Cache).
Capture: 1x Ceton InfiniTV 4 (ClearQAM), 2x Ceton InfiniTV 6, 1x BM1000-HDMI, 1x BM3500-HDMI.

Clients: 1x HD300 (Living Room), 1x HD200 (Master Bedroom).
Software: OpenDCT :: WMC Live TV Tuner :: Schedules Direct EPG
Reply With Quote
Reply

Tags
hdmi, iptv, script


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using the OpenDCT Generic Pipe Capture Device EnterNoEscape Hardware Support 101 01-20-2022 12:14 PM
capture device recommendation smithzoos Hardware Support 2 02-29-2016 09:02 PM
USB Capture Device? Skybolt Hardware Support 5 05-07-2013 07:00 PM
Using Motorola Tuner device for capture device cyberfreak Hardware Support 4 02-22-2007 02:47 PM
No AV Capture Device jaelanicu SageTV Recorder Software 5 08-03-2006 02:02 AM


All times are GMT -6. The time now is 01:40 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.