Linux transcoder oddities (Round 2)

I’ve got all sorts of odd results from the hardware transcoder since switching back to Ubuntu Server (17.04). Both from the webUI and using Picture in Picture on the iOS beta using DVR 2017.09.01.0513 and iOS 9.23.753.

On my iPad (1st gen 12.9" Pro) Safari the transcoder starts but the video never plays (eventually erroring out), and in-app PiP results in blocky video with recordings or an odd freeze then no audio on live TV. On my Mac the Safari results are the same, and Edge on Windows 10 the video plays (live or recorded) but has blocky video (similar to how it looked for me in this thread: Web GUI playback (Linux/NAS hardware transcoder) )

Here’s the logs for the scenarios I tried:

Mac Safari - Live. Transcoder starts, video doesn't play:

2017/09/25 19:06:22 [TNR] Opened connection to 1043F954 for ch32.1
2017/09/25 19:06:22 [HLS] Starting transcoder for channel 32.1 (encoder=h264_vaapi, resolution=1080, deinterlacer=linear, bitrate=10000)
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: va_openDriver() returns 0
2017/09/25 19:07:00 [HLS] Stopping transcoder session ANY-ch32.1 @ 36.202833s
2017/09/25 19:07:00 [TNR] Closed connection to 1043F954 for ch32.1
[mpegts @ 0x357b8e0] Dropped corrupted packet (stream = 1)
[mpeg2video @ 0x35838c0] ac-tex damaged at 98 40
[mpeg2video @ 0x35838c0] Warning MVs not available

Mac Safari - Recording. Blocky video during motion but does play:

2017/09/25 19:07:50 [HLS] Starting transcoder for file-5 at 44s (encoder=h264_vaapi, resolution=1080, deinterlacer=linear, bitrate=10000)
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: va_openDriver() returns 0
[mpegts @ 0x3852a20] Dropped corrupted packet (stream = 3)
2017/09/25 19:08:30 [HLS] Stopping transcoder session file-5 @ 1m59.959233s

iPad Pro Safari - Live. Transcoder starts, video doesn't play:

2017/09/25 19:12:44 [TNR] Opened connection to 1043F954 for ch5.1
2017/09/25 19:12:44 [HLS] Starting transcoder for channel 5.1 (encoder=h264_vaapi, resolution=1080, deinterlacer=linear, bitrate=10000)
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: va_openDriver() returns 0
[ac3 @ 0x1cd8d60] frame sync error
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x1cb1fe0] Queue input is backward in time
[hls @ 0x1c8d300] Non-monotonous DTS in output stream 0:1; previous: 12480, current: 11520; changing to 12481. This may result in incorrect timestamps in the output file.

Windows 10 Edge - Live. Blocky most of the time but does play:

2017/09/25 19:16:33 [TNR] Opened connection to 1043F954 for ch5.1
2017/09/25 19:16:33 [HLS] Starting transcoder for channel 5.1 (encoder=h264_vaapi, resolution=1080, deinterlacer=linear, bitrate=10000)
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: va_openDriver() returns 0
[ac3 @ 0x31085c0] frame sync error
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x34eeea0] Queue input is backward in time
[hls @ 0x30be2a0] Non-monotonous DTS in output stream 0:1; previous: 10560, current: 9600; changing to 10561. This may result in incorrect timestamps in the output file.
2017/09/25 19:17:08 [HLS] Stopping transcoder session ANY-ch5.1 @ 33.6336s
2017/09/25 19:17:08 [TNR] Closed connection to 1043F954 for ch5.1
[mpegts @ 0x30658e0] Dropped corrupted packet (stream = 1)
[mpeg2video @ 0x306d8c0] ac-tex damaged at 30 29
[mpeg2video @ 0x306d8c0] Warning MVs not available
[ac3 @ 0x31085c0] incomplete frame

iOS App Picture in Picture - Live. Blocky during motion until freeze at about 10 seconds then resumes with no audio:

2017/09/25 19:21:12 [TNR] Opened connection to 1043F954 for ch32.1
2017/09/25 19:21:12 [HLS] Starting transcoder for channel 32.1 (encoder=h264_vaapi, resolution=0, deinterlacer=linear, bitrate=10000)
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: va_openDriver() returns 0
2017/09/25 19:22:14 [HLS] Stopping transcoder session ANY-ch32.1 @ 1m0.326933s
2017/09/25 19:22:14 [TNR] Closed connection to 1043F954 for ch32.1
[mpegts @ 0x36808e0] Dropped corrupted packet (stream = 1)
[mpeg2video @ 0x36888c0] ac-tex damaged at 68 57
[mpeg2video @ 0x36888c0] Warning MVs not available

How does it look if you switch to Software transcoding?

No change in Safari unfortunately, I’ll give the app and Windows a go too if need be:

iPad Safari - Live. Same transcoder starts, but video doesn't:

2017/09/25 20:23:12 [HLS] Starting transcoder for channel 5.1 (encoder=h264_vaapi, resolution=1080, deinterlacer=linear, bitrate=10000)
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: va_openDriver() returns 0
[ac3 @ 0x1f93260] frame sync error
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x241e6c0] Queue input is backward in time
[hls @ 0x2312f20] Non-monotonous DTS in output stream 0:1; previous: 12480, current: 11520; changing to 12481. This may result in incorrect timestamps in the output file.
2017/09/25 20:24:11 [HLS] Stopping transcoder session ANY-ch5.1 @ 57.390667s
[mpegts @ 0x1f268e0] Dropped corrupted packet (stream = 1)
[mpeg2video @ 0x1f2e8c0] ac-tex damaged at 90 65
[mpeg2video @ 0x1f2e8c0] Warning MVs not available
[ac3 @ 0x1f93260] incomplete frame

Mac Safari - Live. Same as the iPad :( :

2017/09/25 20:26:03 [HLS] Starting transcoder for channel 5.1 (encoder=h264_vaapi, resolution=1080, deinterlacer=linear, bitrate=10000)
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: va_openDriver() returns 0
[ac3 @ 0x27e6fe0] frame sync error
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x2559480] Queue input is backward in time
[hls @ 0x26c6160] Non-monotonous DTS in output stream 0:1; previous: 12480, current: 11520; changing to 12481. This may result in incorrect timestamps in the output file.
2017/09/25 20:26:36 [HLS] Stopping transcoder session ANY-ch5.1 @ 32.032s
[mpegts @ 0x235a8e0] Dropped corrupted packet (stream = 1)
[mpeg2video @ 0x23628c0] invalid cbp -1 at 45 42
[mpeg2video @ 0x23628c0] Warning MVs not available
[ac3 @ 0x27e6fe0] incomplete frame

I guess the server specs might help! :slight_smile:

OS
Linux Ubuntu
17.04 (kernel: 4.10.0-35-generic)
CPU
4 cores / Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz
load averages:  0.49  0.63  0.65
RAM
16.49 GB
95.4% free

Edit: Software on Mac Safari with a recording played but had the same blockiness as Hardware

This means the hardware decoder is still being used.

Make sure you switch to software on the Settings tab of the dvr. You can test with a single client of your choice- they should all behave the same way.

Oops! Sorry about that (really thought I had changed it!)

2017/09/26 06:46:09 [TNR] Opened connection to 10401921 for ch5.1
2017/09/26 06:46:09 [HLS] Starting transcoder for channel 5.1 (encoder=libx264, resolution=1080, deinterlacer=linear, bitrate=10000)
[ac3 @ 0x1b03a20] frame sync error
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x1ada820] Queue input is backward in time
[hls @ 0x1dabbe0] Non-monotonous DTS in output stream 0:1; previous: 12480, current: 11520; changing to 12481. This may result in incorrect timestamps in the output file.
2017/09/26 06:46:45 [HLS] Stopping transcoder session ANY-ch5.1 @ 34.968267s
2017/09/26 06:46:45 [TNR] Closed connection to 10401921 for ch5.1
[mpegts @ 0x1a46420] Dropped corrupted packet (stream = 1)
[mpeg2video @ 0x1a4e540] ac-tex damaged at 98 36
[mpeg2video @ 0x1a4e540] Warning MVs not available
[ac3 @ 0x1b03a20] incomplete frame

This is iPad Safari again, transcoder started but no video.

Just to add, 1080/6Mb and 720/6Mb, Software had the same results with slightly different logs:

720/6:
[mpeg2video @ 0x2869540] invalid cbp -1 at 98 17
[mpeg2video @ 0x2869540] Warning MVs not available
[ac3 @ 0x28f3900] incomplete frame

1080/6:
[mpegts @ 0x1e71420] Dropped corrupted packet (stream = 1)
[mpeg2video @ 0x2220260] invalid cbp -1 at 101 52
[mpeg2video @ 0x2220260] Warning MVs not available
[ac3 @ 0x1fc4500] incomplete frame

Meanwhile, PiP on software works perfectly! No blockiness, it did not freeze and lose audio after 10 or so seconds on either live or recording. Weird stuff! :man_shrugging:

Has it going on all the Safari’s now! Still quite blocky though no matter the bitrate.