Premium TV issues with Web Player

Are there plans to offer other types of streaming options when viewing from the web player? I’ve had mixed results from my Windows PC and Android phone where the video plays for a few seconds and stops streaming. I never have any issues watching live TV or recordings through my Shield using the native client.

In anticipation of SD’s use of the HEVC codec for Premium TV, wouldn’t it be preferred to send the video without having to transcode it? I’m speaking about playback on the local LAN and not remote viewing, since there is no native client for Android phones. I would think transcoding HEVC to H264 for HLS streaming would be taxing on the server that runs Channels DVR. Thanks.

HLS is a format not a codec. HLS streams can be either H264 or HEVC. If your streams are already H264, no transcoding is performed unless you ask for a lower quality. The h264 video is simply remuxed into the HLS format.

Unfortunately browsers are very picky about the formats and codecs they will play. With our native apps we have full control over the format and can usually play the original stream back without any transcoding or remuxing.

Using a different browser can help. Chrome is usually the best. When you have freezing problems does it say transcoding or remuxing under the player?

Hmm…

I’ve gotten two different results:

Remux Running and shows a Play icon. If I hit the play icon it just spins forever.

2018/08/31 17:25:06 [TNR] Sharing existing connection to 1070F8AE for ch1113 (clients=2, len=0)
2018/08/31 17:25:09 [HLS] Probing live stream for codec/bitrate took 2.212540795s
2018/08/31 17:25:09 [HLS] Starting transcoder for channel 1113 from 192.168.1.75 (encoder=remux, resolution=1080, deinterlacer=, bitrate=10000)
[mpegts @ 0x25f6540] Dropped corrupted packet (stream = 0)

Second attempt I saw:
Trancoder starting and it’s just spinning

2018/08/31 17:27:06 [TNR] Sharing existing connection to 1070F8AE for ch1113 (clients=2, len=0)
2018/08/31 17:27:09 [HLS] Probing live stream for codec/bitrate took 3.156863006s
2018/08/31 17:27:09 [HLS] Starting transcoder for channel 1113 from 192.168.1.75 (encoder=libx264, resolution=1080, deinterlacer=blend, bitrate=10000)
[mpegts @ 0x23a2740] Dropped corrupted packet (stream = 0)
[h264 @ 0x25d90c0] co located POCs unavailable
[h264 @ 0x23f4a40] co located POCs unavailable
Too many packets buffered for output stream 0:1.
[aac @ 0x243ee00] 2 frames left in the queue on closing

The first is for a h264 channel, and the second must be from a mpeg2 channel.

Does the time counter next to “Remux running” increase? If so, that means the transcoder is fine but the browser is choking on video packets for some reason. What browser are you using?

They both should be from the same channel (1113 - MSNBC) which is a Premium TV channel so no mepg2. The recording is happening on a hdhomerun quattro. I also have an extender that records locals but that’s set to transcode in h264.

I’m deliberately picking a show that’s being recorded with (tuner sharing enabled) from the “On Now” tab. It happened again just now. This browser is Chrome for Windows 10 x64, latest version.

Trancoder starting and it’s just spinning

2018/08/31 17:45:21 [TNR] Sharing existing connection to 1070F8AE for ch1113 (clients=2, len=0)
2018/08/31 17:45:24 [HLS] Probing live stream for codec/bitrate took 3.15593474s
2018/08/31 17:45:24 [HLS] Starting transcoder for channel 1113 from 192.168.1.75 (encoder=libx264, resolution=1080, deinterlacer=blend, bitrate=10000)
[mpegts @ 0x1f8c740] Dropped corrupted packet (stream = 0)
[h264 @ 0x1fcdb00] co located POCs unavailable
[h264 @ 0x1fe3940] mmco: unref short failure
[h264 @ 0x204bc00] co located POCs unavailable
Too many packets buffered for output stream 0:1.
[aac @ 0x1fc0000] 2 frames left in the queue on closing

I just tried to start the same show from the Recordings tab and got this:

Remux Paused: 14m23.763211s @ 51x

2018/08/31 17:54:39 [HLS] Starting transcoder for file142-ip192.168.1.75 at 9m17s from 192.168.1.75 (encoder=remux, resolution=1080, deinterlacer=, bitrate=10000)
[mpegts @ 0x2251480] Dropped corrupted packet (stream = 0)
2018/08/31 17:54:45 [HLS] Pausing transcoder (out: 14m23.763211s, view: 9m18s)…

Seems like something funky is going on. The first time it said encoder=remux, which is what I would expect for h264. But the other times it is using encoder=libx264 for some reason.

The recording playback log looks pretty normal. Is that one failing to play, or getting stuck after a few seconds?

It fails to play. I just tried to restart the server assuming it would fix the issue but got the following. It was in the middle of a recording, wonder if that explains the error below. It still fails to play though…

ctalbot@Plex:~$ sudo systemctl restart channels-dvr
[sudo] password for ctalbot:
2018/08/31 18:04:17 [SYS] Shutting down…
2018/08/31 18:04:17 [SYS] Bonjour service stopped.
2018/08/31 18:04:17 [DVR] Commercial detection failed with signal: terminated
2018/08/31 18:04:17 database not open
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb54819]

goroutine 100 [running]:
_/home/vagrant/channels-server-x86_64/dvr.(*File).Refresh(0xc427c0fe00)
/home/vagrant/channels-server-x86_64/dvr/file.go:90 +0x49
_/home/vagrant/channels-server-x86_64/dvr.(*Recorder).RunProcessor(0xc4203a01a0)
/home/vagrant/channels-server-x86_64/dvr/recorder.go:413 +0x603
created by _/home/vagrant/channels-server-x86_64/dvr.(*Recorder).Run
/home/vagrant/channels-server-x86_64/dvr/recorder.go:149 +0xa9
2018/08/31 18:04:17 [SYS] Starting Channels DVR v2018.08.31.0043 (linux-x86_64) in /home/ctalbot/channels-dvr/data
ctalbot@Plex:~$ 2018/08/31 18:04:17 [HDR] Found 2 devices
2018/08/31 18:04:18 [SYS] Started HTTP Server

ctalbot@Plex:~$ 2018/08/31 18:04:19 [DVR] Recording engine started in /mnt/TV_Recordings
2018/08/31 18:04:19 [SYS] Bonjour service running for dvr-plex.local. [192.168.1.40]
2018/08/31 18:04:19 [DVR] Starting job 1535756400-49 Erin Burnett OutFront on ch=[1111]
2018/08/31 18:04:19 [DVR] Waiting 55m40.658606116s until next job 1535760000-4 Anderson Cooper 360
2018/08/31 18:04:19 [DVR] Processing file-142: TV/The Beat With Ari Melber/The Beat With Ari Melber 2018-08-31 2018-08-31-1700.mpg
2018/08/31 18:04:19 [DVR] Running commercial detection on file 142 (TV/The Beat With Ari Melber/The Beat With Ari Melber 2018-08-31 2018-08-31-1700.mpg)
sudo systemctl restart channels-dvr2018/08/31 18:04:20 [TNR] Opened connection to 1070F8AE for ch1111
2018/08/31 18:04:20 [DVR] Recording for job 1535756400-49 from 1070F8AE ch1111 into “TV/Erin Burnett OutFront/Erin Burnett OutFront 2018-08-31 2018-08-31-1800.mpg” for 56m10.6585588s
2018/08/31 18:04:29 [IDX] Pruned 856 expired airings from USA-OTA60177 in 619.29313ms.
2018/08/31 18:04:30 [IDX] Pruned 451 expired airings from HDHR-PREMIUM in 343.250773ms.

2018/08/31 18:08:05 [HLS] Starting transcoder for file142-ip192.168.1.75 at 9m17s from 192.168.1.75 (encoder=remux, resolution=1080, deinterlacer=, bitrate=10000)
[mpegts @ 0x2b67480] Dropped corrupted packet (stream = 0)
2018/08/31 18:08:11 [HLS] Pausing transcoder (out: 14m22.216s, view: 9m18s)…

A hard kill like that is not advised. Yes that explains the error.

The transcoder appears to be working fine. You can try on the SHIELD setting your DVR > Home Streaming Quality to 1080p. That will force it to use the remuxer the same way the browser. If it still plays on the SHIELD, that means the remuxer is working fine (and the logs do seem fine, its remuxing 5 minute of video very quickly and then pausing itself).

Can you try Firefox on your PC to see if there’s any difference?

I just tried a show in the “On Now” tab with Firefox 61.0.2

“Transcoder Starting” with a spinning disc.

2018/08/31 18:17:59 [TNR] Sharing existing connection to 1070F8AE for ch1111 (clients=2, len=0)
2018/08/31 18:18:02 [HLS] Probing live stream for codec/bitrate took 3.143514045s
2018/08/31 18:18:02 [HLS] Starting transcoder for channel 1111 from 192.168.1.75 (encoder=libx264, resolution=1080, deinterlacer=blend, bitrate=10000)
[mpegts @ 0x2765740] Dropped corrupted packet (stream = 0)
[h264 @ 0x27b7d80] mmco: unref short failure
Too many packets buffered for output stream 0:1.
[aac @ 0x279a480] 2 frames left in the queue on closing

I just tried again and am noticing " Buffer Warnings"

2018/08/31 18:17:59 [TNR] Sharing existing connection to 1070F8AE for ch1111 (clients=2, len=0)
2018/08/31 18:18:02 [HLS] Probing live stream for codec/bitrate took 3.143514045s
2018/08/31 18:18:02 [HLS] Starting transcoder for channel 1111 from 192.168.1.75 (encoder=libx264, resolution=1080, deinterlacer=blend, bitrate=10000)
[mpegts @ 0x2765740] Dropped corrupted packet (stream = 0)
[h264 @ 0x27b7d80] mmco: unref short failure
Too many packets buffered for output stream 0:1.
[aac @ 0x279a480] 2 frames left in the queue on closing
2018/08/31 18:19:36 [WRN] Buffer for 1070F8AE ch1111 is more than 50% full (clients=2, len=16777816)

Try just playing the recording from the other browser and the shield with transcoder enabled.

Something weird is going on when joining a tuner sharing stream for web playback. I will check it out.

By the way, the directory where the recordings, database, etc. are located are on an NFS mount point that’s exported from my Synology array, if that matters any.

Writing to a network mount is not ideal, but if its wired it should be okay.

You can also open Chrome dev tools console and run Hls.DefaultConfig.debug = true to enable debug logging in the web player. Maybe you’ll see some errors that correspond with the stall.

Any particular tab I should be looking at? I launched a show that has the disc spinning. In the Chrome dev console I see “stream.m3.u8” scrolling by in the Network tab.

hmm… In the console tab I see this:

event {Type: “hello”, Version: “2018.08.31.0043”}
bundle.js:21 jsonpipe connecting
bundle.js:21 jsonpipe connected
bundle.js:21 event {Type: “hello”, Version: “2018.08.31.0043”}
bundle.js:16 VIDEOJS: Cast APIs are available
event {Type: “activities.set”, Name: “7-ch1111-dANY-ip192.168.1.75”, Value: “Watching ch1111 from 192.168.1.75 (Starting).”}
6bundle.js:26 GET http://192.168.1.40:8089/devices/ANY/channels/1111/hls/stream.m3u8/stream1.ts? 404 (Not Found)

Here’s a view web from the browser if that helps:

Ok, it’s wired, gigabit Ethernet between the two.

Use a recording to test. There are many more moving parts with live tv, and you appear to be hitting some bug related to tuner sharing. So use a recording for testing so we can narrow down what’s happening with the transcoder.

Ok, just tried the recording and it pauses.

2018/08/31 19:10:00 [HLS] Starting transcoder for file143-ip192.168.1.75 at 7m31s from 192.168.1.75 (encoder=remux, resolution=1080, deinterlacer=, bitrate=10000)
[mpegts @ 0x38d7480] Dropped corrupted packet (stream = 1)
Last message repeated 3 times
[mpegts @ 0x38d7480] Dropped corrupted packet (stream = 0)
2018/08/31 19:10:06 [HLS] Pausing transcoder (out: 12m38.242667s, view: 7m32s)…

It seems like the remuxer/transcoder is generating broken output for some reason. Can you try playing remuxed stream from the SHIELD to see if it plays or chokes similarly? That would definitely isolate to either the web player or the server side transcoder.

I just tried to play the same recording on the Sheild without issue. I changed the home streaming from original to 1080p as requested.

I don’t think I’ve ever had an issue playing live tv or a recording on the sheild.